home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / detk45he.zip / libc / stddef.h < prev    next >
Text File  |  1999-03-15  |  3KB  |  105 lines

  1. #if __IBMC__ || __IBMCPP__
  2. #pragma info( none )
  3. #ifndef __CHKHDR__
  4.    #pragma info( none )
  5. #endif
  6. #pragma info( restore )
  7. #endif
  8.  
  9. #ifndef __stddef_h
  10.    #define __stddef_h
  11.  
  12.    #ifdef __cplusplus
  13.       extern "C" {
  14.    #endif
  15.  
  16.    #ifndef  _LNK_CONV
  17.       #if __IBMC__ || __IBMCPP__ || defined(_OPTLINK_SUPPORTED)
  18.          #define _LNK_CONV   _Optlink
  19.       #else
  20.          #define _LNK_CONV
  21.       #endif
  22.    #endif
  23.  
  24.    #ifndef _IMPORT
  25.       #ifdef __IMPORTLIB__
  26.          #define _IMPORT _Import
  27.       #else
  28.          #define _IMPORT
  29.       #endif
  30.    #endif
  31.  
  32.    /********************************************************************/
  33.    /*  <stddef.h> header file                                          */
  34.    /*                                                                  */
  35.    /*  (C) Copyright IBM Corp. 1991, 1995.                             */
  36.    /*  - Licensed Material - Program-Property of IBM                   */
  37.    /*  - All rights reserved                                           */
  38.    /*                                                                  */
  39.    /********************************************************************/
  40.  
  41.    typedef int ptrdiff_t;
  42.  
  43.    #ifndef __size_t
  44.       #define __size_t
  45.       typedef unsigned int size_t;
  46.    #endif
  47.  
  48.    #ifndef __wchar_t
  49.       #define __wchar_t
  50.       typedef unsigned short wchar_t;
  51.    #endif
  52.  
  53.    #ifndef NULL
  54.       #if (defined(__EXTENDED__)  || defined( __cplusplus ))
  55.          #define NULL 0
  56.       #else
  57.          #define NULL ((void *)0)
  58.       #endif
  59.    #endif
  60.  
  61.    #if __IBMC__ || __IBMCPP__
  62.       #define offsetof( x, y ) __offsetof( x, y )
  63.    #else
  64.       #define offsetof(s_name, s_member) (size_t)&(((s_name *)0)->s_member)
  65.    #endif
  66.  
  67.    #if defined(__EXTENDED__)
  68.  
  69.       #ifdef __THW_PPC__
  70.          extern size_t _threadalloc(size_t len);
  71.          extern void * _threadlocal(size_t var);
  72.       #endif
  73.  
  74.       #ifndef errno
  75.          #if defined __MULTI__ || defined _WIN32S
  76.             extern int * _IMPORT _LNK_CONV _errno( void );
  77.             #define errno (*_errno( ))
  78.          #else
  79.             extern int _IMPORT errno;
  80.             #define errno errno
  81.          #endif
  82.       #endif
  83.  
  84.       #ifdef __MULTI__
  85.          extern unsigned * _IMPORT _LNK_CONV __threadid( void );
  86.          #define _threadid (__threadid( ))
  87.       #endif
  88.  
  89.    #endif
  90.  
  91.    #ifdef __cplusplus
  92.       }
  93.    #endif
  94.  
  95. #endif
  96.  
  97. #if __IBMC__ || __IBMCPP__
  98. #pragma info( none )
  99. #ifndef __CHKHDR__
  100.    #pragma info( restore )
  101. #endif
  102. #pragma info( restore )
  103. #endif
  104.  
  105.