Permalink
Browse files

Move inclusion of ruby.h into separate header file

This makes sure our RSTRING_NOT_MODIFIED definition is picked
up when building the Melbourne extension
  • Loading branch information...
1 parent 8f63871 commit db78d4eae3d7927b01fd1ae766ae5bcbae0cc29a @dbussink dbussink committed Jan 8, 2012
@@ -4,15 +4,12 @@
#ifdef __cplusplus
extern "C" {
#endif
-
-#include "ruby.h"
+#include "melbourne.hpp"
#ifdef HAVE_RUBY_ENCODING_H
#include "ruby/encoding.h"
#else
-#include <ctype.h>
-
#define ENCODING_NAMELEN_MAX 63
typedef struct {
@@ -15,19 +15,7 @@
#define YYDEBUG 1
#define YYERROR_VERBOSE 1
-#include <stdio.h>
-#include <errno.h>
-#include <ctype.h>
-#include <string.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <assert.h>
-#ifdef HAVE_HEADER_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#include "ruby.h"
-
+#include "melbourne.hpp"
#include "grammar18.hpp"
#include "parser_state18.hpp"
#include "visitor18.hpp"
@@ -15,23 +15,7 @@
#define YYDEBUG 1
#define YYERROR_VERBOSE 1
-#include <stdio.h>
-#include <errno.h>
-#include <ctype.h>
-#include <string.h>
-#include <strings.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#ifdef HAVE_HEADER_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#include "ruby.h"
-
+#include "melbourne.hpp"
#include "grammar19.hpp"
#include "parser_state19.hpp"
#include "visitor19.hpp"
@@ -2,17 +2,12 @@
* so we let the C-API know this so it will not penalize
* us with unnecessary caching.
*/
-#define RSTRING_NOT_MODIFIED 1
-#include "ruby.h"
+#include "melbourne.hpp"
#include "grammar18.hpp"
#include "grammar19.hpp"
#include "symbols.hpp"
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <strings.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#ifdef HAVE_HEADER_ALLOCA_H
+#include <alloca.h>
+#endif
+
+#define RSTRING_NOT_MODIFIED 1
+
+#include "ruby.h"
@@ -13,9 +13,8 @@
#ifndef MEL_NODE18_HPP
#define MEL_NODE18_HPP
-#include "ruby.h"
-
#include "bstrlib.h"
+#include "melbourne.hpp"
#include "quark.hpp"
namespace melbourne {
@@ -13,7 +13,7 @@
#ifndef MEL_NODE19_HPP
#define MEL_NODE19_HPP
-#include "ruby.h"
+#include "melbourne.hpp"
namespace melbourne {
namespace grammar19 {
@@ -1,5 +1,4 @@
-#include "ruby.h"
-
+#include "melbourne.hpp"
#include "symbols.hpp"
#ifdef __cplusplus
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include <assert.h>
-#include "ruby.h"
+#include "melbourne.hpp"
#include "var_table18.hpp"
namespace melbourne {
@@ -1,4 +1,4 @@
-#include "ruby.h"
+#include "melbourne.hpp"
#include "var_table19.hpp"
namespace melbourne {
@@ -1,10 +1,6 @@
-#include <string.h>
-
#include <sstream>
-#include <stdint.h>
-
-#include "ruby.h"
+#include "melbourne.hpp"
#include "parser_state18.hpp"
#include "visitor18.hpp"
#include "symbols.hpp"
@@ -30,7 +26,7 @@ namespace melbourne {
if(start_lines->size() > 0) {
StartPosition& pos = start_lines->back();
- std::stringstream ss;
+ std::ostringstream ss;
ss << "missing 'end' for '"
<< pos.kind
<< "' started on line "
@@ -1,8 +1,6 @@
#include <sstream>
-#include <stdint.h>
-
-#include "ruby.h"
+#include "melbourne.hpp"
#include "parser_state19.hpp"
#include "visitor19.hpp"
#include "symbols.hpp"
@@ -19,7 +17,7 @@ namespace melbourne {
if(start_lines->size() > 0) {
StartPosition& pos = start_lines->back();
- std::stringstream ss;
+ std::ostringstream ss;
ss << "missing 'end' for '"
<< pos.kind
<< "' started on line "

0 comments on commit db78d4e

Please sign in to comment.