summaryrefslogtreecommitdiffstats
path: root/Modules/_multiprocessing/multiprocessing.h
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_multiprocessing/multiprocessing.h')
-rw-r--r--Modules/_multiprocessing/multiprocessing.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h
index 4f4f9d7..f8750d2 100644
--- a/Modules/_multiprocessing/multiprocessing.h
+++ b/Modules/_multiprocessing/multiprocessing.h
@@ -27,7 +27,7 @@
# include <sys/socket.h>
# include <sys/uio.h>
# include <arpa/inet.h> /* htonl() and ntohl() */
-# if HAVE_SEM_OPEN
+# ifdef HAVE_SEM_OPEN
# include <semaphore.h>
typedef sem_t *SEM_HANDLE;
# endif
@@ -45,13 +45,18 @@
* Issue 3110 - Solaris does not define SEM_VALUE_MAX
*/
#ifndef SEM_VALUE_MAX
-# ifdef _SEM_VALUE_MAX
-# define SEM_VALUE_MAX _SEM_VALUE_MAX
-# else
-# define SEM_VALUE_MAX INT_MAX
-# endif
+ #if defined(HAVE_SYSCONF) && defined(_SC_SEM_VALUE_MAX)
+ # define SEM_VALUE_MAX sysconf(_SC_SEM_VALUE_MAX)
+ #elif defined(_SEM_VALUE_MAX)
+ # define SEM_VALUE_MAX _SEM_VALUE_MAX
+ #elif definef(_POSIX_SEM_VALUE_MAX)
+ # define SEM_VALUE_MAX _POSIX_SEM_VALUE_MAX
+ #else
+ # define SEM_VALUE_MAX INT_MAX
+ #endif
#endif
+
/*
* Make sure Py_ssize_t available
*/