search for: myopen

Displaying 4 results from an estimated 4 matches for "myopen".

2010 Feb 12
0
[LLVMdev] Portable I/O
...libraries to call and, as such, they are platform dependent. Is there any way to link in an external type definition to an opaque type? We'd need to include some equivalent of stdio.h into the bitcode. I think that the point is that you can define your own standard runtime interfaces: void *myopen(const char*path) { return fopen(path, ...); } That way you're not exposed to libc differences, you have a standard interface that you define. -Chris
2010 Feb 12
2
[LLVMdev] Portable I/O
Hello Óscar, The problem with that idea is that they require a pointer to a FILE structure. This file structure is included from stdio.h which has macros and conditional compilation all over the place. There are no constructors in these libraries to call and, as such, they are platform dependent. Is there any way to link in an external type definition to an opaque type? We'd need to
2010 Feb 12
2
[LLVMdev] Portable I/O
On 02/12/2010 09:51 AM, Chris Lattner wrote: > I think that the point is that you can define your own standard runtime interfaces: > > void *myopen(const char*path) { > return fopen(path, ...); > } Maybe my experience hand-coding LLVM will actually be of some help. What I did for this case is what I think Chris is suggesting--I have a .c file with functions that return whatever FILE* I need as a void* (I think--could have been a c...
2010 Feb 12
0
[LLVMdev] Portable I/O
...0 PM To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> Subject: Re: [LLVMdev] Portable I/O > On 02/12/2010 09:51 AM, Chris Lattner wrote: > >> I think that the point is that you can define your own standard runtime >> interfaces: >> >> void *myopen(const char*path) { >> return fopen(path, ...); >> } > > Maybe my experience hand-coding LLVM will actually be of some help. > What I did for this case is what I think Chris is suggesting--I have a > .c file with functions that return whatever FILE* I need as a void* (I &g...