Chris Lattner wrote:>>ISSUE: INT64_MAX undefined in InstrSelectionSupport.cpp and >>InstructionCombining.cpp. I'm not completely sure where INT64_MAX comes >>from on Solaris, but C99 says that INT64_MAX is defined in stdint.h, >>but, for C++, only if __STDC_LIMIT_MACROS is #defined. Solaris (at >>least in CSIL) unfortunately does not have stdint.h, but it does have >>the old inttypes.h - and so does Linux. >> >> > >Interesting. INT64_MAX is supposed to be provided by >include/Support/DataTypes.h. Do you know of a reliable preprocessor >symbol that can be used to determine whether we're on a linux box, or > >Well, there is always __linux__, but that doesn't necessarily imply that we are on a Linux box with stdint.h.>(better yet) whether the system has a valid <stdint.h>? > >Nope. Autoconf is definitely the way to go here (even though converting is a pain).>Thanks, > >-Chris > >http://llvm.cs.uiuc.edu/ >http://www.nondot.org/~sabre/Projects/ > >-- Casey Carter Casey at Carter.net ccarter at uiuc.edu AIM: cartec69
> >Interesting. INT64_MAX is supposed to be provided by > >include/Support/DataTypes.h. Do you know of a reliable preprocessor > >symbol that can be used to determine whether we're on a linux box, or> Well, there is always __linux__, but that doesn't necessarily imply that > we are on a Linux box with stdint.h.Ok, I'll switch to that from the placeholder "LINUX".> >(better yet) whether the system has a valid <stdint.h>?> Nope. Autoconf is definitely the way to go here (even though converting > is a pain).Agreed. We plan to autoconfiscate LLVM eventually, but it won't get started for quite some time. In the meantime, the #ifdef __linux__ hack should be sufficient. Thanks for the help, -Chris http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/
Is the #include <endian.h> necessary for Linux or is that a leftover artifact from before? I'm trying to get this code to compile on MacOS (which is based on BSD), and stdint.h exists there, but not endian.h. --Vikram ---------------------------------------------------------------------- VIKRAM S. ADVE Assistant Professor E-MAIL: vadve at cs.uiuc.edu Department of Computer Science PHONE: (217) 244-2016 Univ. of Illinois at Urbana-Champaign FAX: (217) 244-6869 1304 W. Springfield Ave. http://www.cs.uiuc.edu/~vadve Urbana IL 61801. ----------------------------------------------------------------------> -----Original Message----- > From: llvmdev-admin at cs.uiuc.edu [mailto:llvmdev-admin at cs.uiuc.edu]On > Behalf Of Chris Lattner > Sent: Friday, September 13, 2002 10:41 AM > To: Casey Carter > Cc: LLVMdev List > Subject: Re: [LLVMdev] Linux-x86 Compatability > > > > >Interesting. INT64_MAX is supposed to be provided by > > >include/Support/DataTypes.h. Do you know of a reliable preprocessor > > >symbol that can be used to determine whether we're on a linux box, or > > > Well, there is always __linux__, but that doesn't necessarily imply that > > we are on a Linux box with stdint.h. > > Ok, I'll switch to that from the placeholder "LINUX". > > > >(better yet) whether the system has a valid <stdint.h>? > > > Nope. Autoconf is definitely the way to go here (even though converting > > is a pain). > > Agreed. We plan to autoconfiscate LLVM eventually, but it won't get > started for quite some time. In the meantime, the #ifdef __linux__ hack > should be sufficient. > > Thanks for the help, > > -Chris > > http://llvm.cs.uiuc.edu/ > http://www.nondot.org/~sabre/Projects/ > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev >
Chris Lattner wrote:>>>Interesting. INT64_MAX is supposed to be provided by >>>include/Support/DataTypes.h. Do you know of a reliable preprocessor >>>symbol that can be used to determine whether we're on a linux box, or >>> >>> > > > >>Well, there is always __linux__, but that doesn't necessarily imply that >>we are on a Linux box with stdint.h.s >> >> > >Ok, I'll switch to that from the placeholder "LINUX". > >Inspection of DataTypes.h shows that inttypes.h is included before the test for linux / definition of __STDC_LIMIT_MACROS. This will not work, since stdint.h is implemented by including inttypes.h, which was already included the first time with __STDC_LIMIT_MACROS not defined. I think the best solution to this problem is to change DataTypes.h to simply: #define __STDC_LIMIT_MACROS #include <inttypes.h> Which will work on both Linux and Solaris without requiring platform detection. -- Casey Carter Casey at Carter.net ccarter at uiuc.edu AIM: cartec69