mirror of
https://github.com/Alcaro/Flips.git
synced 2026-09-07 10:06:09 -05:00
@@ -6,10 +6,12 @@
|
||||
#include "flips.h"
|
||||
#include "crc32.h"
|
||||
|
||||
//get rid of dependencies on libstdc++, they eat 200KB on Windows
|
||||
#ifdef __MINGW32__
|
||||
//get rid of dependencies on libstdc++, they waste 200KB on this platform
|
||||
void* operator new(size_t n) { return malloc(n); } // forget allocation failures, let them segfault.
|
||||
void operator delete(void * p) { free(p); }
|
||||
extern "C" void __cxa_pure_virtual() { while(1); }
|
||||
extern "C" void __cxa_pure_virtual() { abort(); }
|
||||
#endif
|
||||
|
||||
|
||||
//TODO: delete
|
||||
@@ -449,7 +451,8 @@ config::~config()
|
||||
{
|
||||
LPWSTR data = this->flatten();
|
||||
//puts(data);
|
||||
filewrite::write(this->filename, (struct mem){ (uint8_t*)data, wcslen(data)*sizeof(WCHAR) });
|
||||
struct mem m = { (uint8_t*)data, wcslen(data)*sizeof(WCHAR) };
|
||||
filewrite::write(this->filename, m);
|
||||
free(data);
|
||||
free(this->filename);
|
||||
}
|
||||
|
||||
2
global.h
2
global.h
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
virtual size_t len() = 0;
|
||||
virtual const uint8_t * ptr() = 0;
|
||||
struct mem get() { return (struct mem){ (uint8_t*)ptr(), len() }; }
|
||||
struct mem get() { struct mem m = { (uint8_t*)ptr(), len() }; return m; }
|
||||
|
||||
virtual ~filemap() {}
|
||||
};
|
||||
|
||||
8
make.bat
8
make.bat
@@ -1,5 +1,6 @@
|
||||
::This script creates a heavily optimized binary. For debugging, you're better off using 'mingw32-make'.
|
||||
|
||||
::Feel free to point this elsewhere.
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
|
||||
::call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
|
||||
::call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
|
||||
@@ -25,13 +26,12 @@ if exist flips.exe goto h
|
||||
::/TP - force C++ because void foo(int bar = 0); is syntax error in C
|
||||
::/MT - use static msvcrt
|
||||
::/GL - LTCG
|
||||
::/openmp - enable OpenMP
|
||||
::cl /c /Oy /Oi /Os /Ox /EHs-c- /Gz /D_CRT_SECURE_NO_WARNINGS /WX /wd4700 /nologo /TP /MT /GL *.cpp *.c
|
||||
rem /openmp
|
||||
::/openmp - enable OpenMP (adds an extra DLL, so let's not)
|
||||
cl /c /Oy /Oi /Os /Ox /EHs-c- /Gz /D_CRT_SECURE_NO_WARNINGS /WX /wd4700 /nologo /TP /MT /GL /Imsvc ^
|
||||
/DUSE_DIVSUFSORT /Ilibdivsufsort-2.0.1\include /DHAVE_CONFIG_H libdivsufsort-2.0.1\lib\*.c ^
|
||||
*.c *.cpp
|
||||
rc /nologo flips.rc
|
||||
::rc doesn't have a /nologo, just let it spam
|
||||
rc flips.rc
|
||||
|
||||
link /LTCG /nologo *.obj /subsystem:windows flips.res user32.lib gdi32.lib comctl32.lib shell32.lib comdlg32.lib advapi32.lib /out:flips.exe
|
||||
|
||||
|
||||
Reference in New Issue
Block a user