OSDN Git Service

POSIX says SEM_FAILED shall have type sem_t*.
authorElliott Hughes <enh@google.com>
Fri, 12 Aug 2016 17:28:52 +0000 (10:28 -0700)
committerElliott Hughes <enh@google.com>
Fri, 12 Aug 2016 17:28:52 +0000 (10:28 -0700)
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/semaphore.h.html

(Even if it didn't, this header previously referred to NULL without ensuring
that NULL was actually visible.)

Change-Id: I70577f4afc21f32c9e585076986127899ef8c8c1

libc/include/semaphore.h

index 4ef13af..218f22a 100644 (file)
@@ -42,7 +42,7 @@ typedef struct {
 #endif
 } sem_t;
 
-#define SEM_FAILED NULL
+#define SEM_FAILED __BIONIC_CAST(reinterpret_cast, sem_t*, 0)
 
 int sem_destroy(sem_t*);
 int sem_getvalue(sem_t*, int*);