Skip to content

Commit

Permalink
Merge pull request Croteam-official#25 from DanielGibson/no-malloc-h-…
Browse files Browse the repository at this point in the history
…soundfix

Only use <malloc.h> on Win32; increase SDL sound buffer
  • Loading branch information
icculus committed Apr 16, 2016
2 parents dc2c869 + b934fa1 commit aaba575
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Sources/Ecc/StdH.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <stdarg.h>
#include <math.h>

#if !defined(PLATFORM_MACOSX) && !defined(PLATFORM_FREEBSD)
#ifdef PLATFORM_WIN32
#include <malloc.h>
#endif

Expand Down
5 changes: 1 addition & 4 deletions Sources/Engine/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <search.h> // for qsort
#include <float.h> // for FPU control

#if !defined(PLATFORM_MACOSX) && !defined(PLATFORM_FREEBSD)
#include <malloc.h>
#endif

/* rcg10042001 !!! FIXME: Move these somewhere. */
#if (defined PLATFORM_WIN32)
#include <malloc.h>
#include <conio.h>
#include <crtdbg.h>
#include <winsock2.h>
Expand Down
2 changes: 1 addition & 1 deletion Sources/Engine/Sound/SoundLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static BOOL StartUp_SDLaudio( CSoundLibrary &sl, BOOL bReport=TRUE)
}

sdl_silence = obtained.silence;
sdl_backbuffer_allocation = (obtained.size * 2);
sdl_backbuffer_allocation = (obtained.size * 4);
sdl_backbuffer = (Uint8 *)AllocMemory(sdl_backbuffer_allocation);
sdl_backbuffer_remain = 0;
sdl_backbuffer_pos = 0;
Expand Down
5 changes: 1 addition & 4 deletions Sources/Engine/StdH.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <search.h> // for qsort
#include <float.h> // for FPU control

#if !defined(PLATFORM_MACOSX) && !defined(PLATFORM_FREEBSD)
#include <malloc.h>
#endif

#ifdef PLATFORM_WIN32
#include <malloc.h>
#include <conio.h>
#include <crtdbg.h>
#include <winsock2.h>
Expand Down

0 comments on commit aaba575

Please sign in to comment.