summaryrefslogtreecommitdiff
path: root/cpp/test/Slice/macros/Test.ice
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Slice/macros/Test.ice')
-rw-r--r--cpp/test/Slice/macros/Test.ice57
1 files changed, 57 insertions, 0 deletions
diff --git a/cpp/test/Slice/macros/Test.ice b/cpp/test/Slice/macros/Test.ice
new file mode 100644
index 00000000000..e156f51beee
--- /dev/null
+++ b/cpp/test/Slice/macros/Test.ice
@@ -0,0 +1,57 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2013 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.
+//
+// **********************************************************************
+
+
+//
+// This macro sets the default value only when compile with slice2cpp
+//
+#if defined(ICE_COMPILER) && (ICE_COMPILER == ICE_SLICE2CPP)
+# define DEFAULT(X) = X
+#else
+# define DEFAULT(X) /**/
+#endif
+
+//
+// This macro sets the default value only when not compile with slice2cpp
+//
+#if defined(ICE_COMPILER) && (ICE_COMPILER != ICE_SLICE2CPP)
+# define NODEFAULT(X) = X
+#else
+# define NODEFAULT(X) /**/
+#endif
+
+
+
+module Test
+{
+
+class Default
+{
+ int x DEFAULT(10);
+ int y DEFAULT(10);
+};
+
+class NoDefault
+{
+ int x NODEFAULT(10);
+ int y NODEFAULT(10);
+};
+
+//
+// This class is only defined when compile with slice2cpp.
+//
+#if defined(ICE_COMPILER) && (ICE_COMPILER == ICE_SLICE2CPP)
+class CppOnly
+{
+ string lang DEFAULT("cpp");
+ int version DEFAULT(ICE_VERSION);
+};
+#endif
+
+};