Browse Source

Manual redefinition of unistd.h contents which are unaccessable to MSVS

ichrispa 9 years ago
parent
commit
d4d52b41c2
1 changed files with 16 additions and 0 deletions
  1. 16 0
      src/ua_util.h

+ 16 - 0
src/ua_util.h

@@ -40,6 +40,22 @@
     #define UA_RESTRICT restrict
 #endif
 
+/* Visual Studio does not know fnct/unistd file access results */
+#ifdef _MSC_VER
+    #ifndef R_OK
+        #define R_OK    4               /* Test for read permission.  */
+    #endif
+    #ifndef R_OK
+        #define W_OK    2               /* Test for write permission.  */
+    #endif
+    #ifndef X_OK
+        #define X_OK    1               /* Test for execute permission.  */
+    #endif
+    #ifndef F_OK
+        #define F_OK    0               /* Test for existence.  */
+    #endif
+#endif
+
 #define UA_NULL ((void *)0)
 
 // subtract from nodeids to get from the encoding to the content