Fix build in newer Emscripten versions (nw)

This commit is contained in:
Justin Kerk 2019-08-08 14:23:12 +00:00
parent 2e2ee0ee6a
commit 490709a6c1
11 changed files with 17 additions and 16 deletions

View File

@ -1174,6 +1174,7 @@ configuration { "asmjs" }
}
linkoptions {
"-Wl,--start-group",
"-s ERROR_ON_MISSING_LIBRARIES=0"
}
archivesplit_size "20"

View File

@ -88,7 +88,7 @@
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h>
#if defined(EMSCRIPTEN)
#if defined(__EMSCRIPTEN__)
#include <emscripten.h>
#endif
@ -340,7 +340,7 @@ int running_machine::run(bool quiet)
m_hard_reset_pending = false;
#if defined(EMSCRIPTEN)
#if defined(__EMSCRIPTEN__)
// break out to our async javascript loop and halt
emscripten_set_running_machine(this);
#endif
@ -1354,7 +1354,7 @@ device_memory_interface::space_config_vector dummy_space_device::memory_space_co
// JAVASCRIPT PORT-SPECIFIC
//**************************************************************************
#if defined(EMSCRIPTEN)
#if defined(__EMSCRIPTEN__)
running_machine * running_machine::emscripten_running_machine;
@ -1439,4 +1439,4 @@ void running_machine::emscripten_load(const char *name) {
emscripten_running_machine->schedule_load(name);
}
#endif /* defined(EMSCRIPTEN) */
#endif /* defined(__EMSCRIPTEN__) */

View File

@ -396,7 +396,7 @@ private:
// configuration state
dummy_space_device m_dummy_space;
#if defined(EMSCRIPTEN)
#if defined(__EMSCRIPTEN__)
private:
static running_machine *emscripten_running_machine;
static void emscripten_main_loop();

View File

@ -311,7 +311,7 @@ void mame_ui_manager::display_startup_screens(bool first_time)
if (!first_time || (str > 0 && str < 60*5) || &machine().system() == &GAME_NAME(___empty) || (machine().debug_flags & DEBUG_FLAG_ENABLED) != 0 || video_none)
show_gameinfo = show_warnings = show_mandatory_fileman = false;
#if defined(EMSCRIPTEN)
#if defined(__EMSCRIPTEN__)
// also disable for the JavaScript port since the startup screens do not run asynchronously
show_gameinfo = show_warnings = false;
#endif

View File

@ -141,7 +141,7 @@ typedef __int128_t INT128;
#define MEMBER_ABI _thiscall
#elif defined(__clang__) && defined(__i386__) && defined(_WIN32)
#define PHAS_PMF_INTERNAL 0
#elif defined(__arm__) || defined(__ARMEL__) || defined(__aarch64__) || defined(__MIPSEL__) || defined(__mips_isa_rev) || defined(__mips64) || defined(EMSCRIPTEN)
#elif defined(__arm__) || defined(__ARMEL__) || defined(__aarch64__) || defined(__MIPSEL__) || defined(__mips_isa_rev) || defined(__mips64) || defined(__EMSCRIPTEN__)
#define PHAS_PMF_INTERNAL 2
#else
#define PHAS_PMF_INTERNAL 1

View File

@ -73,7 +73,7 @@ dynlib::dynlib(const pstring &libname)
//else
// fprintf(stderr, "win: library <%s> not found!\n", libname.c_str());
delete [] buffer;
#elif defined(EMSCRIPTEN)
#elif defined(__EMSCRIPTEN__)
//no-op
#else
//printf("loading <%s>\n", libname.c_str());
@ -107,7 +107,7 @@ dynlib::dynlib(const pstring &path, const pstring &libname)
//printf("win: library <%s> not found!\n", libname.c_str());
}
delete [] buffer;
#elif defined(EMSCRIPTEN)
#elif defined(__EMSCRIPTEN__)
//no-op
#else
//printf("loading <%s>\n", libname.c_str());

View File

@ -39,7 +39,7 @@ delegate_mfp::raw_mfp_data delegate_mfp::s_null_mfp = { {0 }};
delegate_generic_function delegate_mfp::convert_to_generic(delegate_generic_class *&object) const
{
#if defined(__arm__) || defined(__ARMEL__) || defined(__aarch64__) || defined(__MIPSEL__) || defined(__mips_isa_rev) || defined(__mips64) || defined(EMSCRIPTEN)
#if defined(__arm__) || defined(__ARMEL__) || defined(__aarch64__) || defined(__MIPSEL__) || defined(__mips_isa_rev) || defined(__mips64) || defined(__EMSCRIPTEN__)
if ((m_this_delta & 1) == 0) {
#if defined(LOG_DELEGATES)
printf("Calculated Addr = %08x\n", (uintptr_t)(void*)(m_function));

View File

@ -68,7 +68,7 @@ constexpr char PATHSEPCH = '\\';
constexpr char PATHSEPCH = '/';
#endif
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(EMSCRIPTEN) || defined(__ANDROID__) || defined(WIN32) || defined(SDLMAME_NO64BITIO)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__EMSCRIPTEN__) || defined(__ANDROID__) || defined(WIN32) || defined(SDLMAME_NO64BITIO)
using sdl_dirent = struct dirent;
using sdl_stat = struct stat;
#define sdl_readdir readdir

View File

@ -93,7 +93,7 @@ public:
{
ssize_t result;
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(EMSCRIPTEN) || defined(__ANDROID__)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__EMSCRIPTEN__) || defined(__ANDROID__)
result = ::pread(m_fd, buffer, size_t(count), off_t(std::make_unsigned_t<off_t>(offset)));
#elif defined(WIN32) || defined(SDLMAME_NO64BITIO)
if (lseek(m_fd, off_t(std::make_unsigned_t<off_t>(offset)), SEEK_SET) < 0)
@ -114,7 +114,7 @@ public:
{
ssize_t result;
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(EMSCRIPTEN) || defined(__ANDROID__)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__EMSCRIPTEN__) || defined(__ANDROID__)
result = ::pwrite(m_fd, buffer, size_t(count), off_t(std::make_unsigned_t<off_t>(offset)));
#elif defined(WIN32) || defined(SDLMAME_NO64BITIO)
if (lseek(m_fd, off_t(std::make_unsigned_t<off_t>(offset)), SEEK_SET) < 0)
@ -135,7 +135,7 @@ public:
{
int result;
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(EMSCRIPTEN) || defined(WIN32) || defined(SDLMAME_NO64BITIO) || defined(__ANDROID__)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__EMSCRIPTEN__) || defined(WIN32) || defined(SDLMAME_NO64BITIO) || defined(__ANDROID__)
result = ::ftruncate(m_fd, off_t(std::make_unsigned_t<off_t>(offset)));
#else
result = ::ftruncate64(m_fd, off64_t(offset));

View File

@ -25,7 +25,7 @@
#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
#include <termios.h>
#include <util.h>
#elif defined(__linux__) || defined(EMSCRIPTEN)
#elif defined(__linux__) || defined(__EMSCRIPTEN__)
#include <pty.h>
#elif defined(__HAIKU__)
#include <bsd/pty.h>

View File

@ -63,7 +63,7 @@
#define SDLMAME_NO64BITIO 1
#endif
#if defined(EMSCRIPTEN)
#if defined(__EMSCRIPTEN__)
#define SDLMAME_EMSCRIPTEN 1
#define SDLMAME_NO64BITIO 1
struct _IO_FILE {}; //_IO_FILE is an opaque type in the emscripten libc which makes clang cranky