Henrik Bach
2004-Sep-25 14:51 UTC
[LLVMdev] Hardcoded HAVE_* defines in the DataTypes.h include file
Hi I noticed that these defines (line 35 to 37) are hardcoded in the DataTypes.h include file: ---------------- #define HAVE_SYS_TYPES_H 1 #define HAVE_INTTYPES_H 1 #define HAVE_STDINT_H 1 ---------------- Shouldn't they have be defined by the configure script into llvm/Config/config.h? Henrik _________________________________________________________________ Undg� pop-ups med MSN Toolbar - http://toolbar.msn.dk/ hent den gratis!
John Criswell
2004-Sep-27 14:34 UTC
[LLVMdev] Hardcoded HAVE_* defines in the DataTypes.h include file
Henrik Bach wrote:> Hi > > I noticed that these defines (line 35 to 37) are hardcoded in the > DataTypes.h include file: > ---------------- > #define HAVE_SYS_TYPES_H 1 > #define HAVE_INTTYPES_H 1 > #define HAVE_STDINT_H 1 > ---------------- > > Shouldn't they have be defined by the configure script into > llvm/Config/config.h?These lines are set by the configure script (checkout DataTypes.h.in in the source tree in the same directory). The DataTypes.h file, as I understand it, is a public header that is used by programs outside of the LLVM source base. Because of that, we don't want to #include config.h, as most projects have their own config.h. However, it still needs to get these macros. To fix this, the configure script sets these macros in the DataTypes.h file directly (similar to what it does for config.h). In this way, DataTypes.h works on the platform for which it has been configured, but external programs that #include it don't get conflicts with their own config.h file. Reid can probably give you a better explanation. -- John T.> > Henrik > > _________________________________________________________________ > Undgå pop-ups med MSN Toolbar - http://toolbar.msn.dk/ hent den gratis! > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev-- ********************************************************************* * John T. Criswell Email: criswell at uiuc.edu * * Research Programmer * * University of Illinois at Urbana-Champaign * * * * "It's today!" said Piglet. "My favorite day," said Pooh. * *********************************************************************
Misha Brukman
2004-Sep-27 16:19 UTC
[LLVMdev] Hardcoded HAVE_* defines in the DataTypes.h include file
On Mon, Sep 27, 2004 at 09:34:16AM -0500, John Criswell wrote:> Henrik Bach wrote: > >I noticed that these defines (line 35 to 37) are hardcoded in the > >DataTypes.h include file: > >---------------- > >#define HAVE_SYS_TYPES_H 1 > >#define HAVE_INTTYPES_H 1 > >#define HAVE_STDINT_H 1 > >---------------- > >Shouldn't they have be defined by the configure script into > >llvm/Config/config.h? > > These lines are set by the configure script (checkout DataTypes.h.in > in the source tree in the same directory). > > The DataTypes.h file, as I understand it, is a public header that is > used by programs outside of the LLVM source base. Because of that, we > don't want to #include config.h, as most projects have their own > config.h. However, it still needs to get these macros. > > To fix this, the configure script sets these macros in the DataTypes.h > file directly (similar to what it does for config.h).To be more precise, include/llvm/Support/DataTypes.h.in is the source file, and DataTypes.h is the output file created by configure. -- Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu
Reasonably Related Threads
- [LLVMdev] Hardcoded HAVE_* defines in the DataTypes.h include file
- [LLVMdev] A patch for refine the cmake system and also configure
- [LLVMdev] A patch for refine the cmake system and also configure
- [LLVMdev] A patch for refine the cmake system and also configure
- [LLVMdev] DataTypes.h for Visual C