Skip to content

Commit a0d6089

Browse files
committed
Conform to my quality standards ; building MSVC via Wine
1 parent 4b46961 commit a0d6089

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ set(CDD_MSVC_RTC "" CACHE STRING "MSVC Runtime Checks: RTC1, RTCs, RTCu, or empt
6969
set(CDD_LTO OFF CACHE BOOL "Enable Link-Time Optimization (LTO)")
7070
set(CDD_DEPS "System" CACHE STRING "Dependency resolution strategy")
7171

72+
set(CDD_CRT_LINKAGE "Shared" CACHE STRING "MSVC CRT Linkage: Static or Shared")
73+
if (MSVC)
74+
if (CDD_CRT_LINKAGE STREQUAL "Static")
75+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
76+
else()
77+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
78+
endif()
79+
endif()
80+
81+
7282
if (CDD_CHARSET STREQUAL "Unicode")
7383
add_compile_definitions(UNICODE _UNICODE)
7484
endif()

c89stringutils/tests/test_string_extras.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ TEST x_strnstr_should_fail(void) {
5151
*/
5252
TEST x_asprintf_should_succeed(void) {
5353
char *s = NULL;
54-
int rc = c89stringutils_asprintf(&s, "foo%s", "bar");
54+
int rc;
55+
rc = c89stringutils_asprintf(&s, "foo%s", "bar");
5556
ASSERT_EQ(6, rc);
5657
ASSERT_STR_EQ("foobar", s);
5758
free(s);
@@ -64,8 +65,10 @@ TEST x_asprintf_should_succeed(void) {
6465
*/
6566
TEST x_jasprintf_should_succeed(void) {
6667
char *s = NULL;
67-
int rc1 = c89stringutils_jasprintf(&s, "foo%s", "bar");
68-
int rc2 = c89stringutils_jasprintf(&s, "can%s", "haz");
68+
int rc1;
69+
int rc2;
70+
rc1 = c89stringutils_jasprintf(&s, "foo%s", "bar");
71+
rc2 = c89stringutils_jasprintf(&s, "can%s", "haz");
6972
ASSERT_EQ(0, rc1);
7073
ASSERT_EQ(0, rc2);
7174
ASSERT_STR_EQ("foobarcanhaz", s);
@@ -157,7 +160,8 @@ static int test_vasprintf_wrapper(char **str, const char *fmt, ...) {
157160
*/
158161
TEST x_vasprintf_should_succeed(void) {
159162
char *s = NULL;
160-
int rc = test_vasprintf_wrapper(&s, "test %d", 123);
163+
int rc;
164+
rc = test_vasprintf_wrapper(&s, "test %d", 123);
161165
ASSERT_EQ(8, rc);
162166
ASSERT_STR_EQ("test 123", s);
163167
free(s);
@@ -169,7 +173,8 @@ TEST x_vasprintf_should_succeed(void) {
169173
* @return enum test result
170174
*/
171175
TEST x_vasprintf_should_fail(void) {
172-
int rc = test_vasprintf_wrapper(NULL, "test %d", 123);
176+
int rc;
177+
rc = test_vasprintf_wrapper(NULL, "test %d", 123);
173178
ASSERT_EQ(-1, rc);
174179
PASS();
175180
}

0 commit comments

Comments
 (0)