Browse files

convert LXJS_GET_PARSER_FROM_CONTEXT into a function

Macros are inconsistent across platforms and bad practice unless no
other way is available. The uses of this macro are fine with a function
call.
  • Loading branch information...
1 parent 3053925 commit ceb6f2312288dbb323c8d2f36ba9166af4b627ed @defunctzombie defunctzombie committed Jan 5, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/xml_sax_parser.cc
View
10 src/xml_sax_parser.cc
@@ -8,11 +8,11 @@
#include "xml_sax_parser.h"
-#define LXJS_GET_PARSER_FROM_CONTEXT(context) \
-({ \
- _xmlParserCtxt* the_context = static_cast<_xmlParserCtxt*>(context); \
- static_cast<libxmljs::XmlSaxParser*>(the_context->_private); \
-})
+libxmljs::XmlSaxParser* LXJS_GET_PARSER_FROM_CONTEXT(void *context)
+{
+ _xmlParserCtxt* the_context = static_cast<_xmlParserCtxt*>(context);
+ return static_cast<libxmljs::XmlSaxParser*>(the_context->_private);
+}
namespace {
using namespace v8; // node 0.4.7 fails to use v8:: in NODE_PSYMBOL

0 comments on commit ceb6f23

Please sign in to comment.