Skip to content

Commit 0c1b8d1

Browse files
committed
Windows compatibility for strcasecmp
1 parent 731eab8 commit 0c1b8d1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

messaging/integration_test/src/integration_test.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
#include <inttypes.h>
16-
#include <strings.h>
1716

1817
#include <algorithm>
1918
#include <cstdio>
@@ -27,6 +26,14 @@
2726
#include "firebase/util.h"
2827
#include "firebase_test_framework.h" // NOLINT
2928

29+
#ifdef _MSC_VER
30+
// Windows uses _stricmp instead of strcasecmp.
31+
#define strncasecmp _strnicmp
32+
#define strcasecmp _stricmp
33+
#else
34+
#include <strings.h>
35+
#endif // _MSC_VER
36+
3037
// The TO_STRING macro is useful for command line defined strings as the quotes
3138
// get stripped.
3239
#define TO_STRING_EXPAND(X) #X

0 commit comments

Comments
 (0)