summaryrefslogtreecommitdiff
path: root/enc/gb2312.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-08-10 00:01:36 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-08-10 00:01:36 +0900
commita8ba22cd323d481eb8bd08ebca0fab8f1dbfc2f9 (patch)
treea3fd06e2f8bdfad37812ec19088159c93f5c77ee /enc/gb2312.c
parent314b50d7c05e946e4e9bbc5fdb38ecb67180c139 (diff)
Revert "Removed unused includes"
This reverts commit c9eb8f82e9febeb634a23bec6aeea915eb25fe26. The change caused "implicit declaration" warning and actual segfault. ``` /tmp/ruby/v2/src/trunk-gc-asserts/enc/gb2312.c: In function ‘Init_gb2312’: /tmp/ruby/v2/src/trunk-gc-asserts/enc/gb2312.c:6:31: warning: implicit declaration of function ‘rb_enc_find’ [-Wimplicit-function-declaration] rb_enc_register("GB2312", rb_enc_find("EUC-KR")); ^~~~~~~~~~~ /tmp/ruby/v2/src/trunk-gc-asserts/enc/gb2312.c:6:31: warning: passing argument 2 of ‘rb_enc_register’ makes pointer from integer without a cast [-Wint-conversion] <command-line>:0:19: note: expected ‘OnigEncoding {aka const struct OnigEncodingTypeST *}’ but argument is of type ‘int’ /tmp/ruby/v2/src/trunk-gc-asserts/regenc.h:231:12: note: in expansion of macro ‘ONIG_ENC_REGISTER’ extern int ONIG_ENC_REGISTER(const char *, OnigEncoding); ^~~~~~~~~~~~~~~~~ ```
Diffstat (limited to 'enc/gb2312.c')
-rw-r--r--enc/gb2312.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/enc/gb2312.c b/enc/gb2312.c
index 717ad308da..6fc15735fc 100644
--- a/enc/gb2312.c
+++ b/enc/gb2312.c
@@ -1,3 +1,5 @@
+#include <ruby/ruby.h>
+#include <ruby/encoding.h>
#include "regenc.h"
void