mirror of
https://github.com/corda/corda.git
synced 2025-01-17 02:09:50 +00:00
Support new WinRT interop
This commit is contained in:
parent
6376a491b6
commit
362f4aaa89
@ -55,6 +55,15 @@
|
||||
|
||||
typedef wchar_t char_t;
|
||||
|
||||
#if defined(WINAPI_FAMILY)
|
||||
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
|
||||
#include "avian-interop.h"
|
||||
#define SKIP_OPERATOR_NEW
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else // not PLATFORM_WINDOWS
|
||||
|
||||
# include <dirent.h>
|
||||
@ -93,7 +102,9 @@ typedef char char_t;
|
||||
# endif
|
||||
#endif // WINAPI_FAMILY
|
||||
|
||||
#if !defined(SKIP_OPERATOR_NEW)
|
||||
inline void* operator new(size_t, void* p) throw() { return p; }
|
||||
#endif
|
||||
|
||||
typedef const char_t* string_t;
|
||||
|
||||
@ -240,37 +251,16 @@ Java_java_io_File_toAbsolutePath(JNIEnv* e UNUSED, jclass, jstring path)
|
||||
|
||||
return path;
|
||||
# else
|
||||
// This could have worked, if GetFileInformationByHandleEx() returned volume information also
|
||||
// There is a chance to get it, or using GetFullPathName, that is claimed to be unsupported
|
||||
// or from System.IO.Path.GetFullPath(), but it's CLR and I see no way of calling it from
|
||||
// C++/CX code
|
||||
// Best wishes to everyone who will win this fight,
|
||||
// Alexey Pelykh
|
||||
/*
|
||||
string_t chars = getChars(e, path);
|
||||
if(chars) {
|
||||
LARGE_INTEGER fileSize;
|
||||
HANDLE file = CreateFile2
|
||||
(chars, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr);
|
||||
std::wstring partialPath = chars;
|
||||
releaseChars(e, path, chars);
|
||||
|
||||
if (file == INVALID_HANDLE_VALUE)
|
||||
return path;
|
||||
|
||||
uint8_t buffer[sizeof(FILE_NAME_INFO) + sizeof(WCHAR)*MAX_PATH];
|
||||
memset(&buffer[0], 0, sizeof(buffer));
|
||||
FILE_NAME_INFO* pInfo = reinterpret_cast<FILE_NAME_INFO*>(&buffer[0]);
|
||||
if(!GetFileInformationByHandleEx(file, FileNameInfo, pInfo, sizeof(buffer)))
|
||||
{
|
||||
CloseHandle(file);
|
||||
return path;
|
||||
}
|
||||
CloseHandle(file);
|
||||
std::wstring fullPath = AvianInterop::GetFullPath(partialPath);
|
||||
|
||||
return e->NewString
|
||||
(reinterpret_cast<const jchar*>(pInfo->FileName), pInfo->FileNameLength / sizeof(WCHAR));
|
||||
(reinterpret_cast<const jchar*>(fullPath.c_str()), fullPath.length());
|
||||
}
|
||||
*/
|
||||
return path;
|
||||
# endif
|
||||
#else
|
||||
|
9
makefile
9
makefile
@ -705,12 +705,12 @@ ifeq ($(platform),wp8)
|
||||
-DAVIAN_VERSION=\"$(version)\" -D_JNI_IMPLEMENTATION_ \
|
||||
-DUSE_ATOMIC_OPERATIONS -DAVIAN_JAVA_HOME=\"$(javahome)\" \
|
||||
-DAVIAN_EMBED_PREFIX=\"$(embed-prefix)\" \
|
||||
-I"$(shell $(windows-path) "$(wp8)/zlib/upstream")" \
|
||||
-Fd$(build)/$(name).pdb -I"$(shell $(windows-path) "$(wp8)/include")" -I$(src) -I$(classpath-src) \
|
||||
-I"$(shell $(windows-path) "$(wp8)/zlib/upstream")" -I"$(shell $(windows-path) "$(wp8)/interop/avian-interop-client")" \
|
||||
-I"$(shell $(windows-path) "$(wp8)/include")" -I$(src) -I$(classpath-src) \
|
||||
-I"$(build)" \
|
||||
-I"$(windows-java-home)/include" -I"$(windows-java-home)/include/win32" \
|
||||
-DTARGET_BYTES_PER_WORD=$(pointer-size) \
|
||||
-Gd
|
||||
-Gd -EHsc
|
||||
|
||||
common-lflags = $(classpath-lflags)
|
||||
|
||||
@ -738,7 +738,8 @@ ifeq ($(platform),wp8)
|
||||
-MACHINE:$(machine_type) \
|
||||
-LIBPATH:"$(WP80_KIT)\lib\$(w8kit_arch)" -LIBPATH:"$(WP80_SDK)\lib$(vc_arch)" -LIBPATH:"$(WIN8_KIT)\Lib\win8\um\$(w8kit_arch)" \
|
||||
ws2_32.lib \
|
||||
"$(shell $(windows-path) "$(wp8)\lib\$(deps_arch)\$(build-type)\zlib.lib")" "$(shell $(windows-path) "$(wp8)\lib\$(deps_arch)\$(build-type)\ThreadEmulation.lib")"
|
||||
"$(shell $(windows-path) "$(wp8)\lib\$(deps_arch)\$(build-type)\zlib.lib")" "$(shell $(windows-path) "$(wp8)\lib\$(deps_arch)\$(build-type)\ThreadEmulation.lib")" \
|
||||
"$(shell $(windows-path) "$(wp8)\lib\$(deps_arch)\$(build-type)\AvianInteropClient.lib")"
|
||||
lflags += -NXCOMPAT -DYNAMICBASE -SUBSYSTEM:CONSOLE -TLBID:1
|
||||
lflags += -NODEFAULTLIB:"ole32.lib" -NODEFAULTLIB:"kernel32.lib"
|
||||
lflags += PhoneAppModelHost.lib WindowsPhoneCore.lib -WINMD -WINMDFILE:$(subst $(so-suffix),.winmd,$(@))
|
||||
|
Loading…
Reference in New Issue
Block a user