]> git.saurik.com Git - minimal.git/commitdiff
Added _aprcall and did some gcc specific _syscall magic.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 15 Oct 2009 06:12:13 +0000 (06:12 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 15 Oct 2009 06:12:13 +0000 (06:12 +0000)
stdlib.h

index 81033a33e892e0b4e1c00b504441433379acd0d3..bc3461d8dded8e9a4aefae063360be77d23a1c8d 100644 (file)
--- a/stdlib.h
+++ b/stdlib.h
         _assert_(#expr); \
     } while (false)
 
-#define _syscall(expr) \
-    do if ((long) (expr) != -1) \
+#define _syscall(expr) ({ \
+    __typeof__(expr) value; \
+    do if ((long) (value = (expr)) != -1) \
         break; \
     else switch (errno) { \
         case EINTR: \
             continue; \
         default: \
             _assert(false); \
-    } while (true)
+    } while (true); \
+    value; \
+})
+
+#define _aprcall(expr) \
+    do { \
+        apr_status_t status((expr)); \
+        _assert(status == APR_SUCCESS); \
+    } while (false)
 
 #define _forever \
     for (;;)