aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2009-06-03 20:19:55 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2009-06-03 20:19:55 +0000
commit6bc7bc147769661decbc70e252ac09cccd374712 (patch)
treefb195405d46afa714beccb16a23db5902deea35e /include
parent54f806c7a214a001ae91fa236eccb9bed62a0143 (diff)
downloadgcc-6bc7bc147769661decbc70e252ac09cccd374712.zip
gcc-6bc7bc147769661decbc70e252ac09cccd374712.tar.gz
gcc-6bc7bc147769661decbc70e252ac09cccd374712.tar.bz2
ansidecl.h (EXPORTED_CONST): Define.
include/: * ansidecl.h (EXPORTED_CONST): Define. gcc/: * dummy-checksum.c (executable_checksum): Use EXPORTED_CONST. * genattrtab.c (write_length_unit_log): Likewise. * genchecksum.c (dosum): Likewise. * gengtype.c (write_rtx_next): Likewise. (finish_root_table, write_roots): Likewise. * gimple.c (gimple_ops_offset_): Likewise. * tree-nomudflap.c (gt_ggc_r_gt_tree_mudflap_h): Likewise. * config/arc/arc.c (arc_attribute_table): Likewise. * config/arm/arm.c (arm_attribute_table): Likewise. * config/avr/avr.c (avr_attribute_table): Likewise. * config/crx/crx.c (crx_attribute_table): Likewise. * config/m32r/m32r.c (m32r_attribute_table): Likewise. * config/m68hc11/m68hc11.c (m68hc11_attribute_table): Likewise. * config/mcore/mcore.c (mcore_attribute_table): Likewise. * config/rs6000/rs6000.c (rs6000_attribute_table): Likewise. * config/sh/sh.c (sh_attribute_table): Likewise. * config/sparc/sparc.c (sparc_attribute_table): Likewise. * config/spu/spu.c (spu_attribute_table): Likewise. * config/v850/v850.c (v850_attribute_table): Likewise. * config/alpha/alpha.c (vms_attribute_table): Make static. * config/bfin/bfin.c (bfin_attribute_table): Likewise. * config/h8300/h8300.c (h8300_attribute_table): Likewise. * config/mips/mips.c (mips_attribute_table): Likewise. * Makefile.in (dummy-checksum.o): Depend upon $(CONFIG_H) and $(SYSTEM_H). (cc1-checksum.o): Likewise. gcc/cp/: * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and $(SYSTEM_H). gcc/objc/: * Make-lang.in (cc1obj-checksum.o): Depend upon $(CONFIG_H) and $(SYSTEM_H). gcc/objcp/: * Make-lang.in (cc1objplus-checksum.o): Depend upon $(CONFIG_H) and $(SYSTEM_H). From-SVN: r148146
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog4
-rw-r--r--include/ansidecl.h12
2 files changed, 16 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 273b59c..4693ff9 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-02 Ian Lance Taylor <iant@google.com>
+
+ * ansidecl.h (EXPORTED_CONST): Define.
+
2009-05-31 Ian Lance Taylor <iant@google.com>
* ansidecl.h: Add extern "C" when compiling with C++. Treat C++
diff --git a/include/ansidecl.h b/include/ansidecl.h
index c83b8c0..f9864cd 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -395,6 +395,18 @@ So instead we use the macro below and test it against specific values. */
#define __extension__
#endif
+/* This is used to declare a const variable which should be visible
+ outside of the current compilation unit. Use it as
+ EXPORTED_CONST int i = 1;
+ This is because the semantics of const are different in C and C++.
+ "extern const" is permitted in C but it looks strange, and gcc
+ warns about it when -Wc++-compat is not used. */
+#ifdef __cplusplus
+#define EXPORTED_CONST extern const
+#else
+#define EXPORTED_CONST const
+#endif
+
#ifdef __cplusplus
}
#endif