PageRenderTime 14ms CodeModel.GetById 12ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/java/constants/example.i

#
Swig | 30 lines | 13 code | 10 blank | 7 comment | 0 complexity | ec52148301079a7cc885d304db08d6d2 MD5 | raw file
 1/* File : example.i */
 2%module example
 3
 4/* Force the generated Java code to use the C constant values rather than making a JNI call */
 5%javaconst(1);
 6
 7/* A few preprocessor macros */
 8
 9#define    ICONST      42
10#define    FCONST      2.1828
11#define    CCONST      'x'
12#define    CCONST2     '\n'
13#define    SCONST      "Hello World"
14#define    SCONST2     "\"Hello World\""
15
16/* This should work just fine */
17#define    EXPR        ICONST + 3*(FCONST)
18
19/* This shouldn't do anything */
20#define    EXTERN      extern
21
22/* Neither should this (BAR isn't defined) */
23#define    FOO         (ICONST + BAR)
24
25/* The following directives also produce constants */
26
27%constant int iconst = 37;
28%constant double fconst = 3.14;
29
30