Place to put 64bit and 32bit HEADER files
OK, my product has a header file, _pli_types.h, that is generated by configure to account for word size in defining 64bit and 32bit types. But if I'm going to support 64 and 32bit compilation on AMD64, I'm going to need to do something about that. I may be able to resort to inttypes.h for this specific problem, but is there a general solution? -- Steve Williams "The woods are lovely, dark and deep. steve at icarus.com But I have promises to keep, http://www.icarus.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep."
On Thu, Oct 02, 2003 at 11:20:14AM -0700, Stephen Williams wrote:
OK, my product has a header file, _pli_types.h, that is generated by configure to account for word size in defining 64bit and 32bit types. But if I'm going to support 64 and 32bit compilation on AMD64, I'm going to need to do something about that. I may be able to resort to inttypes.h for this specific problem, but is there a general solution?
configure normally runs test programs. e.g. run something like is64bit.c: int main(void) { return sizeof(long)==8 ? 0 : 1; } that can you test with an shell if then and generate your include files. -Andi
Andi Kleen ak-at-suse.de |suse-amd64| wrote:
On Thu, Oct 02, 2003 at 11:20:14AM -0700, Stephen Williams wrote:
OK, my product has a header file, _pli_types.h, that is generated by configure to account for word size in defining 64bit and 32bit types. But if I'm going to support 64 and 32bit compilation on AMD64, I'm going to need to do something about that. I may be able to resort to inttypes.h for this specific problem, but is there a general solution?
configure normally runs test programs.
e.g. run something like
is64bit.c:
int main(void) { return sizeof(long)==8 ? 0 : 1; }
that can you test with an shell if then and generate your include files.
Of course I can (and do) generate my header files that way. But if I compile -with -m32, I get a different result, and thus a different header file. So now if I want to support both 64bit and 32bit development on SLES8 (or Linux/AMD64 in general) then where to I put those two header files? -- Steve Williams "The woods are lovely, dark and deep. steve at icarus.com But I have promises to keep, http://www.icarus.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep."
Hi, On Thu, 2 Oct 2003, Stephen Williams wrote:
OK, my product has a header file, _pli_types.h, that is generated by configure to account for word size in defining 64bit and 32bit types. But if I'm going to support 64 and 32bit compilation on AMD64, I'm going to need to do something about that. I may be able to resort to inttypes.h for this specific problem, but is there a general solution?
It would really be better to use generic POSIX (or glibc) headers, i.e.
inttypes.h. If you really, really need this, you can do like the asm
headers on amd64 for system. For a header x.h they have
asm-i386/x.h and asm-x86_64/x.h, and the generic x.h header just does:
#ifdef __x86_64__
#include
participants (3)
-
Andi Kleen
-
Michael Matz
-
Stephen Williams