summaryrefslogtreecommitdiff
path: root/cpp/include/IceUtil/UndefSysMacros.h
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2014-05-02 19:56:38 +0200
committerJose <jose@zeroc.com>2014-05-02 19:56:38 +0200
commit1161c5817059464ab511632c0ce5d14593ced1a3 (patch)
tree51bbcdf2a4ea43c430312157350bb4271bc3f40d /cpp/include/IceUtil/UndefSysMacros.h
parentUpdate .gitignore files (diff)
downloadice-1161c5817059464ab511632c0ce5d14593ced1a3.tar.bz2
ice-1161c5817059464ab511632c0ce5d14593ced1a3.tar.xz
ice-1161c5817059464ab511632c0ce5d14593ced1a3.zip
ICE-4851 - Use wstrings for input and output data that contain non-ASCII characters?
Diffstat (limited to 'cpp/include/IceUtil/UndefSysMacros.h')
-rw-r--r--cpp/include/IceUtil/UndefSysMacros.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/cpp/include/IceUtil/UndefSysMacros.h b/cpp/include/IceUtil/UndefSysMacros.h
new file mode 100644
index 00000000000..2dc931daf08
--- /dev/null
+++ b/cpp/include/IceUtil/UndefSysMacros.h
@@ -0,0 +1,42 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef ICE_UTIL_UNDEF_SYS_MACROS_H
+#define ICE_UTIL_UNDEF_SYS_MACROS_H
+
+//
+// This header includes macros that can end up being dragged into
+// the generated code from system headers, such as major() or NDEBUG.
+// If a Slice symbol has the same name as a macro, the generated
+// code most likely won't compile (but, depending how the macro is
+// defined, may even compile).
+//
+// Here, we undefine symbols that cause such problems.
+//
+// The #ifdef ... #endif protection is necessary to prevent
+// warnings on some platforms.
+//
+
+#ifdef major
+#undef major
+#endif
+
+#ifdef minor
+#undef minor
+#endif
+
+#ifdef min
+#undef min
+#endif
+
+#ifdef max
+#undef max
+#endif
+
+#endif