Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2009-06-04 01:02:16 +0400
committerDJ Delorie <dj@redhat.com>2009-06-04 01:02:16 +0400
commitf95df56a61ab3ac473a1ac1ff1f78aade0a3082c (patch)
treefd1788c977cd6eb51ba3428d6f0e5b2e50d15671
parentc801709ed5776bf9d2af4c50b63405f2b6199f2e (diff)
merge from gcc
-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 93308e863..1af04e80b 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 c83b8c039..f9864cd38 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