diff options
author | Bruce Korb <bkorb@gnu.org> | 2000-07-20 13:29:29 +0000 |
---|---|---|
committer | Bruce Korb <korbb@gcc.gnu.org> | 2000-07-20 13:29:29 +0000 |
commit | a83b3e4f5de7fc6fce1bdd98fd38c0cd461598fb (patch) | |
tree | 985d3661fffda384d0c795f2e94d26bcc1bc9413 /gcc/fixinc/fixfixes.c | |
parent | 038cc6b42081d9b6135e5975faf9ee6c01f03546 (diff) | |
download | gcc-a83b3e4f5de7fc6fce1bdd98fd38c0cd461598fb.zip gcc-a83b3e4f5de7fc6fce1bdd98fd38c0cd461598fb.tar.gz gcc-a83b3e4f5de7fc6fce1bdd98fd38c0cd461598fb.tar.bz2 |
use platform specific types in gnu_type_fix
From-SVN: r35143
Diffstat (limited to 'gcc/fixinc/fixfixes.c')
-rw-r--r-- | gcc/fixinc/fixfixes.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/gcc/fixinc/fixfixes.c b/gcc/fixinc/fixfixes.c index 526cc69..7a9ff61 100644 --- a/gcc/fixinc/fixfixes.c +++ b/gcc/fixinc/fixfixes.c @@ -164,19 +164,28 @@ emit_gnu_type ( text, rm ) /* * Now print out the reformed typedef */ - printf ("\ -#ifndef __%s_TYPE__\n\ -#define __%s_TYPE__ %s\n\ -#endif\n", - p_tm->pz_TYPE, p_tm->pz_TYPE, p_tm->pz_gtype ); - - printf ("\ + { + tSCC z_fmt[] = "\ +#ifndef __%s_TYPE__\n#define __%s_TYPE__ %s\n#endif\n\ +\ #if !defined(_GCC_%s_T)%s\n\ -#define _GCC_%s_T\n\ -typedef __%s_TYPE__ %s_t;\n\ -#endif\n", - p_tm->pz_TYPE, p_tm->pz_cxx_guard, - p_tm->pz_TYPE, p_tm->pz_TYPE, p_tm->pz_type); +\ +#define _GCC_%s_T\ntypedef __%s_TYPE__ %s_t;\n#endif\n"; + + const char* pz_guard; + + /* + * We magically know that the first entry and only the first + * entry needs guarding against __cplusplus (it is "wchar_t"). + * If others wind up needing similar special treatment, then + * go look into inclhack.def. This code, obviously, works closely + * with that file :-) + */ + pz_guard = (p_tm == gnu_type_map) ? " && ! defined(__cplusplus)" : ""; + printf (z_fmt, p_tm->pz_TYPE, p_tm->pz_TYPE, p_tm->pz_gtype, + p_tm->pz_TYPE, pz_guard, + p_tm->pz_TYPE, p_tm->pz_TYPE, p_tm->pz_type); + } return text; } |