aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/cpp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/cpp.c')
-rw-r--r--gcc/fortran/cpp.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c
index 95b08a9..bf4d891 100644
--- a/gcc/fortran/cpp.c
+++ b/gcc/fortran/cpp.c
@@ -609,6 +609,28 @@ gfc_cpp_init (void)
opt->arg, opt->code == OPT_MQ);
}
+ /* Pre-defined macros for non-required INTEGER kind types. */
+ for (gfc_integer_info *itype = gfc_integer_kinds; itype->kind != 0; itype++)
+ {
+ if (itype->kind == 1)
+ cpp_define (cpp_in, "__GFC_INT_1__=1");
+ if (itype->kind == 2)
+ cpp_define (cpp_in, "__GFC_INT_2__=1");
+ if (itype->kind == 8)
+ cpp_define (cpp_in, "__GFC_INT_8__=1");
+ if (itype->kind == 16)
+ cpp_define (cpp_in, "__GFC_INT_16__=1");
+ }
+
+ /* Pre-defined macros for non-required REAL kind types. */
+ for (gfc_real_info *rtype = gfc_real_kinds; rtype->kind != 0; rtype++)
+ {
+ if (rtype->kind == 10)
+ cpp_define (cpp_in, "__GFC_REAL_10__=1");
+ if (rtype->kind == 16)
+ cpp_define (cpp_in, "__GFC_REAL_16__=1");
+ }
+
if (gfc_cpp_option.working_directory
&& gfc_cpp_option.preprocess_only && !gfc_cpp_option.no_line_commands)
pp_dir_change (cpp_in, get_src_pwd ());