netlist: Better fixes for Emscripten (#7031)
Silence indentation warning in 3rdparty/ under Emscripten (#7031)
This commit is contained in:
parent
2dd0985999
commit
d2b7643753
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user