VMS Help  —  CC  Language topics, Predefined Macros, System Identification Macros
  Each implementation of the VSI C compiler automatically defines
  macros that you can use to identify the system on which the program
  is running.  These macros can assist in writing code that executes
  conditionally, depending on the architecture or operating system on
  which the program is running.

  The following table lists the traditional and new spellings of
  these predefined macro names for VSI C on OpenVMS systems.  Both
  spellings are defined for each macro unless ANSI C mode is in
  effect (/STANDARD=ANSI89), in which case only the new spellings are
  defined.

        Traditional spelling      New spelling

             vms                   __vms
             VMS                   __VMS
             vms_version           __vms_VERSION
             VMS_VERSION           __VMS_VERSION
                                   __VMS_VER
                                   __DECC_VER
                                   __DECCXX_VER
             vaxc                  __vaxc
             VAXC                  __VAXC
             vax11c                __vax11C
             VAX11C                __VAX11C
              ---                  __DECC
              ---                  __STDC__
                                   __STDC_HOSTED__
                                   __STDC_VERSION__
                                   __STDC_ISO_10646__
                                   __MIA

  On OpenVMS I64 Systems, VSI C also supports the following
  predefined system identification macro names in all compiler modes:

  __ia64
  __ia64__
  __32BITS
  __INITIAL_POINTER_SIZE

  Predefined macros (with the exception of __STDC_VERSION__,
  __STDC_ISO_10646__, vms_version, VMS_VERSION, __vms_version,
  __VMS_VERSION, and __INITIAL_POINTER_SIZE) are defined as 1 or 0,
  depending on the system you're compiling on (VAX or Alpha
  processor), the compiler defaults, and the qualifiers used.  For
  example, if you compiled using G_floating format, then __D_FLOAT
  and __IEEE_FLOAT (Alpha processors only) are predefined to be 0,
  and __G_FLOAT is predefined as if the following were included
  before every compilation unit:

  #define  __G_FLOAT  1

  These macros can assist in writing code that executes
  conditionally.  They can be used in #elif, #if, #ifdef, and #ifndef
  directives to separate portable and nonportable code in a VSI C
  program.  The vms_version, VMS_VERSION, __vms_version, and
  __VMS_VERSION macros are defined with the value of the OpenVMS
  version on which you are running (for example, Version 6.0).

  The __STDC__ macro is defined to 1 for /STANDARD options ANSI89,
  C99, LATEST and MIA.  It is defined to 2 for /STANDARD=RELAXED and
  to 0 for /STANDARD=MS.  It is not defined for /STANDARD options
  VAXC and COMMON.

  The __STDC_HOSTED__ macro is defined to 1 for /STANDARD=c99 and
  /STANDARD=LATEST.  It is not defined for all other /STANDARD
  keywords.

  The __STDC_VERSION__ macro is defined to 199901L for /STANDARD
  keywords C99, LATEST, RELAXED, MS, PORTABLE.  It is defined to
  199409L when the ISOC94 keyword is specified alone or with the
  ANSI89, MIA, RELAXED, MS, PORTABLE, or COMMON modes.  The macro is
  undefined for the VAXC keyword or for keywords ANSI89, MIA, or
  COMMON without ISOC94 specified.

  The __STDC_ISO_10646__ macro evaluates to an integer constant of
  the form yyyymmL (for example, 199712L), intended to indicate that
  values of type wchar_t are the coded representations of the
  characters defined by ISO/IEC 10646, along with all amendments and
  technical corrigenda as of the specified year and month.
Close Help