Skip to content
Create a gist now

Instantly share code, notes, and snippets.

diff --git a/ext/bluecloth.h b/ext/bluecloth.h
index 230618b..97053b5 100644
--- a/ext/bluecloth.h
+++ b/ext/bluecloth.h
@@ -7,20 +7,21 @@
#ifndef BLUECLOTH_H
#define BLUECLOTH_H
+#include "ruby.h"
+
+#if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
+# define M17N_SUPPORTED
+# include "ruby/encoding.h"
+#endif
+
#include "config.h"
#include "assert.h"
#include "mkdio.h"
-#include "ruby.h"
void mkd_initialize _(( void ));
void mkd_with_html5_tags _(( void ));
-#if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
-# define M17N_SUPPORTED
-# include "ruby/encoding.h"
-#endif
-
/* Replace the macro from encoding.h that refers to static 'rb_encoding_list' */
#ifdef ENC_FROM_ENCINDEX
#undef ENC_FROM_ENCINDEX
@dorival
dorival commented Jun 20, 2013

It works, but I had to add the following lines after line 32 in order to compile:

#define ENC_FROM_ENCINDEX(idx) (rb_enc_from_index(idx))
#endif

#endif
@ferrela
ferrela commented Aug 11, 2014

hi! please help! how to apply this patch on windows 7 ?

@MorFinBaZ

Thanks, works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.