vxTypes.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* vxTypes.h - POSIX compliant (_t) types header file */
  2. /* Copyright 1991-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01g,05dec01,mem  Added support for 64-bit types.
  7. 01f,13nov92,dnw  added include of vxANSI.h
  8.  pruned some non-POSIX stuff.
  9. 01e,22sep92,rrr  added support for c++
  10. 01d,08sep92,smb  made some MIPS specific additions.
  11. 01c,07sep92,smb  added __STDC__ conditional and some documentation.
  12. 01b,29jul92,smb  added fpos_t type for stdio.h
  13. 01a,03jul92,smb  written.
  14. */
  15. /*
  16. DESCRIPTION
  17. This file actually typedef's the system types defined in vxArch.h or
  18. vxTypesBase.h.  
  19. Architecture specific values for the standard types are defined in vxArch.h
  20. as follows:
  21. #ifndef _TYPE_sometype_t
  22. #define _TYPE_sometype_t  typedef unsigned int sometype_t
  23. #endif
  24. Defaults for each type are provided in vxTypesBase.h as follows:
  25. #ifndef _TYPE_sometype_t
  26. #define _TYPE_sometype_t  typedef int sometype_t
  27. #endif
  28. When vxTypesBase.h is included following the include of vxArch.h,
  29. _TYPE_sometype_t will already be defined and so will not be redefined
  30. in vxTypesBase.h.
  31. Alternatively, if it not defined in vxArch.h, it will be defined in
  32. vxTypesBase.h.  So after vxArch.h and vxTypesBase.h are included all ANSI
  33. and POSIX types will be defined but they will not have been typedef'ed yet.
  34. The typedef happens in this file, vxTypes.h
  35. #ifdef _TYPE_sometype_t
  36. _TYPE_sometype_t
  37. #undef _TYPE_sometype_t
  38. #endif
  39. The '#undef _TYPE_sometype_t' is necessary because a type may be defined in
  40. different header files. For example, ANSI says that size_t must be defined
  41. in time.h and stddef.h
  42. */
  43. #ifndef __INCvxTypesh
  44. #define __INCvxTypesh
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. #include "types/vxANSI.h"
  49. #ifdef _TYPE_ssize_t
  50. _TYPE_ssize_t;
  51. #undef _TYPE_ssize_t
  52. #endif
  53. #ifdef _TYPE_time_t
  54. _TYPE_time_t;
  55. #undef _TYPE_time_t
  56. #endif
  57. #ifdef _TYPE_fpos_t
  58. _TYPE_fpos_t;
  59. #undef _TYPE_fpos_t
  60. #endif
  61. #ifdef _TYPE_int8_t
  62. _TYPE_int8_t;
  63. #undef _TYPE_int8_t
  64. #endif
  65. #ifdef _TYPE_uint8_t
  66. _TYPE_uint8_t;
  67. #undef _TYPE_uint8_t
  68. #endif
  69. #ifdef _TYPE_int16_t
  70. _TYPE_int16_t;
  71. #undef _TYPE_int16_t
  72. #endif
  73. #ifdef _TYPE_uint16_t
  74. _TYPE_uint16_t;
  75. #undef _TYPE_uint16_t
  76. #endif
  77. #ifdef _TYPE_int32_t
  78. _TYPE_int32_t;
  79. #undef _TYPE_int32_t
  80. #endif
  81. #ifdef _TYPE_uint32_t
  82. _TYPE_uint32_t;
  83. #undef _TYPE_uint32_t
  84. #endif
  85. #ifdef _TYPE_int64_t
  86. _TYPE_int64_t;
  87. #undef _TYPE_int64_t
  88. #endif
  89. #ifdef _TYPE_uint64_t
  90. _TYPE_uint64_t;
  91. #undef _TYPE_uint64_t
  92. #endif
  93. /* old Berkeley definitions */
  94. typedef unsigned char uchar_t;
  95. typedef unsigned short ushort_t;
  96. typedef unsigned int uint_t;
  97. typedef unsigned long ulong_t;
  98. typedef struct _quad { long val[2]; } quad;
  99. typedef long daddr_t;
  100. typedef char * caddr_t;
  101. typedef char * addr_t;
  102. typedef long swblk_t;
  103. /* POSIX required */
  104. typedef short dev_t;
  105. typedef unsigned short gid_t;
  106. typedef unsigned long ino_t;
  107. typedef int mode_t;
  108. typedef unsigned long nlink_t;
  109. typedef long off_t;
  110. typedef int pid_t;
  111. typedef unsigned short uid_t;
  112. #ifdef __cplusplus
  113. }
  114. #endif
  115. #endif /* __INCvxTypesh */