summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Justin Kerk <dopefishjustin@gmail.com>2020-08-04 23:53:52 -0700
committer Justin Kerk <dopefishjustin@gmail.com>2020-08-04 23:53:52 -0700
commitd2b7643753f3ed24587cf455827c04168ffbe38f (patch)
tree6783cc840fd92c79933c1b6572a118a9df3dc2dd
parent2dd0985999b8f93afb4a59e89f0d2ec2a9a4d80f (diff)
netlist: Better fixes for Emscripten (#7031)
Silence indentation warning in 3rdparty/ under Emscripten (#7031)
-rw-r--r--scripts/src/3rdparty.lua5
-rw-r--r--scripts/src/netlist.lua5
-rw-r--r--src/lib/netlist/plib/palloc.h14
-rw-r--r--src/lib/netlist/plib/pconfig.h4
4 files changed, 14 insertions, 14 deletions
diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua
index 7002fdbe0ff..ed31a844181 100644
--- a/scripts/src/3rdparty.lua
+++ b/scripts/src/3rdparty.lua
@@ -723,6 +723,11 @@ if _OPTIONS["gcc"]~=nil and string.find(_OPTIONS["gcc"], "clang") and str_to_ver
}
end
+ configuration { "asmjs" }
+ buildoptions {
+ "-Wno-misleading-indentation",
+ }
+
configuration { "mingw*" }
buildoptions_c {
"-Wno-strict-prototypes",
diff --git a/scripts/src/netlist.lua b/scripts/src/netlist.lua
index c794095115d..2607d419576 100644
--- a/scripts/src/netlist.lua
+++ b/scripts/src/netlist.lua
@@ -31,11 +31,6 @@ project "netlist"
"NL_USE_ACADEMIC_SOLVERS=0",
}
- configuration { "asmjs" }
- defines {
- "PUSE_ALIGNED_OPTIMIZATIONS=0",
- }
-
includedirs {
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/netlist",
diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h
index dd5958ff288..74170e08e0f 100644
--- a/src/lib/netlist/plib/palloc.h
+++ b/src/lib/netlist/plib/palloc.h
@@ -25,10 +25,6 @@
#include <malloc.h>
#endif
-#if defined(PAGESIZE)
-#undef PAGESIZE
-#endif
-
namespace plib {
//============================================================
@@ -627,8 +623,8 @@ namespace plib {
struct align_traits : public align_traits_base<T, has_align<T>::value>
{};
- template <typename BASEARENA = aligned_arena, std::size_t PAGESIZE = 1024>
- class paged_arena : public arena_base<paged_arena<BASEARENA, PAGESIZE>, true, true>
+ template <typename BASEARENA = aligned_arena, std::size_t PG_SIZE = 1024>
+ class paged_arena : public arena_base<paged_arena<BASEARENA, PG_SIZE>, true, true>
{
public:
paged_arena() = default;
@@ -640,13 +636,13 @@ namespace plib {
static void *allocate(size_t align, size_t size)
{
plib::unused_var(align);
- //size = ((size + PAGESIZE - 1) / PAGESIZE) * PAGESIZE;
- return arena().allocate(PAGESIZE, size);
+ //size = ((size + PG_SIZE - 1) / PG_SIZE) * PG_SIZE;
+ return arena().allocate(PG_SIZE, size);
}
static void deallocate(void *ptr, size_t size) noexcept
{
- //size = ((size + PAGESIZE - 1) / PAGESIZE) * PAGESIZE;
+ //size = ((size + PG_SIZE - 1) / PG_SIZE) * PG_SIZE;
arena().deallocate(ptr, size);
}
diff --git a/src/lib/netlist/plib/pconfig.h b/src/lib/netlist/plib/pconfig.h
index 848a813e094..c80f1bbadd6 100644
--- a/src/lib/netlist/plib/pconfig.h
+++ b/src/lib/netlist/plib/pconfig.h
@@ -41,8 +41,12 @@
/// Set this to one if you want to use aligned storage optimizations.
///
#ifndef PUSE_ALIGNED_OPTIMIZATIONS
+#if defined(__EMSCRIPTEN__)
+#define PUSE_ALIGNED_OPTIMIZATIONS (0)
+#else
#define PUSE_ALIGNED_OPTIMIZATIONS (1)
#endif
+#endif
/// \brief Use aligned allocations.
///