Gfortran pre-processor directives for Different Operating systems
Could you tell me please how can I do the following: #if __unix__ #define path_sep='/' #elif __windows__ #define path_sep='\' #else #error "path_sep not defined." #endif using gfortran compiler. This can be done in combination with conditional compilation and using the "D" option on the command line. Here is some example code: program test_Dopt character (len=1) :: pathsep pathsep = "?" #ifdef WOS pathsep = "\" #endif #ifdef UOS pathsep = "/" #endif write (*, '( "pathsep is >", A1, "<")' ) pathsep end program test_Dopt Name the program with filetype F90 to cause gfortran to run the