1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027350: Support for Universal Windows Platform

- Toolchain file to configure a Visual Studio generator for a Windows 10 Universal Application was added (CMake).
- There is no support for environment variables in UWP.
- SID is not supported (were excluded).
- Windows registry is not supported (were excluded).
- Mess with usage of Unicode/ANSI was corrected.
- Added sample to check UWP functionality.
- Excluded usage of methods with Unicode characters where it is possible.
- Minor corrections to allow building OCAF (except TKVCAF) and DE (except VRML and XDE)
- Building of unsupported modules for UWP platform is off by default .
- Checking of DataExchange functionality was added to XAML (UWP) sample.
- Added information about UWP to the documentation.
- Update of results of merge with issue 27801
This commit is contained in:
ski
2016-08-12 18:38:48 +03:00
committed by abv
parent f3ec3b372c
commit 742cc8b01d
69 changed files with 1526 additions and 639 deletions

View File

@@ -36,6 +36,12 @@
extern "C" int posix_memalign (void** thePtr, size_t theAlign, size_t theSize);
#endif
// There is no support for environment variables in UWP
// OSD_Environment could not be used here because of cyclic dependency
#ifdef OCCT_UWP
#define getenv(x) NULL
#endif
#ifndef OCCT_MMGT_OPT_DEFAULT
#define OCCT_MMGT_OPT_DEFAULT 0
#endif

View File

@@ -13,6 +13,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifdef _WIN32
#include <windows.h>
#endif
#include <Standard_MMgrOpt.hxx>
#include <Standard_OutOfMemory.hxx>
#include <Standard_Assert.hxx>
@@ -20,9 +24,7 @@
#include <stdio.h>
#include <errno.h>
#ifdef _WIN32
# include <windows.h>
#else
#ifndef _WIN32
# include <sys/mman.h> /* mmap() */
#endif
@@ -32,6 +34,9 @@
extern "C" int getpagesize() ;
#endif
#ifdef _WIN32
#include <Strsafe.h>
#endif
//======================================================================
// Assumptions
//======================================================================
@@ -752,10 +757,16 @@ retry:
goto retry;
// if nothing helps, make error message and raise exception
const int BUFSIZE=1024;
char message[BUFSIZE];
if ( FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, 0, GetLastError(), 0, message, BUFSIZE-1, 0) <=0 )
strcpy (message, "Standard_MMgrOpt::AllocMemory() failed to mmap");
Standard_OutOfMemory::Raise (message);
wchar_t message[BUFSIZE];
if ( FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM, 0, GetLastError(), 0,
message, BUFSIZE-1, 0) <=0 )
StringCchCopyW(message, _countof(message), L"Standard_MMgrOpt::AllocMemory() failed to mmap");
char messageA[BUFSIZE];
WideCharToMultiByte(CP_UTF8, 0, message, -1, messageA, sizeof(messageA), NULL, NULL);
Standard_OutOfMemory::Raise(messageA);
}
// record map handle in the beginning

View File

@@ -169,4 +169,13 @@
# endif // __Standard_DLL
# endif // __Standard_API
#endif
// Support of Universal Windows Platform
#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP
#define OCCT_UWP
#else
#ifdef OCCT_UWP
#undef OCCT_UWP
#endif
#endif
#endif