summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-03 20:19:55 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-03 20:19:55 +0000
commitcd819d2fba06ad666e2e6b80340bafcb6bc38a1b (patch)
treefb195405d46afa714beccb16a23db5902deea35e /include
parent8f843aad6aae096d90c7ef7bddac6b99ee3702b1 (diff)
downloadgcc-cd819d2fba06ad666e2e6b80340bafcb6bc38a1b.tar.gz
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). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148146 138bc75d-0d04-0410-961f-82ee72b054a4
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 273b59c2a18..4693ff9a598 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 c83b8c039d9..f9864cd3864 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