1212#include <sys/time.h>
1313#endif
1414
15- #ifdef MYPYC_EXPERIMENTAL
16-
1715// Internal function that returns a C double for mypyc primitives
1816// Returns high-precision time in seconds (like time.time())
1917static double
@@ -74,18 +72,12 @@ time_time(PyObject *self, PyObject *const *args, size_t nargs) {
7472 return PyFloat_FromDouble (result );
7573}
7674
77- #endif
78-
7975static PyMethodDef librt_time_module_methods [] = {
80- #ifdef MYPYC_EXPERIMENTAL
8176 {"time" , (PyCFunction )time_time , METH_FASTCALL ,
8277 PyDoc_STR ("Return the current time in seconds since the Unix epoch as a floating point number." )},
83- #endif
8478 {NULL , NULL , 0 , NULL }
8579};
8680
87- #ifdef MYPYC_EXPERIMENTAL
88-
8981static int
9082time_abi_version (void ) {
9183 return LIBRT_TIME_ABI_VERSION ;
@@ -96,12 +88,9 @@ time_api_version(void) {
9688 return LIBRT_TIME_API_VERSION ;
9789}
9890
99- #endif
100-
10191static int
10292librt_time_module_exec (PyObject * m )
10393{
104- #ifdef MYPYC_EXPERIMENTAL
10594 // Export mypyc internal C API via capsule
10695 static void * time_api [LIBRT_TIME_API_LEN ] = {
10796 (void * )time_abi_version ,
@@ -112,7 +101,6 @@ librt_time_module_exec(PyObject *m)
112101 if (PyModule_Add (m , "_C_API" , c_api_object ) < 0 ) {
113102 return -1 ;
114103 }
115- #endif
116104 return 0 ;
117105}
118106
0 commit comments