Merge pull request #81 from Aftnet/master

Enabled CHD for UWP builds
This commit is contained in:
Twinaphex 2018-01-05 13:12:41 +01:00 committed by GitHub
commit 1e9f1e6a29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 3 deletions

4
.gitignore vendored
View File

@ -2,5 +2,9 @@
*.so *.so
*.dll *.dll
*.dylib *.dylib
*.lib
*.pdb
*.exp
*.manifest
/old /old

View File

@ -240,8 +240,6 @@ else ifneq (,$(findstring windows_msvc2017,$(platform)))
MSVC2017CompileFlags = -DWINAPI_FAMILY=WINAPI_FAMILY_APP -DWINDLL -D_UNICODE -DUNICODE -DWRL_NO_DEFAULT_LIB -FS MSVC2017CompileFlags = -DWINAPI_FAMILY=WINAPI_FAMILY_APP -DWINDLL -D_UNICODE -DUNICODE -DWRL_NO_DEFAULT_LIB -FS
LDFLAGS += -APPCONTAINER -NXCOMPAT -DYNAMICBASE -MANIFEST:NO -LTCG -OPT:REF -SUBSYSTEM:CONSOLE -MANIFESTUAC:NO -OPT:ICF -ERRORREPORT:PROMPT -NOLOGO -TLBID:1 -DEBUG:FULL -WINMD:NO LDFLAGS += -APPCONTAINER -NXCOMPAT -DYNAMICBASE -MANIFEST:NO -LTCG -OPT:REF -SUBSYSTEM:CONSOLE -MANIFESTUAC:NO -OPT:ICF -ERRORREPORT:PROMPT -NOLOGO -TLBID:1 -DEBUG:FULL -WINMD:NO
LIBS += WindowsApp.lib LIBS += WindowsApp.lib
HAVE_CHD = 0
endif endif
CFLAGS += $(MSVC2017CompileFlags) CFLAGS += $(MSVC2017CompileFlags)
@ -496,7 +494,7 @@ $(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1) ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS) $(AR) rcs $@ $(OBJECTS)
else else
$(LD) $(LINKOUT)$@ $^ $(LDFLAGS) $(LD) $(LINKOUT)$@ $^ $(LDFLAGS) $(LIBS)
endif endif
%.o: %.cpp %.o: %.cpp

View File

@ -185,6 +185,16 @@ int flac_internal_rename_utf8(const char *oldname, const char *newname)
HANDLE WINAPI flac_internal_CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) HANDLE WINAPI flac_internal_CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
{ {
#if _MSC_VER > 1900 && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
wchar_t *wname;
HANDLE handle = INVALID_HANDLE_VALUE;
if ((wname = wchar_from_utf8(lpFileName)) != NULL) {
handle = CreateFile2(wname, dwDesiredAccess, dwShareMode, CREATE_ALWAYS, NULL);
free(wname);
}
#else
if (!utf8_filenames) { if (!utf8_filenames) {
return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
} else { } else {
@ -198,4 +208,5 @@ HANDLE WINAPI flac_internal_CreateFile_utf8(const char *lpFileName, DWORD dwDesi
return handle; return handle;
} }
#endif
} }

View File

@ -4,6 +4,10 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#ifdef __LIBRETRO__
#include <streams/file_stream_transforms.h>
#endif
#define ARRAY_LENGTH(x) (sizeof(x)/sizeof(x[0])) #define ARRAY_LENGTH(x) (sizeof(x)/sizeof(x[0]))
typedef uint64_t UINT64; typedef uint64_t UINT64;

View File

@ -177,11 +177,15 @@ Bool CPU_Is_InOrder()
#include <windows.h> #include <windows.h>
static Bool CPU_Sys_Is_SSE_Supported() static Bool CPU_Sys_Is_SSE_Supported()
{ {
#if _MSC_VER >= 1900 && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
return True;
#else
OSVERSIONINFO vi; OSVERSIONINFO vi;
vi.dwOSVersionInfoSize = sizeof(vi); vi.dwOSVersionInfoSize = sizeof(vi);
if (!GetVersionEx(&vi)) if (!GetVersionEx(&vi))
return False; return False;
return (vi.dwMajorVersion >= 5); return (vi.dwMajorVersion >= 5);
#endif
} }
#define CHECK_SYS_SSE_SUPPORT if (!CPU_Sys_Is_SSE_Supported()) return False; #define CHECK_SYS_SSE_SUPPORT if (!CPU_Sys_Is_SSE_Supported()) return False;
#else #else