diff --git a/.gitignore b/.gitignore index 749260b..afe1ab1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /Packages /*.xcodeproj xcuserdata +.swiftpm/ diff --git a/Sources/Onigmo/include/st.h b/Sources/Onigmo/include/st.h index 812292b..2dbfa60 100644 --- a/Sources/Onigmo/include/st.h +++ b/Sources/Onigmo/include/st.h @@ -62,7 +62,11 @@ typedef st_data_t st_index_t; typedef int st_compare_func(st_data_t, st_data_t); typedef st_index_t st_hash_func(st_data_t); -typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP == (int)sizeof(st_index_t) ? 1 : -1]; +#ifndef __EMSCRIPTEN__ +/* See issue: https://github.com/k-takata/Onigmo/issues/130 */ +typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP == (int)sizeof(st_index_t) ? 1 : 0]; +#endif + #define SIZEOF_ST_INDEX_T SIZEOF_VOIDP struct st_hash_type { diff --git a/Sources/Onigmo/src/enc/mktable.c b/Sources/Onigmo/src/enc/mktable.c index 4edd5a0..19beb62 100644 --- a/Sources/Onigmo/src/enc/mktable.c +++ b/Sources/Onigmo/src/enc/mktable.c @@ -1159,26 +1159,3 @@ static int exec(FILE* fp, ENC_INFO* einfo) return 0; } - -extern int main(int argc ARG_UNUSED, char* argv[] ARG_UNUSED) -{ - int r; - int i; - FILE* fp = stdout; - - setlocale(LC_ALL, "C"); - /* setlocale(LC_ALL, "POSIX"); */ - /* setlocale(LC_ALL, "en_GB.iso88591"); */ - /* setlocale(LC_ALL, "de_BE.iso88591"); */ - /* setlocale(LC_ALL, "fr_FR.iso88591"); */ - - for (i = 0; i < (int )(sizeof(Info)/sizeof(ENC_INFO)); i++) { - r = exec(fp, &Info[i]); - if (r < 0) { - fprintf(stderr, "FAIL exec(): %d\n", r); - return -1; - } - } - - return 0; -}