The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6fcc22a1f8
commit
516036631c
1508 changed files with 125983 additions and 44037 deletions
2
SWIG/Examples/guile/constants/.cvsignore
Normal file
2
SWIG/Examples/guile/constants/.cvsignore
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
example_wrap.c
|
||||
my-guile
|
||||
17
SWIG/Examples/guile/constants/Makefile
Normal file
17
SWIG/Examples/guile/constants/Makefile
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
SRCS =
|
||||
TARGET = my-guile
|
||||
IFILE = example.i
|
||||
MKDIR = ..
|
||||
|
||||
all::
|
||||
$(MAKE) -f $(MKDIR)/Makefile \
|
||||
SRCS='$(SRCS)' \
|
||||
TARGET=$(TARGET) \
|
||||
IFILE=$(IFILE) \
|
||||
sub-all
|
||||
|
||||
clean::
|
||||
$(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean
|
||||
|
||||
check: all
|
||||
./my-guile -s constants.scm
|
||||
10
SWIG/Examples/guile/constants/constants.scm
Normal file
10
SWIG/Examples/guile/constants/constants.scm
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
(or (= (ICONST) 42) (exit 1))
|
||||
(or (< (abs (- (FCONST) 2.1828)) 0.00001) (exit 1))
|
||||
(or (char=? (CCONST) #\x) (exit 1))
|
||||
(or (char=? (CCONST2) #\newline) (exit 1))
|
||||
(or (string=? (SCONST) "Hello World") (exit 1))
|
||||
(or (string=? (SCONST2) "\"Hello World\"") (exit 1))
|
||||
(or (< (abs (- (EXPR) (+ (ICONST) (* 3 (FCONST))))) 0.00001) (exit 1))
|
||||
(or (= (iconst) 37) (exit 1))
|
||||
(or (< (abs (- (fconst) 3.14)) 0.00001) (exit 1))
|
||||
(exit 0)
|
||||
27
SWIG/Examples/guile/constants/example.i
Normal file
27
SWIG/Examples/guile/constants/example.i
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* File : example.i */
|
||||
%module example
|
||||
|
||||
/* A few preprocessor macros */
|
||||
|
||||
#define ICONST 42
|
||||
#define FCONST 2.1828
|
||||
#define CCONST 'x'
|
||||
#define CCONST2 '\n'
|
||||
#define SCONST "Hello World"
|
||||
#define SCONST2 "\"Hello World\""
|
||||
|
||||
/* This should work just fine */
|
||||
#define EXPR ICONST + 3*(FCONST)
|
||||
|
||||
/* This shouldn't do anything */
|
||||
#define EXTERN extern
|
||||
|
||||
/* Neither should this (BAR isn't defined) */
|
||||
#define FOO (ICONST + BAR)
|
||||
|
||||
/* The following directives also produce constants */
|
||||
|
||||
%constant int iconst = 37;
|
||||
%constant double fconst = 3.14;
|
||||
|
||||
%include guilemain.i
|
||||
Loading…
Add table
Add a link
Reference in a new issue