C 常用基本类型的原型——time_t, size_t 等

time_t

/usr/include/time.h

typedef __time_t time_t;

/usr/include/bits/time.h

struct timeval
  {
    __time_t tv_sec;        /* Seconds.  */
    __suseconds_t tv_usec;  /* Microseconds.  */
  };

/usr/include/bits/types.h

__STD_TYPE __TIME_T_TYPE __time_t;  /* Seconds since the Epoch.  */
__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds.  */
__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds.  */

/usr/include/bits/typesizes.h

#define __TIME_T_TYPE       __SLONGWORD_TYPE
#define __USECONDS_T_TYPE   __U32_TYPE
#define __SUSECONDS_T_TYPE  __SLONGWORD_TYPE

/usr/include/bits/types.h

#define __S16_TYPE      short int
#define __U16_TYPE      unsigned short int
#define __S32_TYPE      int
#define __U32_TYPE      unsigned int
#define __SLONGWORD_TYPE    long int
#define __ULONGWORD_TYPE    unsigned long int

time_t 对应的 printf 格式符 - PRId64(也可以用 "zu", 但是可能不兼容,不推荐)


size_t

/usr/lib/gcc/x86_64-redhat-linux/4.4.4/include/stddef.h

#ifndef __SIZE_TYPE__
#define __SIZE_TYPE__ long unsigned int
#endif
#if !(defined (__GNUG__) && defined (size_t))
typedef __SIZE_TYPE__ size_t;
#ifdef __BEOS__
typedef long ssize_t;
#endif /* __BEOS__ */
#endif /* !(defined (__GNUG__) && defined (size_t)) */

size_t 对应的 printf 格式符 - PRId64(也可以用 "zu", 但是可能不兼容,不推荐)





你可能感兴趣的:(C/C++)