home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / arch_include.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-08  |  1.5 KB  |  58 lines

  1. /*
  2.  * ARCH_INCLUDE.h -- helper macro for including architecture specific
  3.  * header files.
  4.  *
  5.  * Usage:
  6.  *    #import    ARCH_INCLUDE(prefix_dir/, suffix.h)
  7.  * Where:
  8.  *    ARCH_INCLUDE(prefix_dir/, suffix.h)
  9.  * produces (for m68k architecture):
  10.  *    "prefix_dir/m68k/suffix.h"
  11.  *
  12.  * NOTE: prefix_dir, if non-null, must end with a '/'
  13.  *
  14.  * Current deficiency: can't specify <...>, only "...".
  15.  *
  16.  * __TARGET_ARCHITECTURE__ may be defined to specify a different
  17.  * different architecture that the compiler is generating code for.
  18.  * Define __TARGET_ARCHITECTURE__ as a string, e.g.:
  19.  #    #define    __TARGET_ARCHITECTURE__    "m68k"
  20.  */
  21.  
  22. #ifndef    _ARCH_INCLUDE_H_
  23. #define    _ARCH_INCLUDE_H_
  24.  
  25. #ifndef    __TARGET_ARCHITECTURE__
  26. #define    __TARGET_ARCHITECTURE__    __ARCHITECTURE__
  27. #endif    __TARGET_ARCHITECTURE__
  28.  
  29. #define    ARCH_INCLUDE(prefix, suffix)    \
  30.     #prefix __TARGET_ARCHITECTURE__ "/" #suffix
  31.  
  32.  
  33.  
  34. #ifndef __TARGET_OS__
  35. #    if defined(hpux)
  36. #        define __TARGET_OS__ "hpux"
  37. #    elif defined(__osf__)
  38. #        define __TARGET_OS__ "osf"
  39. #    elif defined(sun)
  40. #        if defined(__svr4__)
  41. #            define __TARGET_OS__ "solaris"
  42. #        else
  43. #            define __TARGET_OS__ "sunos"
  44. #        endif
  45. #    elif defined (winnt)
  46. #        define __TARGET_OS__ "winnt"
  47. #    else
  48. #        warning unknown target os
  49. #        define __TARGET_OS__ "unknown"
  50. #    endif
  51. #endif __TARGET_OS__
  52.  
  53. #define OS_INCLUDE(prefix, suffix)    \
  54.     #prefix __TARGET_OS__ "/" #suffix
  55.  
  56.  
  57. #endif    _ARCH_INCLUDE_H_
  58.