home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / h.z / STDDEF.H < prev    next >
C/C++ Source or Header  |  1996-07-24  |  2KB  |  70 lines

  1. /*
  2.  *  stddef.h    Standard definitions
  3.  *
  4.  *  Copyright by WATCOM International Corp. 1988-1996.  All rights reserved.
  5.  */
  6. #ifndef _STDDEF_H_INCLUDED
  7. #define _STDDEF_H_INCLUDED
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11.  
  12. #ifndef _COMDEF_H_INCLUDED
  13.  #include <_comdef.h>
  14. #endif
  15.  
  16. #ifndef _SIZE_T_DEFINED
  17. #define _SIZE_T_DEFINED
  18. #define _SIZE_T_DEFINED_
  19. typedef unsigned size_t;
  20. #endif
  21.  
  22. #ifndef _WCHAR_T_DEFINED
  23. #define _WCHAR_T_DEFINED
  24. #define _WCHAR_T_DEFINED_
  25. #ifdef __cplusplus
  26. typedef long char wchar_t;
  27. #else
  28. typedef unsigned short wchar_t;
  29. #endif
  30. #endif
  31.  
  32. #ifndef NULL
  33.  #if defined(__SMALL__) || defined(__MEDIUM__) || defined(__386__) || defined(__AXP__) || defined(__PPC__)
  34.   #define NULL   0
  35.  #else
  36.   #define NULL   0L
  37.  #endif
  38. #endif
  39.  
  40. #ifndef _PTRDIFF_T_DEFINED
  41. #define _PTRDIFF_T_DEFINED
  42. #define _PTRDIFF_T_DEFINED_
  43. #if defined(__HUGE__)
  44. typedef long ptrdiff_t;
  45. #else
  46. typedef int ptrdiff_t;
  47. #endif
  48. #endif
  49.  
  50. #ifdef __cplusplus
  51. #define offsetof(__typ,__id) __offsetof(__typ,__id)
  52. #else
  53. #define offsetof(__typ,__id) ((size_t)&(((__typ*)0)->__id))
  54. #endif
  55. #if !defined(NO_EXT_KEYS) /* extensions enabled */
  56. #if defined(__386__) || defined(__AXP__) || defined(__PPC__)
  57.  _WCRTLINK extern int *__threadid(void); /* pointer to thread id */
  58.  #define _threadid (__threadid())
  59.  #if defined(__NT__)
  60.   _WCRTLINK extern unsigned long __threadhandle( void );
  61.  #endif
  62. #else
  63.  _WCRTLINK extern int _WCFAR *_threadid;    /* pointer to thread id */
  64. #endif
  65. #endif
  66. #ifdef __cplusplus
  67. };
  68. #endif
  69. #endif
  70.