{section:border=true}
{column:width=70%}
h2. \_OPENMP Macro Value in OpenMP 3.0
In this implementation, when a program is compiled with the \-xopenmp compiler option, the \_OPENMP macro value is defined to be *200805*, where *2008* and *05* are the year and month of the OpenMP Specification Version 3.0. See Section 2.2, p. 26, of the Specification.
*Example (C/C++):*
{noformat}
#include <stdio.h>
int main()
{
#ifdef _OPENMP
printf("The _OPENMP macro is defined to have the value %d\n", _OPENMP);
#else
printf("The _OPENMP macro is not defined\n");
#endif
return 0;
}
% cc -xO3 test.c
% a.out
The _OPENMP macro is not defined
% cc -xO3 -xopenmp test.c
% a.out
The _OPENMP macro is defined to have the value 200805
{noformat}
{column}
{column:width=30%}
{panel:title=OpenMP 3.0 Features in Express 7.08}
{children:page=Sun Studio OpenMP}
{panel}
{column}
{section}
{column:width=70%}
h2. \_OPENMP Macro Value in OpenMP 3.0
In this implementation, when a program is compiled with the \-xopenmp compiler option, the \_OPENMP macro value is defined to be *200805*, where *2008* and *05* are the year and month of the OpenMP Specification Version 3.0. See Section 2.2, p. 26, of the Specification.
*Example (C/C++):*
{noformat}
#include <stdio.h>
int main()
{
#ifdef _OPENMP
printf("The _OPENMP macro is defined to have the value %d\n", _OPENMP);
#else
printf("The _OPENMP macro is not defined\n");
#endif
return 0;
}
% cc -xO3 test.c
% a.out
The _OPENMP macro is not defined
% cc -xO3 -xopenmp test.c
% a.out
The _OPENMP macro is defined to have the value 200805
{noformat}
{column}
{column:width=30%}
{panel:title=OpenMP 3.0 Features in Express 7.08}
{children:page=Sun Studio OpenMP}
{panel}
{column}
{section}