Dear All, I have a small Fortran program containing a preprocessor macro. Below is a minimal example. It works fine on mac os x, but when I compile it on Windows 7 (64-bit), it always prints an unknown operating system . I am using gfortran-4.8.0 (mingw32) for Windows 7.
program foo implicit integer(in), double precision (ah,op), + character*8(xz) * #ifdef _WIN64 zterm = 'wxt' #elif _WIN32 zterm = 'wxt' #elif __APPLE__ zterm = 'aqua' #elif __linux zterm = 'x11' #elif __unix zterm = 'x11' #elif __posix zterm = 'x11' #else print*, 'unknown operating system' #endif end program foo
Changing #ifdef _WIN64 to #if defined (_WIN64) did not help. Any suggestion would be appreciated.
macros fortran gfortran
UCU110
source share