B.38 Macro Replacement-Predefined Macro Names (§3.8.3)

In addition to the predefined macro names defined in the Standard, the DEC C compiler defines other preprocessor macros for various identification purposes. When the compiler is invoked, the appropriate identification macros are defined depending on the operating system, architecture, language, compiler mode, and other environment variables. You can reference these macros in #ifdef preprocessor directives to isolate code that applies to a particular environment.

Each DEC C platform can have additional predefined macros. See your platform-specific DEC C documentation for more information.

Table B-1 shows the predefined macro names for Digital UNIX.

Table B-1 Digital UNIX Predefined Macro Names

  Macro Name 
Operating system name:  unix 
  __unix__ 
  __osf 
  SYSTYPE_BSD 
  _ SYSTYPE_BSD 
Architecture name:  __alpha 
Product name:   __DECC 
  __DECC_ VER 
  LANGUAGE_C 
  __LANGUAGE_C__ 

Table B-2 shows the predefined macro names for OpenVMS VAX and Alpha systems. All forms are defined unless strict ANSI mode is in effect, in which case only the new spellings are defined.

Table B-2 OpenVMS VAX and Alpha Predefined Macro Names

  New Spelling  Traditional Spelling 
Operating system name:  __vms  vms 
  __VMS  VMS 
  __vms_version  vms_version 
  __VMS_VERSION  VMS_ VERSION 
Architecture name:  __vax (VAX)  vax (VAX) 
  __VAX (VAX)  VAX (VAX) 
  __alpha (Alpha) 
  __ALPHA (Alpha)  -  
  __Alpha_AXP (Alpha)  -  
  __32BITS (Alpha)  -  
Product name:   __vaxc  vaxc 
  __VAXC  VAXC 
  __vax11c  vax11c 
  __VAX11C  VAX11C 
  __STDC__  -  
  __DECC  -  
  __DECC_VER 
  __VMS_V6_RTL_ COMPAT 
Compiler Mode:   __DECC_MODE_STRICT 
  __DECC_MODE_RELAXED 
  __DECC_MODE_ VAXC 
  __DECC_MODE_COMMON 
Floating-Point:   __D_FLOAT  -  
  __G_FLOAT 
  __IEEE_FLOAT (Alpha) 
  __X_FLOAT (Alpha) 
Other:   __HIDE_FORBIDDEN_NAMES 
  __INITIAL_POINTER_ SIZE (Alpha)  -  

You can explicitly define the macros in Table B-3 to control which C library routines are declared in header files and to obtain standards conformance checking. To define these macros use one of the following:

Table B-3 Library Routine Standards Conformance Macros-All platforms

Macro  Standard 
_XOPEN_SOURCE_EXTENDED  XPG4-UNIX 
_XOPEN_SOURCE  XPG4 
_POSIX_C_SOURCE  POSIX 
_ANSI_C_SOURCE  ISO C and ANSI C 
_AES_SOURCE (Digital UNIX)  Application Environment Services 
_OSF_SOURCE (Digital UNIX)  OSF compatibility 
_VMS_V6_SOURCE (OpenVMS)  OpenVMS Version 6 compatibility 
_DECC_V4_SOURCE (OpenVMS)  DEC C Version 4 compatibility 


Previous Page | Next Page | Table of Contents | Index