Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make those programs succed on windows.
authorunknown <pierre@.(none)>
Tue, 10 Jan 2012 14:27:15 +0000 (15:27 +0100)
committerunknown <pierre@.(none)>
Tue, 10 Jan 2012 17:17:22 +0000 (18:17 +0100)
buildtools/Cmake/test_prog/prog_sem_init.c
buildtools/Cmake/test_prog/prog_sem_open.c

index 5302a80..e822e64 100644 (file)
@@ -4,6 +4,9 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <semaphore.h>
 
 int main(void)
index 4679c32..e9f0445 100644 (file)
 #include <semaphore.h>
 #include <stdio.h>
 
+#ifndef SEM_FAILED
+#define SEM_FAILED (-1)
+#endif
+
 int main(void) {   
-   sem_t * s;
-   
+#ifdef WIN32
+       int s;
+#else
+       sem_t * s;
+#endif
    s = sem_open("/0", O_CREAT, 0644, 10);
    if (s == SEM_FAILED){
 //     printf("sem_open failed\n");