node: fix namespacing issue in ev-emul.h
authorBen Noordhuis <info@bnoordhuis.nl>
Tue, 19 Jun 2012 20:24:09 +0000 (22:24 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Tue, 19 Jun 2012 21:04:59 +0000 (23:04 +0200)
Always use C linkage, prevent accidental name mangling.

src/ev-emul.h
src/node.h

index ee85db1..4355b4e 100644 (file)
 #include <stdint.h>
 #include <string.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #undef ev_init
 #undef ev_set_cb
 #undef ev_set_priority
@@ -248,4 +252,8 @@ inline static void __ev_unref(void) {
 #undef __uv_container_of
 #undef __uv_warn_of
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* NODE_EV_EMUL_H_ */
index e9028d1..c86caff 100644 (file)
@@ -274,10 +274,11 @@ MakeCallback(const v8::Handle<v8::Object> object,
              int argc,
              v8::Handle<v8::Value> argv[]);
 
+}  // namespace node
+
 #if !defined(NODE_WANT_INTERNALS) && !defined(_WIN32)
 # include "ev-emul.h"
 # include "eio-emul.h"
 #endif
 
-}  // namespace node
 #endif  // SRC_NODE_H_