Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

MSVC: <strings.h> does not exist in Windows #411

@kolomenkin

Description

@kolomenkin

There is no <strings.h> in Windows.

Only two functions are needed by gumbo parser from <strings.h>:

  • strcasecmp
  • strncasecmp

_stricmp from <string.h> completely does the same as strcasecmp
_strnicmp from <string.h> completely does the same as strncasecmp

Here is my solution for Windows:

#if defined(_WIN32) || defined(_WIN64) 
#  include <string.h>
#  define strcasecmp _stricmp 
#  define strncasecmp _strnicmp 
#else
#  include <strings.h>
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions