Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
169bf8a9
Commit
169bf8a9
authored
Feb 23, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix declarations compile test for MSVC
parent
6c9f8593
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
85 deletions
+96
-85
tests/compile/declarations.h
tests/compile/declarations.h
+0
-53
tests/compile/declarations.pyx
tests/compile/declarations.pyx
+0
-32
tests/compile/declarations.srctree
tests/compile/declarations.srctree
+96
-0
No files found.
tests/compile/declarations.h
deleted
100644 → 0
View file @
6c9f8593
#ifdef __cplusplus
extern
"C"
{
#endif
extern
char
*
cp
;
extern
char
*
cpa
[
5
];
extern
int
(
*
ifnpa
[
5
])(
void
);
extern
char
*
(
*
cpfnpa
[
5
])(
void
);
extern
int
(
*
ifnp
)(
void
);
extern
int
(
*
iap
)[
5
];
#ifdef __cplusplus
}
#endif
char
*
cp
;
char
*
cpa
[
5
];
int
(
*
ifnpa
[
5
])(
void
);
char
*
(
*
cpfnpa
[
5
])(
void
);
int
(
*
ifnp
)(
void
);
int
(
*
iap
)[
5
];
#ifdef __cplusplus
extern
"C"
{
#endif
extern
DL_EXPORT
(
int
)
ifn
(
void
);
extern
DL_EXPORT
(
char
*
)
cpfn
(
void
);
extern
DL_EXPORT
(
int
)
fnargfn
(
int
(
void
));
extern
DL_EXPORT
(
int
)
(
*
iapfn
(
void
))[
5
];
extern
DL_EXPORT
(
char
*
)(
*
cpapfn
(
void
))[
5
];
#ifdef __cplusplus
}
#endif
int
ifn
(
void
)
{
return
0
;}
char
*
cpfn
(
void
)
{
return
0
;}
int
fnargfn
(
int
f
(
void
))
{
return
0
;}
#ifdef __cplusplus
extern
"C"
{
#endif
extern
int
ia
[];
extern
int
iaa
[][
3
];
extern
DL_EXPORT
(
int
)
a
(
int
[][
3
],
int
[][
3
][
5
]);
#ifdef __cplusplus
}
#endif
int
ia
[
1
];
int
iaa
[
1
][
3
];
int
a
(
int
a
[][
3
],
int
b
[][
3
][
5
])
{
return
0
;}
tests/compile/declarations.pyx
deleted
100644 → 0
View file @
6c9f8593
# mode: compile
cdef
extern
from
"declarations.h"
:
pass
cdef
extern
char
*
cp
cdef
extern
char
*
cpa
[
5
]
cdef
extern
int
(
*
ifnpa
[
5
])()
cdef
extern
char
*
(
*
cpfnpa
[
5
])()
cdef
extern
int
(
*
ifnp
)()
cdef
extern
int
(
*
iap
)[
5
]
cdef
extern
int
ifn
()
cdef
extern
char
*
cpfn
()
cdef
extern
int
(
*
iapfn
())[
5
]
cdef
extern
char
*
(
*
cpapfn
())[
5
]
cdef
extern
int
fnargfn
(
int
())
cdef
extern
int
ia
[]
cdef
extern
int
iaa
[][
3
]
cdef
extern
int
a
(
int
[][
3
],
int
[][
3
][
5
])
cdef
void
f
():
cdef
void
*
p
=
NULL
global
ifnp
,
cpa
ifnp
=
<
int
(
*
)()
>
p
cdef
char
*
g
():
pass
f
()
g
()
tests/compile/declarations.srctree
0 → 100644
View file @
169bf8a9
PYTHON setup.py build_ext --inplace
PYTHON -c "import declarations"
######## setup.py ########
from distutils.core import setup
from Cython.Distutils import build_ext
from Cython.Distutils.extension import Extension
setup(
ext_modules = [
Extension("declarations", ["declarations.pyx", "external_declarations.c"]),
],
cmdclass={'build_ext': build_ext},
)
######## declarations.pyx ########
# mode: compile
cdef extern from "external_declarations.h":
pass
cdef extern char *cp
cdef extern char *cpa[5]
cdef extern int (*ifnpa[5])()
cdef extern char *(*cpfnpa[5])()
cdef extern int (*ifnp)()
cdef extern int (*iap)[5]
cdef extern int ifn()
cdef extern char *cpfn()
cdef extern int (*iapfn())[5]
cdef extern char *(*cpapfn())[5]
cdef extern int fnargfn(int ())
cdef extern int ia[]
cdef extern int iaa[][3]
cdef extern int a(int[][3], int[][3][5])
cdef void f():
cdef void *p=NULL
global ifnp, cpa
ifnp = <int (*)()>p
cdef char *g():
pass
f()
g()
######## external_declarations.h ########
#ifdef __cplusplus
extern "C" {
#endif
extern DL_IMPORT(char) *cp;
extern DL_IMPORT(char) *cpa[5];
extern DL_IMPORT(int) (*ifnpa[5])(void);
extern DL_IMPORT(char) *(*cpfnpa[5])(void);
extern DL_IMPORT(int) (*ifnp)(void);
extern DL_IMPORT(int) (*iap)[5];
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern DL_IMPORT(int) ifn(void);
extern DL_IMPORT(char *) cpfn(void);
extern DL_IMPORT(int) fnargfn(int (void));
extern DL_IMPORT(int) (*iapfn(void))[5];
extern DL_IMPORT(char *)(*cpapfn(void))[5];
extern DL_IMPORT(int) ia[];
extern DL_IMPORT(int) iaa[][3];
extern DL_IMPORT(int) a(int[][3], int[][3][5]);
#ifdef __cplusplus
}
#endif
######## external_declarations.c ########
#include <Python.h>
DL_EXPORT(char) *cp;
DL_EXPORT(char) *cpa[5];
DL_EXPORT(int) (*ifnpa[5])(void);
DL_EXPORT(char) *(*cpfnpa[5])(void);
DL_EXPORT(int) (*ifnp)(void);
DL_EXPORT(int) (*iap)[5];
DL_EXPORT(int) ifn(void) {return 0;}
DL_EXPORT(char) *cpfn(void) {return 0;}
DL_EXPORT(int) fnargfn(int f(void)) {return 0;}
DL_EXPORT(int) ia[1];
DL_EXPORT(int) iaa[1][3];
DL_EXPORT(int) a(int a[][3], int b[][3][5]) {return 0;}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment