diff options
Diffstat (limited to 'csharp/test/Slice/macros/Test.ice')
-rw-r--r-- | csharp/test/Slice/macros/Test.ice | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/csharp/test/Slice/macros/Test.ice b/csharp/test/Slice/macros/Test.ice new file mode 100644 index 00000000000..bb9acbed05a --- /dev/null +++ b/csharp/test/Slice/macros/Test.ice @@ -0,0 +1,54 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2015 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 compiling with slice2cs. +// +#ifdef __SLICE2CS__ +# define DEFAULT(X) = X +#else +# define DEFAULT(X) /**/ +#endif + +// +// This macro sets the default value only when not compiling with slice2cs. +// +#ifndef __SLICE2CS__ +# 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 compiling with slice2cs. +// +#ifdef __SLICE2CS__ +class CsOnly +{ + string lang DEFAULT("cs"); + int version DEFAULT(ICE_VERSION); +}; +#endif + +}; |