types.m4
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:5k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. dnl $Id: types.m4,v 11.4 1999/12/04 19:18:28 bostic Exp $
  2. dnl Check for the standard shorthand types.
  3. AC_DEFUN(AM_SHORTHAND_TYPES, [dnl
  4. AC_SUBST(ssize_t_decl)
  5. AC_CACHE_CHECK([for ssize_t], db_cv_ssize_t, [dnl
  6. AC_TRY_COMPILE([#include <sys/types.h>], ssize_t foo;,
  7. [db_cv_ssize_t=yes], [db_cv_ssize_t=no])])
  8. if test "$db_cv_ssize_t" = no; then
  9. ssize_t_decl="typedef int ssize_t;"
  10. fi
  11. AC_SUBST(u_char_decl)
  12. AC_CACHE_CHECK([for u_char], db_cv_uchar, [dnl
  13. AC_TRY_COMPILE([#include <sys/types.h>], u_char foo;,
  14. [db_cv_uchar=yes], [db_cv_uchar=no])])
  15. if test "$db_cv_uchar" = no; then
  16. u_char_decl="typedef unsigned char u_char;"
  17. fi
  18. AC_SUBST(u_short_decl)
  19. AC_CACHE_CHECK([for u_short], db_cv_ushort, [dnl
  20. AC_TRY_COMPILE([#include <sys/types.h>], u_short foo;,
  21. [db_cv_ushort=yes], [db_cv_ushort=no])])
  22. if test "$db_cv_ushort" = no; then
  23. u_short_decl="typedef unsigned short u_short;"
  24. fi
  25. AC_SUBST(u_int_decl)
  26. AC_CACHE_CHECK([for u_int], db_cv_uint, [dnl
  27. AC_TRY_COMPILE([#include <sys/types.h>], u_int foo;,
  28. [db_cv_uint=yes], [db_cv_uint=no])])
  29. if test "$db_cv_uint" = no; then
  30. u_int_decl="typedef unsigned int u_int;"
  31. fi
  32. AC_SUBST(u_long_decl)
  33. AC_CACHE_CHECK([for u_long], db_cv_ulong, [dnl
  34. AC_TRY_COMPILE([#include <sys/types.h>], u_long foo;,
  35. [db_cv_ulong=yes], [db_cv_ulong=no])])
  36. if test "$db_cv_ulong" = no; then
  37. u_long_decl="typedef unsigned long u_long;"
  38. fi
  39. dnl DB/Vi use specific integer sizes.
  40. AC_SUBST(u_int8_decl)
  41. AC_CACHE_CHECK([for u_int8_t], db_cv_uint8, [dnl
  42. AC_TRY_COMPILE([#include <sys/types.h>], u_int8_t foo;,
  43. [db_cv_uint8=yes],
  44. AC_TRY_RUN([main(){exit(sizeof(unsigned char) != 1);}],
  45.     [db_cv_uint8="unsigned char"], [db_cv_uint8=no]))])
  46. if test "$db_cv_uint8" = no; then
  47. AC_MSG_ERROR(No unsigned 8-bit integral type.)
  48. fi
  49. if test "$db_cv_uint8" != yes; then
  50. u_int8_decl="typedef $db_cv_uint8 u_int8_t;"
  51. fi
  52. AC_SUBST(u_int16_decl)
  53. AC_CACHE_CHECK([for u_int16_t], db_cv_uint16, [dnl
  54. AC_TRY_COMPILE([#include <sys/types.h>], u_int16_t foo;,
  55. [db_cv_uint16=yes],
  56. AC_TRY_RUN([main(){exit(sizeof(unsigned short) != 2);}],
  57. [db_cv_uint16="unsigned short"],
  58. AC_TRY_RUN([main(){exit(sizeof(unsigned int) != 2);}],
  59. [db_cv_uint16="unsigned int"], [db_cv_uint16=no])))])
  60. if test "$db_cv_uint16" = no; then
  61. AC_MSG_ERROR([No unsigned 16-bit integral type.])
  62. fi
  63. if test "$db_cv_uint16" != yes; then
  64. u_int16_decl="typedef $db_cv_uint16 u_int16_t;"
  65. fi
  66. AC_SUBST(int16_decl)
  67. AC_CACHE_CHECK([for int16_t], db_cv_int16, [dnl
  68. AC_TRY_COMPILE([#include <sys/types.h>], int16_t foo;,
  69. [db_cv_int16=yes],
  70. AC_TRY_RUN([main(){exit(sizeof(short) != 2);}],
  71. [db_cv_int16="short"],
  72. AC_TRY_RUN([main(){exit(sizeof(int) != 2);}],
  73. [db_cv_int16="int"], [db_cv_int16=no])))])
  74. if test "$db_cv_int16" = no; then
  75. AC_MSG_ERROR([No signed 16-bit integral type.])
  76. fi
  77. if test "$db_cv_int16" != yes; then
  78. int16_decl="typedef $db_cv_int16 int16_t;"
  79. fi
  80. AC_SUBST(u_int32_decl)
  81. AC_CACHE_CHECK([for u_int32_t], db_cv_uint32, [dnl
  82. AC_TRY_COMPILE([#include <sys/types.h>], u_int32_t foo;,
  83. [db_cv_uint32=yes],
  84. AC_TRY_RUN([main(){exit(sizeof(unsigned int) != 4);}],
  85. [db_cv_uint32="unsigned int"],
  86. AC_TRY_RUN([main(){exit(sizeof(unsigned long) != 4);}],
  87. [db_cv_uint32="unsigned long"], [db_cv_uint32=no])))])
  88. if test "$db_cv_uint32" = no; then
  89. AC_MSG_ERROR([No unsigned 32-bit integral type.])
  90. fi
  91. if test "$db_cv_uint32" != yes; then
  92. u_int32_decl="typedef $db_cv_uint32 u_int32_t;"
  93. fi
  94. AC_SUBST(int32_decl)
  95. AC_CACHE_CHECK([for int32_t], db_cv_int32, [dnl
  96. AC_TRY_COMPILE([#include <sys/types.h>], int32_t foo;,
  97. [db_cv_int32=yes],
  98. AC_TRY_RUN([main(){exit(sizeof(int) != 4);}],
  99. [db_cv_int32="int"],
  100. AC_TRY_RUN([main(){exit(sizeof(long) != 4);}],
  101. [db_cv_int32="long"], [db_cv_int32=no])))])
  102. if test "$db_cv_int32" = no; then
  103. AC_MSG_ERROR([No signed 32-bit integral type.])
  104. fi
  105. if test "$db_cv_int32" != yes; then
  106. int32_decl="typedef $db_cv_int32 int32_t;"
  107. fi
  108. dnl Figure out largest integral type.
  109. AC_SUBST(db_align_t_decl)
  110. AC_CACHE_CHECK([for largest integral type], db_cv_align_t, [dnl
  111. AC_TRY_COMPILE([#include <sys/types.h>], long long foo;,
  112. [db_cv_align_t="unsigned long long"], [db_cv_align_t="unsigned long"])])
  113. db_align_t_decl="typedef $db_cv_align_t db_align_t;"
  114. dnl Figure out integral type the same size as a pointer.
  115. AC_SUBST(db_alignp_t_decl)
  116. AC_CACHE_CHECK([for integral type equal to pointer size], db_cv_alignp_t, [dnl
  117. db_cv_alignp_t=$db_cv_align_t
  118. AC_TRY_RUN([main(){exit(sizeof(unsigned int) != sizeof(char *));}],
  119. [db_cv_alignp_t="unsigned int"])
  120. AC_TRY_RUN([main(){exit(sizeof(unsigned long) != sizeof(char *));}],
  121. [db_cv_alignp_t="unsigned long"])
  122. AC_TRY_RUN([main(){exit(sizeof(unsigned long long) != sizeof(char *));}],
  123. [db_cv_alignp_t="unsigned long long"])])
  124. db_alignp_t_decl="typedef $db_cv_alignp_t db_alignp_t;"
  125. ])dnl