mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-05-08 02:53:03 +08:00
First working version of Win9x build.
This commit is contained in:
parent
763b7c5f47
commit
352d542177
80
build-mingw-lowend9x
Normal file
80
build-mingw-lowend9x
Normal file
@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# I'm sick and tired of all the churn the three versions of autoconf
|
||||
# are causing in this repo. Stop committing the configure scripts
|
||||
# and just autoregen.
|
||||
./autogen.sh || exit 1
|
||||
|
||||
# where are we?
|
||||
top=$(pwd)
|
||||
if test -z "${top}" ; then exit 1; fi
|
||||
|
||||
# fix
|
||||
chmod +x vs/sdl/build-scripts/strip_fPIC.sh
|
||||
|
||||
LOWEND9X_FLAGS=" -D_WIN32_WINDOWS=0x0400 -D_FILE_OFFSET_BITS=32 -D__USE_MINGW_ANSI_STDIO=1 -mwin32 -march=pentium3 "
|
||||
|
||||
CFLAGS="${LOWEND9X_FLAGS} ${CFLAGS}"
|
||||
CXXFLAGS="${LOWEND9X_FLAGS} ${CXXFLAGS}"
|
||||
CPPFLAGS="${LOWEND9X_FLAGS} ${CPPFLAGS}"
|
||||
export CFLAGS CPPFLAGS CXXFLAGS
|
||||
|
||||
# prefer to compile against our own copy of SDL 1.x
|
||||
echo "Compiling our internal SDL 1.x"
|
||||
(cd vs/sdl && ./build-dosbox.sh) || exit 1
|
||||
|
||||
# prefer to compile against our own copy of SDLnet 1.x
|
||||
echo "Compiling our internal SDLnet 1.x"
|
||||
(cd vs/sdlnet && ./build-dosbox.sh) || exit 1
|
||||
|
||||
# NTS: MinGW provides zlib for us
|
||||
if false; then
|
||||
# prefer to compile against our own zlib
|
||||
echo "Compiling our internal zlib"
|
||||
(cd vs/zlib && ./build-dosbox.sh) || exit 1
|
||||
new="-I${top}/vs/zlib/linux-host/include "
|
||||
nld="-L${top}/vs/zlib/linux-host/lib "
|
||||
CFLAGS="${new}${CFLAGS}"
|
||||
LDFLAGS="${nld}${LDFLAGS}"
|
||||
CPPFLAGS="${new}${CPPFLAGS}"
|
||||
CXXFLAGS="${new}${CXXFLAGS}"
|
||||
export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS
|
||||
fi
|
||||
|
||||
# prefer to compile against our own libpng (comment this out to disable)
|
||||
echo "Compiling our internal libpng"
|
||||
(cd vs/libpng && ./build-dosbox.sh) || exit 1
|
||||
new="-I${top}/vs/libpng/linux-host/include "
|
||||
nld="-L${top}/vs/libpng/linux-host/lib "
|
||||
CFLAGS="${new}${CFLAGS}"
|
||||
LDFLAGS="${nld}${LDFLAGS}"
|
||||
CPPFLAGS="${new}${CPPFLAGS}"
|
||||
CXXFLAGS="${new}${CXXFLAGS}"
|
||||
export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS
|
||||
|
||||
# prefer to compile against our own freetype
|
||||
echo "Compiling our internal freetype"
|
||||
(cd vs/freetype && ./build-dosbox.sh) || exit 1
|
||||
new="-I${top}/vs/freetype/linux-host/include/freetype2 "
|
||||
nld="-L${top}/vs/freetype/linux-host/lib -lfreetype "
|
||||
CFLAGS="${new}${CFLAGS}"
|
||||
LDFLAGS="${nld}${LDFLAGS}"
|
||||
CPPFLAGS="${new}${CPPFLAGS}"
|
||||
CXXFLAGS="${new}${CXXFLAGS}"
|
||||
INTERNAL_FREETYPE=1
|
||||
export CFLAGS LDFLAGS CPPFLAGS CXXFLAGS INTERNAL_FREETYPE
|
||||
|
||||
# build opencow for win9x unicode
|
||||
echo "Compiling opencow"
|
||||
(cd vs/opencow && make -f ./Makefile.mingw) || exit 1
|
||||
nld=" -L${top}/vs/opencow/build " #-Wl,--allow-multiple-definition "
|
||||
LDFLAGS="${nld}${LDFLAGS}"
|
||||
#LIBS=" -lopencow ${LIBS} " # should be the first one before all win32 libs.
|
||||
export LDFLAGS #LIBS
|
||||
|
||||
# now compile ourself
|
||||
echo "Compiling DOSBox-X"
|
||||
chmod +x configure
|
||||
# FIXME: I would like MinGW builds to enable the debugger, eventually
|
||||
./configure --disable-libfluidsynth --disable-libslirp --enable-d3d9=no --enable-d3d-shaders=no --prefix=/usr --enable-xbrz=no --disable-printer --disable-largefile --enable-opencow "${@}" || exit 1
|
||||
make -j3 || exit 1
|
18
configure.ac
18
configure.ac
@ -177,6 +177,10 @@ dnl This is how the build script can specify a HX DOS extender target
|
||||
AH_TEMPLATE(C_HX_DOS,[Define to 1 to target HX DOS])
|
||||
AC_ARG_ENABLE(hx-dos,AC_HELP_STRING([--enable-hx-dos],[Enable HX target]),enable_hx=yes)
|
||||
|
||||
dnl This is how the build script can use libopencow for win9x unicode
|
||||
# AH_TEMPLATE(C_OPENCOW,[Define to 1 to enable opencow])
|
||||
AC_ARG_ENABLE(opencow,AC_HELP_STRING([--enable-opencow],[Enable OpenCOW]),enable_opencow=yes)
|
||||
|
||||
dnl Let me know if you're targeting Emscripten
|
||||
AH_TEMPLATE(C_EMSCRIPTEN,[Define to 1 to target Emscripten])
|
||||
AC_ARG_ENABLE(emscripten,AC_HELP_STRING([--enable-emscripten],[Enable Emscripten target]),enable_emscripten=$enableval,enable_emscripten=no)
|
||||
@ -1274,6 +1278,20 @@ case "$host" in
|
||||
esac
|
||||
fi
|
||||
|
||||
dnl LIBRARY USE: opencow
|
||||
case "$host" in
|
||||
*-*-cygwin* | *-*-mingw32*)
|
||||
if test x$enable_opencow = xyes; then
|
||||
LIBS="-lopencow $LIBS -lstdc++ -lopencow" #need to put at the first, also better at the last too.
|
||||
LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition "
|
||||
if test -n "$SDL_LIBS"; then
|
||||
LIBS="${LIBS//-luser32/\-lopencow -luser32}"
|
||||
#SDL_LIBS="${SDL_LIBS//-luser32/\-lopencow -luser32}"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl BUILD: whether to enable universal binary support
|
||||
if test x"$macosx" = x"1" && test x"$host_cpu" = x"arm"; then
|
||||
AC_ARG_ENABLE(universal,AC_HELP_STRING([--enable-universal],[Enable macOS universal binary support]),
|
||||
|
12190
include/enet.h
12190
include/enet.h
File diff suppressed because it is too large
Load Diff
@ -1206,7 +1206,7 @@ void drivezRegister(std::string const& path, std::string const& dir, bool usecp)
|
||||
res = ht_stat(host_name,&temp_stat);
|
||||
}
|
||||
if (res==0&&(ltime=
|
||||
#if defined(__MINGW32__) && !defined(HX_DOS)
|
||||
#if defined(__MINGW32__) && !defined(HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||
_localtime64
|
||||
#else
|
||||
localtime
|
||||
@ -1845,7 +1845,7 @@ again:
|
||||
find_size=(uint32_t) (stat_block.st_size % 0x100000000);
|
||||
const struct tm* time;
|
||||
if((time=
|
||||
#if defined(__MINGW32__) && !defined(HX_DOS)
|
||||
#if defined(__MINGW32__) && !defined(HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||
_localtime64
|
||||
#else
|
||||
localtime
|
||||
@ -2392,7 +2392,7 @@ bool localDrive::FileStat(const char* name, FileStat_Block * const stat_block) {
|
||||
/* Convert the stat to a FileStat */
|
||||
const struct tm* time;
|
||||
if((time=
|
||||
#if defined(__MINGW32__) && !defined(HX_DOS)
|
||||
#if defined(__MINGW32__) && !defined(HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||
_localtime64
|
||||
#else
|
||||
localtime
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1256,7 +1256,7 @@ int get_expanded_files(const std::string &path, std::vector<std::string> &paths,
|
||||
typedef wchar_t host_cnv_char_t;
|
||||
# define host_cnv_use_wchar
|
||||
# define _HT(x) L##x
|
||||
# if defined(HX_DOS)
|
||||
# if defined(HX_DOS) || defined(_WIN32_WINDOWS)
|
||||
# define ht_stat_t struct _stat
|
||||
# define ht_stat(x,y) _wstat(x,y)
|
||||
# elif defined(__MINGW32__)
|
||||
|
@ -4977,3 +4977,49 @@ private:
|
||||
}
|
||||
} dummy;
|
||||
}
|
||||
|
||||
#if defined(_WIN32_WINDOWS)
|
||||
|
||||
//win9x's default msvcrt.dll doesn't have fstat64
|
||||
//used by libstdc++
|
||||
#include <sys/stat.h>
|
||||
#undef _fstat
|
||||
extern "C" int __cdecl internal_fstat64(int _FileDes,struct _stat64 *_Stat)
|
||||
{
|
||||
struct stat st;
|
||||
//memset(&st,0,sizeof(st));
|
||||
int ret = fstat(_FileDes, &st);
|
||||
if (ret == -1) {
|
||||
memset(_Stat,0,sizeof(*_Stat));
|
||||
return -1;
|
||||
}
|
||||
_Stat->st_dev=st.st_dev;
|
||||
_Stat->st_ino=st.st_ino;
|
||||
_Stat->st_mode=st.st_mode;
|
||||
_Stat->st_nlink=st.st_nlink;
|
||||
_Stat->st_uid=st.st_uid;
|
||||
_Stat->st_gid=st.st_gid;
|
||||
_Stat->st_rdev=st.st_rdev;
|
||||
_Stat->st_size=(_off_t) st.st_size;
|
||||
_Stat->st_atime=st.st_atime;
|
||||
_Stat->st_mtime=st.st_mtime;
|
||||
_Stat->st_ctime=st.st_ctime;
|
||||
return ret;
|
||||
}
|
||||
extern "C" int __cdecl (*__MINGW_IMP_SYMBOL(_fstat64))(int,struct _stat64*) = internal_fstat64;
|
||||
|
||||
//win9x's default msvcrt.dll doesn't have strtoll/strtoull/strtoi64
|
||||
//libstdc++ (__USE_MINGW_ANSI_STDIO=1)
|
||||
//strtoll = _strtoi64
|
||||
//*scanf -> __mingw_*scanf -> strtoll
|
||||
extern "C" long long __cdecl strtoll(const char * __restrict__ str, char ** __restrict ptr, int base)
|
||||
{
|
||||
return strtol(str, ptr, base);
|
||||
}
|
||||
|
||||
extern "C" unsigned long long __cdecl strtoull(const char * __restrict__ str, char ** __restrict ptr, int base)
|
||||
{
|
||||
return strtoul(str, ptr, base);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -98,7 +98,7 @@ static struct {
|
||||
#include "midi_mt32.h"
|
||||
#endif
|
||||
|
||||
#if C_FLUIDSYNTH || defined(WIN32) && !defined(HX_DOS)
|
||||
#if C_FLUIDSYNTH || defined(WIN32) && !defined(HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||
#include "midi_synth.h"
|
||||
#endif
|
||||
|
||||
@ -590,7 +590,7 @@ public:
|
||||
Section_prop * section = static_cast<Section_prop *>(configuration);
|
||||
const char * dev=section->Get_string("mididevice");
|
||||
std::string fullconf = section->Get_string("midiconfig");
|
||||
#if C_FLUIDSYNTH || defined(WIN32) && !defined(HX_DOS)
|
||||
#if C_FLUIDSYNTH || defined(WIN32) && !defined(HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||
synthsamplerate = section->Get_int("samplerate");
|
||||
if (synthsamplerate == 0) synthsamplerate = 44100;
|
||||
#endif
|
||||
|
@ -44,7 +44,7 @@
|
||||
|
||||
#include "render_scalers.h"
|
||||
#include "render_glsl.h"
|
||||
#if defined(__SSE__)
|
||||
#if defined(__SSE3__)
|
||||
#include <xmmintrin.h>
|
||||
#include <emmintrin.h>
|
||||
#endif
|
||||
@ -151,7 +151,7 @@ static void RENDER_EmptyLineHandler(const void * src) {
|
||||
/* SSE2 is always available on x86_64 and Elbrus */
|
||||
# define sse2_available (1)
|
||||
extern bool avx2_available;
|
||||
#elif defined(__SSE__)
|
||||
#elif defined(__SSE3__)
|
||||
#ifdef __AVX2__
|
||||
/* We are building with -mavx2 */
|
||||
# define sse2_available (1)
|
||||
@ -179,7 +179,7 @@ static inline bool cacheHit_AVX2(const Bitu *src, Bitu *cache, Bits count) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif // __SSE__
|
||||
#endif // __SSE3__
|
||||
|
||||
/* NTS: In normal conditions, the renderer at the start of the frame
|
||||
* does not call the scaler but instead compares line by line
|
||||
@ -204,7 +204,7 @@ static inline bool RENDER_DrawLine_scanline_cacheHit(const void *s) {
|
||||
const Bitu *src = (Bitu*)s;
|
||||
Bitu *cache = (Bitu*)(render.scale.cacheRead);
|
||||
Bits count = (Bits)render.src.start;
|
||||
#if defined(__SSE__) && !(defined(_M_AMD64) || defined(__amd64__) || defined(__e2k__))
|
||||
#if defined(__SSE3__) && !(defined(_M_AMD64) || defined(__amd64__) || defined(__e2k__))
|
||||
#define MY_SIZEOF_INT_P sizeof(*src)
|
||||
if (GCC_LIKELY(avx2_available)) {
|
||||
if (!cacheHit_AVX2(src, cache, count))
|
||||
@ -222,7 +222,7 @@ static inline bool RENDER_DrawLine_scanline_cacheHit(const void *s) {
|
||||
}
|
||||
#undef MY_SIZEOF_INT_P
|
||||
else
|
||||
#endif // __SSE__
|
||||
#endif // __SSE3__
|
||||
{
|
||||
while (count) {
|
||||
if (GCC_UNLIKELY(src[0] != cache[0]))
|
||||
|
@ -389,7 +389,7 @@ extern bool bootguest, bootfast, bootvm;
|
||||
std::string dosboxpath="";
|
||||
std::string GetDOSBoxXPath(bool withexe=false) {
|
||||
std::string full;
|
||||
#if defined(HX_DOS) || defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
|
||||
#if defined(HX_DOS) || defined(_WIN32_WINDOWS) /*wai_* is problematic */ || defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
|
||||
char exepath[MAX_PATH];
|
||||
GetModuleFileName(NULL, exepath, sizeof(exepath));
|
||||
full=std::string(exepath);
|
||||
@ -6764,7 +6764,7 @@ bool DEBUG_IsDebuggerConsoleVisible(void);
|
||||
#endif
|
||||
|
||||
void DOSBox_ShowConsole() {
|
||||
#if defined(WIN32) && !defined(HX_DOS)
|
||||
#if defined(WIN32) && !defined(HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
COORD crd;
|
||||
HWND hwnd;
|
||||
@ -7436,7 +7436,7 @@ void SetWindowTransparency(int trans) {
|
||||
double alpha = (double)(100-trans)/100;
|
||||
#if defined(C_SDL2)
|
||||
SDL_SetWindowOpacity(sdl.window,alpha);
|
||||
#elif defined(WIN32) && !defined(HX_DOS)
|
||||
#elif defined(WIN32) && !defined(HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||
SetWindowLong(GetHWND(), GWL_EXSTYLE, GetWindowLong(GetHWND(), GWL_EXSTYLE) | WS_EX_LAYERED);
|
||||
SetLayeredWindowAttributes(GetHWND(), 0, 255 * alpha, LWA_ALPHA);
|
||||
#elif defined(MACOSX)
|
||||
@ -7541,6 +7541,11 @@ std::wstring win32_prompt_folder(const char *default_folder) {
|
||||
wchar_t* wfolder = default_folder == NULL ? NULL : new wchar_t[size];
|
||||
if (default_folder != NULL) mbstowcs (wfolder, default_folder, size);
|
||||
|
||||
//fix memory leaks
|
||||
std::wstring wsfolder = wfolder ? wfolder : L"";
|
||||
if(wfolder) delete[] wfolder;
|
||||
wfolder = &wsfolder[0];
|
||||
|
||||
#if 0 // Browse for folder using SHBrowseForFolder, which works on Windows XP and higher
|
||||
WCHAR szDir[MAX_PATH];
|
||||
BROWSEINFOW bInfo;
|
||||
@ -8573,7 +8578,7 @@ int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT {
|
||||
|
||||
/* -- [debug] setup console */
|
||||
#if C_DEBUG
|
||||
# if defined(WIN32) && !defined(HX_DOS)
|
||||
# if defined(WIN32) && !defined(HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||
/* Can't disable the console with debugger enabled */
|
||||
if (control->opt_noconsole) {
|
||||
LOG(LOG_MISC,LOG_DEBUG)("-noconsole: hiding Win32 console window");
|
||||
@ -8593,7 +8598,7 @@ int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT {
|
||||
int id, major, minor;
|
||||
|
||||
DOSBox_CheckOS(id, major, minor);
|
||||
if (id == 1) menu.compatible=true;
|
||||
//if (id == 1) menu.compatible=true; //?
|
||||
|
||||
/* use all variables to shut up the compiler about unused vars */
|
||||
LOG(LOG_MISC,LOG_DEBUG)("DOSBox-X CheckOS results: id=%u major=%u minor=%u",id,major,minor);
|
||||
@ -9220,7 +9225,7 @@ int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT {
|
||||
mainMenu.screenHeight = (unsigned int)sdl.surface->h;
|
||||
mainMenu.updateRect();
|
||||
#endif
|
||||
#if defined(WIN32) && !defined(HX_DOS)
|
||||
#if defined(WIN32) && !defined(HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||
/* Windows 7 taskbar extension support */
|
||||
{
|
||||
HRESULT hr;
|
||||
|
@ -158,7 +158,13 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4054)
|
||||
#endif
|
||||
if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCTSTR)WAI_RETURN_ADDRESS(), &module))
|
||||
|
||||
#if defined(_WIN32_WINDOWS)
|
||||
if ((module=GetModuleHandle(NULL)) != NULL)
|
||||
#else
|
||||
if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCTSTR)WAI_RETURN_ADDRESS(), &module))
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
@ -100,7 +100,7 @@ void CPrinter::FillPalette(uint8_t redmax, uint8_t greenmax, uint8_t bluemax, ui
|
||||
extern std::string prtlist;
|
||||
|
||||
void CPrinter::getPrinterContext() {
|
||||
#if defined (WIN32)
|
||||
#if defined (WIN32) && !defined(_WIN32_WINDOWS)
|
||||
if (device.size()&&device!="-") {
|
||||
printerDC = CreateDC("WINSPOOL", device.c_str(), NULL, NULL);
|
||||
return;
|
||||
@ -2569,7 +2569,7 @@ void PRINTER_Init()
|
||||
//IO_RegisterWriteHandler(LPTPORT+2,PRINTER_writecontrol,IO_MB);
|
||||
//IO_RegisterReadHandler(LPTPORT+2,PRINTER_readcontrol,IO_MB);
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(WIN32) && !defined(_WIN32_WINDOWS)
|
||||
if (!inited && !strcasecmp(confoutputDevice, "printer")) {
|
||||
DWORD dwNeeded = 0, dwReturned = 0;
|
||||
bool fnReturn = EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 1L, (LPBYTE)NULL, 0L, &dwNeeded, &dwReturned); PRINTER_INFO_1* pInfo = NULL;
|
||||
|
@ -244,7 +244,11 @@ ENETServerSocket::~ENETServerSocket()
|
||||
static char *enet_address_to_string(const ENetAddress &address)
|
||||
{
|
||||
static char ip_buf[INET_ADDRSTRLEN];
|
||||
#if !defined(_WIN32_WINDOWS)
|
||||
enet_address_get_host_ip_new(&address, ip_buf, sizeof(ip_buf));
|
||||
#else
|
||||
ip_buf[0] = 0;
|
||||
#endif
|
||||
return ip_buf;
|
||||
}
|
||||
|
||||
@ -475,7 +479,11 @@ bool ENETClientSocket::GetRemoteAddressString(char *buffer)
|
||||
{
|
||||
updateState();
|
||||
assert(buffer);
|
||||
#if !defined(_WIN32_WINDOWS)
|
||||
enet_address_get_host_ip(&address, buffer, 16);
|
||||
#else
|
||||
buffer[0] = 0;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#define FLUIDINC
|
||||
#include "config.h"
|
||||
#if !C_FLUIDSYNTH && defined(WIN32) && !defined(C_HX_DOS)
|
||||
#if !C_FLUIDSYNTH && defined(WIN32) && !defined(C_HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||
#include "fluid_sys.h"
|
||||
|
||||
#if defined(WIN32)
|
||||
@ -359,19 +359,19 @@ fluid_is_soundfont(const char *filename)
|
||||
if (fp == NULL) {
|
||||
return 0;
|
||||
}
|
||||
if ((fread((void*)riff_id, 1, sizeof(riff_id), fp) != sizeof(riff_id)) ||
|
||||
(fseek(fp, 4, SEEK_CUR) != 0) ||
|
||||
(fread((void*)sfbk_id, 1, sizeof(sfbk_id), fp) != sizeof(sfbk_id)))
|
||||
{
|
||||
if ((fread((void*)riff_id, 1, sizeof(riff_id), fp) != sizeof(riff_id)) ||
|
||||
(fseek(fp, 4, SEEK_CUR) != 0) ||
|
||||
(fread((void*)sfbk_id, 1, sizeof(sfbk_id), fp) != sizeof(sfbk_id)))
|
||||
{
|
||||
goto error_rec;
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
return (FLUID_STRNCMP(riff_id, "RIFF", sizeof(riff_id)) == 0) &&
|
||||
return (FLUID_STRNCMP(riff_id, "RIFF", sizeof(riff_id)) == 0) &&
|
||||
(FLUID_STRNCMP(sfbk_id, "sfbk", sizeof(sfbk_id)) == 0);
|
||||
|
||||
error_rec:
|
||||
fclose(fp);
|
||||
error_rec:
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -881,14 +881,14 @@ new_fluid_timer (int msec, fluid_timer_callback_t callback, void* data,
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fluid_timer_run(timer); /* Run directly, instead of as a separate thread */
|
||||
if (auto_destroy)
|
||||
{
|
||||
/* do NOT return freed memory */
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
fluid_timer_run(timer); /* Run directly, instead of as a separate thread */
|
||||
if (auto_destroy)
|
||||
{
|
||||
/* do NOT return freed memory */
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return timer;
|
||||
}
|
||||
@ -1236,9 +1236,9 @@ int delete_fluid_server_socket(fluid_server_socket_t* server_socket)
|
||||
if (server_socket->socket != INVALID_SOCKET) {
|
||||
fluid_socket_close(server_socket->socket);
|
||||
}
|
||||
if (server_socket->thread) {
|
||||
fluid_thread_join(server_socket->thread);
|
||||
delete_fluid_thread(server_socket->thread);
|
||||
if (server_socket->thread) {
|
||||
fluid_thread_join(server_socket->thread);
|
||||
delete_fluid_thread(server_socket->thread);
|
||||
}
|
||||
FLUID_FREE(server_socket);
|
||||
return FLUID_OK;
|
||||
|
@ -93,7 +93,7 @@
|
||||
#if __has_builtin(__builtin_ia32_pabsd256)
|
||||
#define FLAC__AVX2_SUPPORTED 1
|
||||
#endif
|
||||
#elif defined __GNUC__ && !defined __clang__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) /* GCC 4.9+ */
|
||||
#elif defined __GNUC__ && !defined __clang__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) /* GCC 4.9+ */ && !defined(_WIN32_WINDOWS)
|
||||
#define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x)))
|
||||
#define FLAC__SSE_SUPPORTED 1
|
||||
#define FLAC__SSE2_SUPPORTED 1
|
||||
|
@ -169,7 +169,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(C_HX_DOS)
|
||||
#if defined(_WIN32) && !defined(C_HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||
#define flac_stat_s __stat64 /* stat struct */
|
||||
#define flac_fstat _fstat64
|
||||
#else
|
||||
|
@ -97,6 +97,7 @@ FILE* flac_internal_fopen_utf8(const char *filename, const char *mode)
|
||||
|
||||
int flac_internal_stat64_utf8(const char *path, struct __stat64 *buffer)
|
||||
{
|
||||
#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
|
||||
if (!utf8_filenames) {
|
||||
return _stat64(path, buffer);
|
||||
} else {
|
||||
@ -109,6 +110,35 @@ int flac_internal_stat64_utf8(const char *path, struct __stat64 *buffer)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
int ret;
|
||||
struct stat st;
|
||||
if (!utf8_filenames) {
|
||||
ret = stat(path, &st);
|
||||
} else {
|
||||
wchar_t *wpath;
|
||||
|
||||
if (!(wpath = wchar_from_utf8(path))) return -1;
|
||||
ret = wstat(wpath, &st);
|
||||
free(wpath);
|
||||
}
|
||||
if(ret == 0)
|
||||
{
|
||||
buffer->st_dev=st.st_dev;
|
||||
buffer->st_ino=st.st_ino;
|
||||
buffer->st_mode=st.st_mode;
|
||||
buffer->st_nlink=st.st_nlink;
|
||||
buffer->st_uid=st.st_uid;
|
||||
buffer->st_gid=st.st_gid;
|
||||
buffer->st_rdev=st.st_rdev;
|
||||
buffer->st_size=(_off_t) st.st_size;
|
||||
buffer->st_atime=st.st_atime;
|
||||
buffer->st_mtime=st.st_mtime;
|
||||
buffer->st_ctime=st.st_ctime;
|
||||
}
|
||||
else memset(buffer, 0, sizeof(*buffer));
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
int flac_internal_chmod_utf8(const char *filename, int pmode)
|
||||
@ -133,13 +163,13 @@ int flac_internal_utime_utf8(const char *filename, struct utimbuf *times)
|
||||
return utime(filename, times);
|
||||
} else {
|
||||
wchar_t *wname;
|
||||
struct __utimbuf64 ut;
|
||||
struct _utimbuf ut;
|
||||
int ret;
|
||||
|
||||
if (!(wname = wchar_from_utf8(filename))) return -1;
|
||||
ut.actime = times->actime;
|
||||
ut.modtime = times->modtime;
|
||||
ret = _wutime64(wname, &ut);
|
||||
ret = _wutime(wname, &ut);
|
||||
free(wname);
|
||||
|
||||
return ret;
|
||||
|
@ -525,9 +525,18 @@ char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app)
|
||||
size_t len = 0;
|
||||
char *retval = NULL;
|
||||
|
||||
#if !defined(_WIN32_WINDOWS)
|
||||
if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE,
|
||||
NULL, 0, path)))
|
||||
BAIL(PHYSFS_ERR_OS_ERROR, NULL);
|
||||
#else
|
||||
{
|
||||
int len = 0;
|
||||
if((len=GetModuleFileNameW(NULL, path, MAX_PATH)) == 0)
|
||||
BAIL(PHYSFS_ERR_OS_ERROR, NULL);
|
||||
while(len > 0 && path[len] != L'\\') path[len--] = L'\0';
|
||||
}
|
||||
#endif
|
||||
|
||||
utf8 = unicodeToUtf8Heap(path);
|
||||
BAIL_IF_ERRPASS(!utf8, NULL);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -359,6 +359,9 @@ template <> inline unsigned char rotateBlendInfo<ROT_90 >(unsigned char b) { ret
|
||||
template <> inline unsigned char rotateBlendInfo<ROT_180>(unsigned char b) { return ((b << 4) | (b >> 4)) & 0xff; }
|
||||
template <> inline unsigned char rotateBlendInfo<ROT_270>(unsigned char b) { return ((b << 6) | (b >> 2)) & 0xff; }
|
||||
|
||||
#if defined(_WIN32_WINDOWS)
|
||||
#define NDEBUG
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
int debugPixelX = -1;
|
||||
|
@ -298,7 +298,7 @@
|
||||
!defined( _WIN32_WINNT ) || _WIN32_WINNT <= 0x0400
|
||||
|
||||
FT_LOCAL_DEF( BOOL )
|
||||
GetFileSizeEx( HANDLE hFile,
|
||||
GetFileSizeEx2( HANDLE hFile,
|
||||
PLARGE_INTEGER lpFileSize )
|
||||
{
|
||||
lpFileSize->u.LowPart = GetFileSize( hFile,
|
||||
@ -310,7 +310,7 @@
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#define GetFileSizeEx GetFileSizeEx2
|
||||
#endif
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user