File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
tests/integration/testdependencies Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
#include "dependency.h"
2
2
#include <malloc.h>
3
+ #include <stdlib.h>
4
+ #include <stdint.h>
3
5
4
6
int dep_run ()
5
7
{
6
8
#if defined(__GLIBC_PREREQ ) && __GLIBC_PREREQ (2 , 17 )
7
- return (int )secure_getenv ("NON_EXISTING_ENV_VARIABLE" );
9
+ return (int )( intptr_t ) secure_getenv ("NON_EXISTING_ENV_VARIABLE" );
8
10
#elif defined(__GLIBC_PREREQ ) && __GLIBC_PREREQ (2 , 10 )
9
11
return malloc_info (0 , stdout );
10
12
#else
Original file line number Diff line number Diff line change 3
3
from os import path
4
4
from os import getenv
5
5
6
- cmd = 'gcc -shared -fPIC dependency.c -o libdependency.so'
6
+ cmd = 'gcc -shared -fPIC -D_GNU_SOURCE dependency.c -o libdependency.so'
7
7
subprocess .check_call (cmd .split ())
8
8
9
- define_macros = []
9
+ define_macros = [( '_GNU_SOURCE' , None ) ]
10
10
libraries = []
11
11
library_dirs = []
12
12
Original file line number Diff line number Diff line change 2
2
#include "dependency.h"
3
3
#else
4
4
#include <malloc.h>
5
+ #include <stdlib.h>
6
+ #include <stdint.h>
5
7
#endif
6
8
#include <Python.h>
7
9
@@ -16,7 +18,7 @@ run(PyObject *self, PyObject *args)
16
18
#ifdef WITH_DEPENDENCY
17
19
res = dep_run ();
18
20
#elif defined(__GLIBC_PREREQ ) && __GLIBC_PREREQ (2 , 17 )
19
- res = (int )secure_getenv ("NON_EXISTING_ENV_VARIABLE" );
21
+ res = (int )( intptr_t ) secure_getenv ("NON_EXISTING_ENV_VARIABLE" );
20
22
#elif defined(__GLIBC_PREREQ ) && __GLIBC_PREREQ (2 , 10 )
21
23
res = malloc_info (0 , stdout );
22
24
#else
You can’t perform that action at this time.
0 commit comments