Skip to content

Commit d83f8fb

Browse files
committed
Fix Visual Studio build
1 parent e1c4980 commit d83f8fb

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set(VERSION 1.0.1)
55
set(SOVERSION 1)
66

77
set(CMAKE_FIND_FRAMEWORK NEVER)
8+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
89

910
macro(doption name help default def)
1011
option(${name} ${help} ${default})

decoders/libmpg123/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ target_compile_definitions(mpg123 PRIVATE
5151
-DREAL_IS_FLOAT
5252
-D_CRT_SECURE_NO_WARNINGS)
5353

54-
target_link_libraries(mpg123 PUBLIC)
55-
5654
if(NOT BUILD_SHARED_LIBS)
5755
install(TARGETS mpg123 DESTINATION lib)
5856
endif()

decoders/mpg123.c

+4
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ static const char *set_error(mpg123_handle *mp, const int err)
165165
else
166166
str = mpg123_plain_strerror(err);
167167

168+
#ifdef _MSC_VER
169+
_snprintf_s(buffer, sizeof (buffer), "MPG123: %s", str);
170+
#else
168171
snprintf(buffer, sizeof (buffer), "MPG123: %s", str);
172+
#endif
169173
__Sound_SetError(buffer);
170174

171175
return(NULL); /* this is for BAIL_MACRO to not try to reset the string. */

playsound/playsound.c

+4
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,11 @@ static void report_filename(const char *filename)
745745
SDL_WM_SetCaption(icon, icon);
746746
else
747747
{
748+
#ifdef _MSC_VER
749+
_snprintf_s(buf, len, "%s: %s", icon, filename);
750+
#else
748751
snprintf(buf, len, "%s: %s", icon, filename);
752+
#endif
749753
SDL_WM_SetCaption(buf, icon);
750754
free(buf);
751755
} /* else */

0 commit comments

Comments
 (0)