on Visual studio I can force use of 32 bit time_t by declaring _USE_32BIT_TIME_T is there a similar equivalent for gcc? or is it always 32 bit or is it always 64 bit?
A:
The time_t
type is not defined by gcc but rather by system library. On Linux, this is glibc, and it defines time_t
in time.h
header:
typedef __time_t time_t;
which is in turn defined in bits/types.h
:
__STD_TYPE __TIME_T_TYPE __time_t;
(__STD_TYPE
definition is not interesting),
__TIME_T_TYPE
is defined in bits/typesizes.h
:
#define __TIME_T_TYPE __SLONGWORD_TYPE
which is in turn defined in bits/types.h
:
#define __SLONGWORD_TYPE long int
which is 32 bits on 32 bits system, 64 bits on 64 bits system. All these definitions are unconditional, so, no _USE_32BIT_TIME_T
equivalent on glibc.
Laurynas Biveinis
2010-04-14 07:33:11
so as long as I compiled on 32 bit platform it should be fine. any info for gcc on Mac?
AppDeveloper
2010-04-14 23:31:59
@SnapConfig.com You can check Mac headers the same way I did on Linux
Laurynas Biveinis
2010-04-15 04:16:23