diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-08 09:02:54 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-08 09:02:54 +0000 |
commit | 9e3359da54ff7d68b6811c69d68b35a037bc10f3 (patch) | |
tree | d236987c163df76b8b17aa8e1b4db328dc1ceb37 /include | |
parent | 4cb0c64a22e7e7df9b2e34f4fbd3a17443a61178 (diff) | |
download | gcc-9e3359da54ff7d68b6811c69d68b35a037bc10f3.tar.gz |
2009-06-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r148271
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@148272 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/ansidecl.h | 12 |
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 |