diff options
Diffstat (limited to 'java/test/Slice/macros/Test.ice')
-rw-r--r-- | java/test/Slice/macros/Test.ice | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/java/test/Slice/macros/Test.ice b/java/test/Slice/macros/Test.ice new file mode 100644 index 00000000000..57d90703e6a --- /dev/null +++ b/java/test/Slice/macros/Test.ice @@ -0,0 +1,60 @@ +// ********************************************************************** +// +// 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. +// +// ********************************************************************** + +#pragma once + +[["java:package:test.Slice.macros"]] + +// +// This macro sets the default value only when compile with slice2java +// +#if defined(ICE_COMPILER) && (ICE_COMPILER == ICE_SLICE2JAVA) +# define DEFAULT(X) = X +#else +# define DEFAULT(X) /**/ +#endif + +// +// This macro sets the default value only when not compile with slice2java +// +#if defined(ICE_COMPILER) && (ICE_COMPILER != ICE_SLICE2JAVA) +# 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 slice2java. +// +#if defined(ICE_COMPILER) && (ICE_COMPILER == ICE_SLICE2JAVA) +class JavaOnly +{ + string lang DEFAULT("java"); + int version DEFAULT(ICE_VERSION); +}; +#endif + +}; |