Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit db78d4eae3d7927b01fd1ae766ae5bcbae0cc29a 1 parent 8f63871
Dirkjan Bussink dbussink authored
5 ext/melbourne/encoding_compat.hpp
View
@@ -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 {
14 ext/melbourne/grammar18.y
View
@@ -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"
18 ext/melbourne/grammar19.y
View
@@ -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"
7 ext/melbourne/melbourne.cpp
View
@@ -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
19 ext/melbourne/melbourne.hpp
View
@@ -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"
3  ext/melbourne/node18.hpp
View
@@ -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 {
2  ext/melbourne/node19.hpp
View
@@ -13,7 +13,7 @@
#ifndef MEL_NODE19_HPP
#define MEL_NODE19_HPP
-#include "ruby.h"
+#include "melbourne.hpp"
namespace melbourne {
namespace grammar19 {
3  ext/melbourne/symbols.cpp
View
@@ -1,5 +1,4 @@
-#include "ruby.h"
-
+#include "melbourne.hpp"
#include "symbols.hpp"
#ifdef __cplusplus
2  ext/melbourne/var_table18.cpp
View
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include <assert.h>
-#include "ruby.h"
+#include "melbourne.hpp"
#include "var_table18.hpp"
namespace melbourne {
2  ext/melbourne/var_table19.cpp
View
@@ -1,4 +1,4 @@
-#include "ruby.h"
+#include "melbourne.hpp"
#include "var_table19.hpp"
namespace melbourne {
8 ext/melbourne/visitor18.cpp
View
@@ -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 "
6 ext/melbourne/visitor19.cpp
View
@@ -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 "
Please sign in to comment.
Something went wrong with that request. Please try again.