Issue 1192

This commit is contained in:
Thomas Nagy 2012-08-24 22:53:07 +02:00
parent e67b593eee
commit 0f6ee2a0cf
3 changed files with 8 additions and 7 deletions

View File

@ -24,7 +24,7 @@ cfg_ver = {
} }
SNIP_FUNCTION = ''' SNIP_FUNCTION = '''
int main() { int main(int argc, char **argv) {
void *p; void *p;
p=(void*)(%s); p=(void*)(%s);
return 0; return 0;
@ -33,21 +33,22 @@ SNIP_FUNCTION = '''
"""Code template for checking for functions""" """Code template for checking for functions"""
SNIP_TYPE = ''' SNIP_TYPE = '''
int main() { int main(int argc, char **argv) {
if ((%(type_name)s *) 0) return 0; if ((%(type_name)s *) 0) return 0;
if (sizeof (%(type_name)s)) return 0; if (sizeof (%(type_name)s)) return 0;
return 1;
} }
''' '''
"""Code template for checking for types""" """Code template for checking for types"""
SNIP_EMPTY_PROGRAM = ''' SNIP_EMPTY_PROGRAM = '''
int main() { int main(int argc, char **argv) {
return 0; return 0;
} }
''' '''
SNIP_FIELD = ''' SNIP_FIELD = '''
int main() { int main(int argc, char **argv) {
char *off; char *off;
off = (char*) &((%(type_name)s*)0)->%(field_name)s; off = (char*) &((%(type_name)s*)0)->%(field_name)s;
return (size_t) off < sizeof(%(type_name)s); return (size_t) off < sizeof(%(type_name)s);

View File

@ -27,7 +27,7 @@ MAIN_CODE = '''
#define testEXPORT #define testEXPORT
#endif #endif
testEXPORT int lib_func(void); testEXPORT int lib_func(void);
int main(void) {return !(lib_func() == 9);} int main(int argc, char **argv) {return !(lib_func() == 9);}
''' '''
@feature('link_lib_test') @feature('link_lib_test')
@ -123,7 +123,7 @@ def check_inline(self, **kw):
######################################################################################## ########################################################################################
LARGE_FRAGMENT = '#include <unistd.h>\nint main() { return !(sizeof(off_t) >= 8); }\n' LARGE_FRAGMENT = '#include <unistd.h>\nint main(int argc, char **argv) { return !(sizeof(off_t) >= 8); }\n'
@conf @conf
def check_large_file(self, **kw): def check_large_file(self, **kw):

View File

@ -33,7 +33,7 @@ extern "C" {
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
int main() int main(int argc, char **argv)
{ {
Py_Initialize(); Py_Initialize();
Py_Finalize(); Py_Finalize();