Navigation Menu

Skip to content

Commit

Permalink
Suppress warnings on MinGW
Browse files Browse the repository at this point in the history
    grn.h:133:0: warning: "strcasecmp" redefined
     #  define strcasecmp(s1, s2) _stricmp(s1, s2)
     ^
    In file included from /usr/share/mingw-w64/include/guiddef.h:148:0,
                     from /usr/share/mingw-w64/include/winnt.h:602,
                     from /usr/share/mingw-w64/include/minwindef.h:146,
                     from /usr/share/mingw-w64/include/windef.h:8,
                     from /usr/share/mingw-w64/include/windows.h:69,
                     from /usr/share/mingw-w64/include/winsock2.h:23,
                     from grn.h:103,
                     from db.c:17:
    /usr/share/mingw-w64/include/string.h:107:0: note: this is the location of the previous definition
     #define strcasecmp _stricmp
     ^

    suggest.c:27:0: warning: "strncasecmp" redefined
     # define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
     ^
    In file included from /usr/share/mingw-w64/include/guiddef.h:148:0,
                     from /usr/share/mingw-w64/include/winnt.h:602,
                     from /usr/share/mingw-w64/include/minwindef.h:146,
                     from /usr/share/mingw-w64/include/windef.h:8,
                     from /usr/share/mingw-w64/include/windows.h:69,
                     from /usr/share/mingw-w64/include/winsock2.h:23,
                     from ../../lib/grn.h:103,
                     from ../../lib/grn_ctx.h:21,
                     from suggest.c:18:
  • Loading branch information
kou committed Jan 10, 2015
1 parent b55836a commit 365080e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
3 changes: 3 additions & 0 deletions lib/grn.h
Expand Up @@ -130,6 +130,9 @@
# define fstat(fd, buf) _fstat(fd, buf)
# endif /* !defined(__GNUC__) && _MSC_VER < 1400 */
# ifdef HAVE__STRICMP
# ifdef strcasecmp
# undef strcasecmp
# endif /* strcasecmp */
# define strcasecmp(s1, s2) _stricmp(s1, s2)
# endif /* defined(HAVE__STRICMP) */

Expand Down
3 changes: 3 additions & 0 deletions plugins/query_expanders/tsv.c
Expand Up @@ -26,6 +26,9 @@
#include <string.h>

#ifdef HAVE__STRNICMP
# ifdef strncasecmp
# undef strncasecmp
# endif /* strncasecmp */
# define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
#endif /* HAVE__STRNICMP */

Expand Down
6 changes: 5 additions & 1 deletion plugins/suggest/suggest.c
Expand Up @@ -15,15 +15,19 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <string.h>

#include "grn_ctx.h"
#include "grn_db.h"
#include "grn_ii.h"
#include "grn_token_cursor.h"
#include "grn_output.h"
#include <groonga/plugin.h>
#include <string.h>

#ifdef HAVE__STRNICMP
# ifdef strncasecmp
# undef strncasecmp
# endif /* strcasecmp */
# define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
#endif /* HAVE__STRNICMP */

Expand Down
12 changes: 8 additions & 4 deletions src/groonga.c
Expand Up @@ -16,6 +16,11 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>

#ifdef WIN32
# define GROONGA_MAIN
#endif /* WIN32 */
Expand All @@ -27,10 +32,6 @@
#include <grn_db.h>
#include <grn_util.h>

#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif /* HAVE_SYS_WAIT_H */
Expand All @@ -54,6 +55,9 @@
#endif /* HAVE_IO_H */

#ifdef HAVE__STRNICMP
# ifdef strncasecmp
# undef strncasecmp
# endif /* strcasecmp */
# define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
#endif /* HAVE__STRNICMP */

Expand Down

0 comments on commit 365080e

Please sign in to comment.