Skip to content

Commit

Permalink
Cherry-pick from upstream and fix issue: k-takata/Onigmo#130
Browse files Browse the repository at this point in the history
  • Loading branch information
Lessica committed Apr 1, 2022
1 parent 0f9fcb1 commit 2cefa12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/Packages
/*.xcodeproj
xcuserdata
.swiftpm/
6 changes: 5 additions & 1 deletion Sources/Onigmo/include/st.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
23 changes: 0 additions & 23 deletions Sources/Onigmo/src/enc/mktable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 2cefa12

Please sign in to comment.