home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / stddef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-20  |  3.4 KB  |  133 lines

  1. #if (defined(__IBMC__) || defined(__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.       #ifdef _M_I386
  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.    /*  VisualAge for C++ for Windows, Version 3.5                      */
  36.    /*    Licensed Material - Property of IBM                           */
  37.    /*                                                                  */
  38.    /*  5801-ARR and Other Materials                                    */
  39.    /*                                                                  */
  40.    /*  (c) Copyright IBM Corp 1991, 1996. All rights reserved.         */
  41.    /*                                                                  */
  42.    /********************************************************************/
  43.  
  44.    typedef int ptrdiff_t;
  45.  
  46.    #ifndef __size_t
  47.       #define __size_t
  48.       typedef unsigned int size_t;
  49.    #endif
  50.  
  51.    #ifndef __wchar_t
  52.       #define __wchar_t
  53.       typedef unsigned short wchar_t;
  54.    #endif
  55.  
  56.    #ifndef NULL
  57.       #if (defined(__EXTENDED__)  || defined( __cplusplus ))
  58.          #define NULL 0
  59.       #else
  60.          #define NULL ((void *)0)
  61.       #endif
  62.    #endif
  63.  
  64.    #if (defined(__IBMC__) || defined(__IBMCPP__))
  65.      #define offsetof( x, y ) __offsetof( x, y )
  66.    #else
  67.      /* Used by Metaware compiler for PowerPC */
  68.      #define offsetof(s_name, s_member) (size_t)&(((s_name *)0)->s_member)
  69.    #endif
  70.  
  71.    #if defined(__EXTENDED__)
  72.  
  73.     #ifdef __THW_PPC__
  74.       extern size_t _threadalloc(size_t len);
  75.       extern void * _threadlocal(size_t var);
  76.     #endif
  77.  
  78.     #if (defined(__IBMC__) || defined(__IBMCPP__))
  79.       #ifndef errno
  80.          #if defined __MULTI__ || defined _WIN32S
  81.             extern int * _IMPORT _LNK_CONV _errno( void );
  82.             #pragma info( none )
  83.             #define errno (*_errno( ))
  84.             #pragma info( restore )
  85.          #else
  86.             extern int _IMPORT errno;
  87.             #pragma info( none )
  88.             #define errno errno
  89.             #pragma info( restore )
  90.          #endif
  91.       #endif
  92.  
  93.       #ifdef __MULTI__
  94.          extern unsigned * _IMPORT _LNK_CONV __threadid( void );
  95.          #define _threadid (__threadid( ))
  96.       #endif
  97.     #else
  98.       /* Used by Metaware compiler for PowerPC */
  99.       #ifndef errno
  100.          #ifdef __MULTI__
  101.             int *  _errno( void );
  102.             #define errno (*_errno( ))
  103.          #else
  104.             extern int errno;
  105.             #define errno errno
  106.          #endif
  107.       #endif
  108.  
  109.       #ifdef __MULTI__
  110.          unsigned *  __threadid( void );
  111.          #define _threadid (__threadid( ))
  112.       #endif
  113.  
  114.  
  115.     #endif
  116.  
  117.    #endif
  118.  
  119.    #ifdef __cplusplus
  120.       }
  121.    #endif
  122.  
  123. #endif
  124.  
  125. #if (defined(__IBMC__) || defined(__IBMCPP__))
  126. #pragma info( none )
  127. #ifndef __CHKHDR__
  128.    #pragma info( restore )
  129. #endif
  130. #pragma info( restore )
  131. #endif
  132.  
  133.