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
Boxiang Sun
cython
Commits
3bb8bd2f
Commit
3bb8bd2f
authored
Feb 24, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix callingconvention test
parent
9928cff1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
61 deletions
+76
-61
tests/compile/callingconvention.h
tests/compile/callingconvention.h
+0
-33
tests/compile/callingconvention.pyx
tests/compile/callingconvention.pyx
+0
-28
tests/compile/callingconvention.srctree
tests/compile/callingconvention.srctree
+76
-0
No files found.
tests/compile/callingconvention.h
deleted
100644 → 0
View file @
9928cff1
#ifdef __cplusplus
extern
"C"
{
#endif
extern
DL_EXPORT
(
int
)
f1
(
void
);
extern
DL_EXPORT
(
int
)
__cdecl
f2
(
void
);
extern
DL_EXPORT
(
int
)
__stdcall
f3
(
void
);
extern
DL_EXPORT
(
int
)
__fastcall
f4
(
void
);
#ifdef __cplusplus
}
#endif
int
f1
(
void
)
{
return
0
;}
int
__cdecl
f2
(
void
)
{
return
0
;}
int
__stdcall
f3
(
void
)
{
return
0
;}
int
__fastcall
f4
(
void
)
{
return
0
;}
#ifdef __cplusplus
extern
"C"
{
#endif
extern
int
(
*
p1
)(
void
);
extern
int
(
__cdecl
*
p2
)(
void
);
extern
int
(
__stdcall
*
p3
)(
void
);
extern
int
(
__fastcall
*
p4
)(
void
);
#ifdef __cplusplus
}
#endif
int
(
*
p1
)(
void
);
int
(
__cdecl
*
p2
)(
void
);
int
(
__stdcall
*
p3
)(
void
);
int
(
__fastcall
*
p4
)(
void
);
tests/compile/callingconvention.pyx
deleted
100644 → 0
View file @
9928cff1
# mode: compile
cdef
extern
from
"callingconvention.h"
:
pass
cdef
extern
int
f1
()
cdef
extern
int
__cdecl
f2
()
cdef
extern
int
__stdcall
f3
()
cdef
extern
int
__fastcall
f4
()
cdef
extern
int
(
*
p1
)()
cdef
extern
int
(
__cdecl
*
p2
)()
cdef
extern
int
(
__stdcall
*
p3
)()
cdef
extern
int
(
__fastcall
*
p4
)()
p1
=
f1
p2
=
f2
p3
=
f3
p4
=
f4
tests/compile/callingconvention.srctree
0 → 100644
View file @
3bb8bd2f
PYTHON setup.py build_ext --inplace
PYTHON -c "import callingconvention"
######## setup.py ########
from distutils.core import setup
from Cython.Distutils import build_ext
from Cython.Distutils.extension import Extension
setup(
ext_modules = [
Extension("callingconvention", ["callingconvention.pyx", "external_callingconvention.c"]),
],
cmdclass={'build_ext': build_ext},
)
######## callingconvention.pyx ########
# mode: compile
cdef extern from "external_callingconvention.h":
pass
cdef extern int f1()
cdef extern int __cdecl f2()
cdef extern int __stdcall f3()
cdef extern int __fastcall f4()
cdef extern int (*p1)()
cdef extern int (__cdecl *p2)()
cdef extern int (__stdcall *p3)()
cdef extern int (__fastcall *p4)()
p1 = f1
p2 = f2
p3 = f3
p4 = f4
######## external_callingconvention.h ########
#ifdef __cplusplus
extern "C" {
#endif
extern DL_IMPORT(int) f1(void);
extern DL_IMPORT(int) __cdecl f2(void);
extern DL_IMPORT(int) __stdcall f3(void);
extern DL_IMPORT(int) __fastcall f4(void);
extern DL_IMPORT(int) (*p1)(void);
extern DL_IMPORT(int) (__cdecl *p2)(void);
extern DL_IMPORT(int) (__stdcall *p3)(void);
extern DL_IMPORT(int) (__fastcall *p4)(void);
#ifdef __cplusplus
}
#endif
######## external_callingconvention.c ########
#include <Python.h>
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
#endif
#ifndef __cdecl
#define __cdecl
#endif
#ifndef __fastcall
#define __fastcall
#endif
#endif
DL_EXPORT(int) f1(void) {return 0;}
DL_EXPORT(int) __cdecl f2(void) {return 0;}
DL_EXPORT(int) __stdcall f3(void) {return 0;}
DL_EXPORT(int) __fastcall f4(void) {return 0;}
DL_EXPORT(int) (*p1)(void);
DL_EXPORT(int) (__cdecl *p2)(void);
DL_EXPORT(int) (__stdcall *p3)(void);
DL_EXPORT(int) (__fastcall *p4)(void);
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