Skip to content

Commit

Permalink
Fix breakage on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
vidarh committed Sep 23, 2018
1 parent 525b1b6 commit c86ea39
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@
#include <SDL_audio.h>
#endif


// Approximations of some Windows functions to ease portability
#if defined __GNU_LIBRARY__ || defined __GLIBC__
static int min(int l, int r) { return l < r ? l : r; }
static void strcat_s(char * dest, int size, char * str) {
unsigned int dlen = strlen(dest);
if (dlen >= size-1) return;
strncat(dest+dlen, str, size - dlen - 1);
}
void fopen_s(FILE ** f, const char * filename, const char * mode) {
*f = fopen(filename,mode);
}
#endif

void WriteWav(char* filename, char* buffer, int bufferlength)
{
unsigned int filesize;
Expand Down

0 comments on commit c86ea39

Please sign in to comment.