Fix macOS compilation for real

This commit is contained in:
Cacodemon345
2021-08-25 02:01:39 +06:00
parent 91e27c0ffc
commit c46ebc6a5e
3 changed files with 13 additions and 7 deletions

View File

@@ -7,6 +7,12 @@
#include <stdbool.h>
#ifdef G_OS_UNIX
#include <sys/un.h>
#include <sys/param.h>
#ifdef BSD
#define g_strlcpy strlcpy
#else
extern int g_strlcpy(gchar* dest, const gchar* src, gsize dest_size);
#endif
#endif
extern inline void insque(void *a, void *b)

View File

@@ -13,7 +13,7 @@
#include <errno.h>
#include <inttypes.h>
#include <dlfcn.h>
#include <SDL2/SDL.h>
#include <SDL.h>
#include <86box/86box.h>
#include <86box/keyboard.h>
#include <86box/mouse.h>
@@ -183,7 +183,7 @@ plat_tempfile(char *bufp, char *prefix, char *suffix)
gettimeofday(&t, NULL);
curtime = time(NULL);
calendertime = localtime(&curtime);
sprintf(&bufp[strlen(bufp)], "%d%02d%02d-%02d%02d%02d-%03d%s", calendertime->tm_year, calendertime->tm_mon, calendertime->tm_mday, calendertime->tm_hour, calendertime->tm_min, calendertime->tm_sec, t.tv_usec / 1000, suffix);
sprintf(&bufp[strlen(bufp)], "%d%02d%02d-%02d%02d%02d-%03ld%s", calendertime->tm_year, calendertime->tm_mon, calendertime->tm_mday, calendertime->tm_hour, calendertime->tm_min, calendertime->tm_sec, t.tv_usec / 1000, suffix);
}
int
@@ -514,14 +514,14 @@ do_stop(void)
int ui_msgbox(int flags, void *message)
{
fprintf(stderr, "Got msgbox request. Flags: 0x%X, msgid: %llu\n", flags, (uint64_t) message);
fprintf(stderr, "Got msgbox request. Flags: 0x%X, msgid: %llu\n", flags, (unsigned long long) message);
return 0;
}
int ui_msgbox_header(int flags, void *message, void* header)
{
// Parameters that are passed will crash the program so keep these off for the time being.
fprintf(stderr, "Got msgbox request. Flags: 0x%X, msgid: %llu, hdrid: %llu\n", flags, (uint64_t) message, (uint64_t) header);
fprintf(stderr, "Got msgbox request. Flags: 0x%X, msgid: %llu, hdrid: %llu\n", flags, (unsigned long long) message, (unsigned long long) header);
return 0;
}
@@ -742,4 +742,4 @@ void startblit()
void endblit()
{
SDL_UnlockMutex(blitmtx);
}
}

View File

@@ -1,5 +1,5 @@
#include <SDL2/SDL.h>
#include <SDL2/SDL_messagebox.h>
#include <SDL.h>
#include <SDL_messagebox.h>
#include <stdarg.h>
#include <stdio.h>