From 05e73743d5c48509ad97d996e0c5ad07d30edef7 Mon Sep 17 00:00:00 2001 From: Sa Liu Date: Thu, 15 May 2008 12:51:56 +0000 Subject: [PATCH] New helper function to return the standard that supports this isocbinding symbol.Do not generate GNU extension symbols if std=f2003. Add new parameter to NAMED_INTCST. From-SVN: r135341 --- gcc/fortran/symbol.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 1d6867bd89c..7f79ee38d6a 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -3740,6 +3740,20 @@ build_formal_args (gfc_symbol *new_proc_sym, gfc_current_ns = parent_ns; } +static int +std_for_isocbinding_symbol (int id) +{ + switch (id) + { +#define NAMED_INTCST(a,b,c,d) \ + case a:\ + return d; +#include "iso-c-binding.def" +#undef NAMED_INTCST + default: + return GFC_STD_F2003; + } +} /* Generate the given set of C interoperable kind objects, or all interoperable kinds. This function will only be given kind objects @@ -3765,6 +3779,8 @@ generate_isocbinding_symbol (const char *mod_name, iso_c_binding_symbol s, char comp_name[(GFC_MAX_SYMBOL_LEN * 2) + 1]; int index; + if (gfc_notification_std (std_for_isocbinding_symbol (s)) == FAILURE) + return; tmp_symtree = gfc_find_symtree (gfc_current_ns->sym_root, name); /* Already exists in this scope so don't re-add it. @@ -3788,7 +3804,7 @@ generate_isocbinding_symbol (const char *mod_name, iso_c_binding_symbol s, switch (s) { -#define NAMED_INTCST(a,b,c) case a : +#define NAMED_INTCST(a,b,c,d) case a : #define NAMED_REALCST(a,b,c) case a : #define NAMED_CMPXCST(a,b,c) case a : #define NAMED_LOGCST(a,b,c) case a : -- 2.30.2