Wirawan Purwanto
Wirawan Purwanto

Reputation: 4043

Autoconf: detecting if target platform is 32-bit or 64-bit

In GNU Autoconf: is there an easy way (premade macro? or autoconf-archive macro?) to determine the bitness of our target platform is 32-bit or 64-bit? In case you are curious why I asked this: I need to know this since in the good'old Fortran (pre-2003) there is no way to determine if size_t is 4-byte or 8-byte wide.

Upvotes: 2

Views: 1330

Answers (1)

William Pursell
William Pursell

Reputation: 212288

You can use AC_CHECK_SIZEOF to determine the size of a void *. ( I assume the definition of "64 bit" machine is that void * are size 8, although perhaps you care about the size of an int.)

Upvotes: 5

Related Questions