Re: eXene and openGL
Vesa Karvonen <vesa.karvonen-bbCR+/[email protected]>
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <[email protected]> |
Quoting brian <briand-/[email protected]>: [...] > Unfortunately there are a lot of other includes which still break > things. For example, MAC has an OSTYPE.h file which causes me > problems all the time because it inlines actual function definitions. AFAIK, the C Kit, which is the front-end of mlnlffigen, can parse function definitions. It should not be very difficult to change ml[-]nlffigen to just skip function definitions in headers. > What I have found in practice is that application of gcc -E | grep | > emacs "#if 0 ... #endif" actually gets you to a workable solution > rather quickly. Depending on the how the file is set-up it can be > portable. [...] > I was able to get 80+% of the sdl header done in about 1/2 hour. > Interestigly almost all of the fallout is due to the stdio.h > definition for FILE ! That approach doesn't work for the situations I have in mind. One problem is that the interfaces to the C libraries may change. This would mean extra manual work each time a C library interface changes. More importantly, one would have to be careful to watch out for changes that might break something silently. Also, different platforms sometimes choose different basic types or support different subsets of functionality. This would mean that one would have to manually create (and maintain) multiple versions of such manually created headers. The software that I'm working on at work, for instance, has to run on a wide variety of platforms (32- and 64-bit Windows, Linux and various Unix platforms). This kind of solution (manually create headers) would simply be unacceptably laborious. > The fftw header file I created is portable because it only refers to > doubles and the like. Unless I'm mistaken, I saw definitions for some standard C typedefs like size_t in you fftw headers. Such definitions are not portable. Different C implementations may choose different types (even types of different size) for typedefs like size_t. This means that the fftw headers you created only work on platforms that happen to choose the same types. (The approach that I'm using in my libc interface is to generate such definitions separately for each platform.) -Vesa Karvonen ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV