Skip to content

Commit bc2ce96

Browse files
committed
MinGW support
1 parent 7d44ef7 commit bc2ce96

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

c89stringutils/c89stringutils_string_extras.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
* SPDX-License-Identifier: BSD-2-Clause
2424
*/
25-
#if OLD_MSVC
25+
#ifdef OLD_MSVC
2626

2727
#define snprintf _snprintf
2828
#define vsnprintf _vsnprintf
@@ -62,7 +62,7 @@ inline double wtf_vsnprintf(char *buffer, size_t count, const char *format,
6262
#define vsnprintf(buffer, count, format, args) \
6363
wtf_vsnprintf(buffer, count, format, args)
6464

65-
#endif /* !OLD_MSVC */
65+
#endif /* OLD_MSVC */
6666

6767
#endif /* !defined(HAVE_SNPRINTF_H) */
6868

c89stringutils/c89stringutils_string_extras.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
#endif /* _MSC_VER >= 1900 */
3535

3636
#else
37+
#ifdef __MINGW32__
38+
#define HAVE_SNPRINTF_H
39+
#endif /* __MINGW32__ */
3740

3841
#define HAVE_STRNCASECMP
3942

c89stringutils_tests/test_c89stringutils/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ string(REPLACE " " "_" EXEC_NAME "${EXEC_NAME}")
88
set(DOWNLOAD_DIR "${PROJECT_BINARY_DIR}/test_downloads")
99
file(MAKE_DIRECTORY "${DOWNLOAD_DIR}")
1010

11-
set(GREATEST_SHA256 "1292593d95c35eeccc89ffa1c91d6fe53b49f81cbf2c2b7758842b7f3186fcc2")
11+
set(GREATEST_SHA256 "aaea21b1f4f2a4be6c83109a53db910781d294d80cb36aafaa1b37c888ac883d")
1212
if (NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
13-
file(DOWNLOAD "https://raw.githubusercontent.com/silentbicycle/greatest/fbbf981/greatest.h"
13+
file(DOWNLOAD "https://raw.githubusercontent.com/SamuelMarks/greatest/cmake-and-msvc/greatest.h"
1414
"${DOWNLOAD_DIR}/greatest.h")
1515
file(SHA256 "${DOWNLOAD_DIR}/greatest.h" GREATEST_SHA256_FOUND)
1616
if (NOT GREATEST_SHA256_FOUND STREQUAL GREATEST_SHA256)
17-
message(FATAL_ERROR "Hashes don't match on \"${DOWNLOAD_DIR}/greatest.h\" download")
17+
message(FATAL_ERROR "SHA256 hash verification failed for \"${DOWNLOAD_DIR}/greatest.h\"\n
18+
\"${GREATEST_SHA256_FOUND}\" != \"${GREATEST_SHA256}\"")
1819
endif (NOT GREATEST_SHA256_FOUND STREQUAL GREATEST_SHA256)
1920
endif (NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
2021

0 commit comments

Comments
 (0)