Skip to content

Commit

Permalink
mecab windows: use _set_fmode() only with MSVC
Browse files Browse the repository at this point in the history
Because MinGW doesn't provide _set_fmode() and MariaDB + Mroonga +
Groonga for Windows is built only with MSVC.
  • Loading branch information
kou committed Dec 20, 2022
1 parent 64fa834 commit 6fd161a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/tokenizers/mecab.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <string.h>
#include <ctype.h>

#ifdef _WIN32
#ifdef _MSC_VER
# include <fcntl.h>
#endif

Expand Down Expand Up @@ -563,7 +563,7 @@ mecab_model_create(grn_ctx *ctx,
# endif /* WIN32 */
#endif /* GRN_WITH_BUNDLED_MECAB */

#if _WIN32
#if _MSC_VER
/* This is a workaround for MariaDB 10.9 or later and MeCab.
*
* MariaDB 10.9 or later calls _set_fmode(_O_BINARY) in
Expand All @@ -589,7 +589,7 @@ mecab_model_create(grn_ctx *ctx,
_set_fmode(_O_TEXT);
#endif
mecab_model = mecab_model_new(argc, (char **)argv);
#if _WIN32
#if __MSC_VER
_set_fmode(current_file_translation_mode);
#endif

Expand Down

0 comments on commit 6fd161a

Please sign in to comment.