Skip to content

Instantly share code, notes, and snippets.

@luislavena
Created December 30, 2011 12:23
  • Star 4 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save luislavena/1539611 to your computer and use it in GitHub Desktop.
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
Copy link

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
Copy link

ferrela commented Aug 11, 2014

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

@MorFinBaZ
Copy link

Thanks, works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment