Re: determine base type of a typedef

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul,

Thanks for your suggestion.

If I understand you correctly, I should use something like AC_COMPILE_IFELSE with the code with a redefine as you specified, right?

Something like:

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
extern time_t foo;
extern long long int foo;]],[[]])],time_fmt="%lld",
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
    extern time_t foo;
    extern long int foo;]],[[]])],time_fmt="%ld",time_fmt="-")
)


On 23/10/20 14:16, Paul Eggert wrote:
> On 10/22/20 6:09 PM, Russell Shaw wrote:
>>     else if(sizeof(time_t) == sizeof(long int)) { 
> 
> This is not the right kind of test. You want to test whether time_t and int are the same types, not whether they're the same size. To do that, you should use code like this:
> 
> extern time_t foo;
> extern long int foo;
> 
> Of course this means you'll need to compile N programs rather than one, but that's life in the big Autoconf city.
> 




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux