diff mbox

[v4,4/4] Protect coroutine_fn and blocking_fn with #ifndef

Message ID 1382907834-21255-5-git-send-email-charlie@ctshepherd.com
State New
Headers show

Commit Message

Charlie Shepherd Oct. 27, 2013, 9:03 p.m. UTC
From: Gabriel Kerneis <gabriel@kerneis.info>

This patch allows defining coroutine and blocking annotations with
./configure --extra-cflags instead of modifying coroutine.h.

Signed-off-by: Gabriel Kerneis <gabriel@kerneis.info>
---
 include/block/coroutine.h | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/include/block/coroutine.h b/include/block/coroutine.h
index 02ce32d..311ce2b 100644
--- a/include/block/coroutine.h
+++ b/include/block/coroutine.h
@@ -52,7 +52,9 @@ 
  *       ....
  *   }
  */
+#ifndef coroutine_fn
 #define coroutine_fn
+#endif
 
 /**
  * Mark a function that executes in blocking context
@@ -75,7 +77,9 @@ 
  *       ....
  *   }
  */
+#ifndef blocking_fn
 #define blocking_fn
+#endif
 
 typedef struct Coroutine Coroutine;