summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpj <rpj>2009-03-03 21:43:47 +0000
committerrpj <rpj>2009-03-03 21:43:47 +0000
commit271aefcce0ebde39bc104daf342e1048727727d0 (patch)
treec137e24684d20453e06529c75f5028cd5c060957
parente0513b5c7247bdafd5398f03bb7853cd880f5de6 (diff)
''
-rw-r--r--pthread.h8
-rw-r--r--pthread_attr_getinheritsched.c2
-rw-r--r--pthread_attr_getschedpolicy.c2
-rw-r--r--pthread_mutexattr_gettype.c2
-rw-r--r--ptw32_InterlockedCompareExchange.c6
-rw-r--r--sched.h10
6 files changed, 16 insertions, 14 deletions
diff --git a/pthread.h b/pthread.h
index db05327..0bd3413 100644
--- a/pthread.h
+++ b/pthread.h
@@ -104,7 +104,7 @@
#define PTW32_LEVEL_MAX 3
-#if !defined(PTW32_LEVEL)
+#if ( defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112 ) || !defined(PTW32_LEVEL)
#define PTW32_LEVEL PTW32_LEVEL_MAX
/* Include everything */
#endif
@@ -899,13 +899,13 @@ PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedparam (pthread_attr_t *attr,
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedpolicy (pthread_attr_t *,
int);
-PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedpolicy (pthread_attr_t *,
+PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedpolicy (const pthread_attr_t *,
int *);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setinheritsched(pthread_attr_t * attr,
int inheritsched);
-PTW32_DLLPORT int PTW32_CDECL pthread_attr_getinheritsched(pthread_attr_t * attr,
+PTW32_DLLPORT int PTW32_CDECL pthread_attr_getinheritsched(const pthread_attr_t * attr,
int * inheritsched);
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setscope (pthread_attr_t *,
@@ -984,7 +984,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setpshared (pthread_mutexattr_t
int pshared);
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_settype (pthread_mutexattr_t * attr, int kind);
-PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_gettype (pthread_mutexattr_t * attr, int *kind);
+PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_gettype (const pthread_mutexattr_t * attr, int *kind);
/*
* Barrier Attribute Functions
diff --git a/pthread_attr_getinheritsched.c b/pthread_attr_getinheritsched.c
index 5085077..9c6885e 100644
--- a/pthread_attr_getinheritsched.c
+++ b/pthread_attr_getinheritsched.c
@@ -39,7 +39,7 @@
#include "sched.h"
int
-pthread_attr_getinheritsched (pthread_attr_t * attr, int *inheritsched)
+pthread_attr_getinheritsched (const pthread_attr_t * attr, int *inheritsched)
{
if (ptw32_is_attr (attr) != 0 || inheritsched == NULL)
{
diff --git a/pthread_attr_getschedpolicy.c b/pthread_attr_getschedpolicy.c
index 04adbd5..94a257d 100644
--- a/pthread_attr_getschedpolicy.c
+++ b/pthread_attr_getschedpolicy.c
@@ -39,7 +39,7 @@
#include "sched.h"
int
-pthread_attr_getschedpolicy (pthread_attr_t * attr, int *policy)
+pthread_attr_getschedpolicy (const pthread_attr_t * attr, int *policy)
{
if (ptw32_is_attr (attr) != 0 || policy == NULL)
{
diff --git a/pthread_mutexattr_gettype.c b/pthread_mutexattr_gettype.c
index b60ca30..c63fcfa 100644
--- a/pthread_mutexattr_gettype.c
+++ b/pthread_mutexattr_gettype.c
@@ -39,7 +39,7 @@
int
-pthread_mutexattr_gettype (pthread_mutexattr_t * attr, int *kind)
+pthread_mutexattr_gettype (const pthread_mutexattr_t * attr, int *kind)
{
int result = 0;
diff --git a/ptw32_InterlockedCompareExchange.c b/ptw32_InterlockedCompareExchange.c
index be39cd4..fa4bea7 100644
--- a/ptw32_InterlockedCompareExchange.c
+++ b/ptw32_InterlockedCompareExchange.c
@@ -140,7 +140,8 @@ ptw32_InterlockedCompareExchange (PTW32_INTERLOCKED_LPLONG location,
* unsupported processor or compiler.
*/
- result = 0;
+#error Unsupported platform or compiler!
+#endif
#endif
@@ -275,7 +276,8 @@ L1: MOV eax,dword ptr [ecx]
* unsupported processor or compiler.
*/
- result = 0;
+#error Unsupported platform or compiler!
+#endif
#endif
diff --git a/sched.h b/sched.h
index 8674083..e3e7a00 100644
--- a/sched.h
+++ b/sched.h
@@ -60,7 +60,7 @@
#define PTW32_LEVEL_MAX 3
-#if !defined(PTW32_LEVEL)
+#if ( defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112 ) || !defined(PTW32_LEVEL)
#define PTW32_LEVEL PTW32_LEVEL_MAX
/* Include everything */
#endif
@@ -114,14 +114,14 @@
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
#if defined(__MINGW32__) || defined(_UWIN)
-#if PTW32_LEVEL >= PTW32_LEVEL_MAX
+# if PTW32_LEVEL >= PTW32_LEVEL_MAX
/* For pid_t */
# include <sys/types.h>
/* Required by Unix 98 */
# include <time.h>
-#else
-typedef int pid_t;
-#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
+# else
+ typedef int pid_t;
+# endif
#else
typedef int pid_t;
#endif