[LLVMdev] Linux-x86 Compatability
Chris Lattner
sabre at nondot.org
Fri Sep 13 11:17:01 PDT 2002
> 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.
I think that it was required under linux to get the LITTLE_ENDIAN #define.
Alternatively, under linux, #including ctype.h will work (because it
includes endian.h).
Do you know how to figure out endianness on BSD?
-Chris
> > -----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
> >
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-Chris
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/
More information about the llvm-dev
mailing list