mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[winpr,spec] fix windows compatibility
define NONAMELESSUNION to have the same struct definitions under windows as we have under linux.
This commit is contained in:
@@ -140,6 +140,9 @@ endif()
|
|||||||
|
|
||||||
message(STATUS "Git Revision ${GIT_REVISION}")
|
message(STATUS "Git Revision ${GIT_REVISION}")
|
||||||
|
|
||||||
|
# MSVC compatibility with system headers
|
||||||
|
add_definitions(-DNONAMELESSUNION)
|
||||||
|
|
||||||
# Make the detected version available as default version for all subprojects
|
# Make the detected version available as default version for all subprojects
|
||||||
set(FREERDP_DEFAULT_PROJECT_VERSION ${FREERDP_VERSION} CACHE STRING INTERNAL)
|
set(FREERDP_DEFAULT_PROJECT_VERSION ${FREERDP_VERSION} CACHE STRING INTERNAL)
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,9 @@ if(NOT FREERDP_UNIFIED_BUILD)
|
|||||||
else()
|
else()
|
||||||
set(DEFAULT_DEBUG_OPTION "OFF" CACHE INTERNAL "debug default")
|
set(DEFAULT_DEBUG_OPTION "OFF" CACHE INTERNAL "debug default")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# MSVC compatibility with system headers
|
||||||
|
add_definitions(-DNONAMELESSUNION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32 AND NOT UWP)
|
if(WIN32 AND NOT UWP)
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#if defined(NONAMELESSUNION)
|
||||||
#define DUMMYUNIONNAME u
|
#define DUMMYUNIONNAME u
|
||||||
#define DUMMYUNIONNAME1 u1
|
#define DUMMYUNIONNAME1 u1
|
||||||
#define DUMMYUNIONNAME2 u2
|
#define DUMMYUNIONNAME2 u2
|
||||||
@@ -51,6 +52,24 @@ WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
|
|||||||
#define DUMMYSTRUCTNAME3 s3
|
#define DUMMYSTRUCTNAME3 s3
|
||||||
#define DUMMYSTRUCTNAME4 s4
|
#define DUMMYSTRUCTNAME4 s4
|
||||||
#define DUMMYSTRUCTNAME5 s5
|
#define DUMMYSTRUCTNAME5 s5
|
||||||
|
#else
|
||||||
|
#define DUMMYUNIONNAME
|
||||||
|
#define DUMMYUNIONNAME1
|
||||||
|
#define DUMMYUNIONNAME2
|
||||||
|
#define DUMMYUNIONNAME3
|
||||||
|
#define DUMMYUNIONNAME4
|
||||||
|
#define DUMMYUNIONNAME5
|
||||||
|
#define DUMMYUNIONNAME6
|
||||||
|
#define DUMMYUNIONNAME7
|
||||||
|
#define DUMMYUNIONNAME8
|
||||||
|
|
||||||
|
#define DUMMYSTRUCTNAME
|
||||||
|
#define DUMMYSTRUCTNAME1
|
||||||
|
#define DUMMYSTRUCTNAME2
|
||||||
|
#define DUMMYSTRUCTNAME3
|
||||||
|
#define DUMMYSTRUCTNAME4
|
||||||
|
#define DUMMYSTRUCTNAME5
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (defined(_M_AMD64) || defined(_M_ARM)) && !defined(_WIN32)
|
#if (defined(_M_AMD64) || defined(_M_ARM)) && !defined(_WIN32)
|
||||||
#define _UNALIGNED __unaligned
|
#define _UNALIGNED __unaligned
|
||||||
|
|||||||
@@ -11,15 +11,10 @@ int TestGetNativeSystemInfo(int argc, char* argv[])
|
|||||||
|
|
||||||
GetNativeSystemInfo(&sysinfo);
|
GetNativeSystemInfo(&sysinfo);
|
||||||
|
|
||||||
#if defined(DUMMYUNIONNAME) && defined(DUMMYSTRUCTNAME)
|
|
||||||
#define DUMMYXPTR(x) x.DUMMYUNIONNAME.DUMMYSTRUCTNAME
|
|
||||||
#else
|
|
||||||
#define DUMMYXPTR(x) x
|
|
||||||
#endif
|
|
||||||
|
|
||||||
printf("SystemInfo:\n");
|
printf("SystemInfo:\n");
|
||||||
printf("\twProcessorArchitecture: %" PRIu16 "\n", DUMMYXPTR(sysinfo).wProcessorArchitecture);
|
printf("\twProcessorArchitecture: %" PRIu16 "\n",
|
||||||
printf("\twReserved: %" PRIu16 "\n", DUMMYXPTR(sysinfo).wReserved);
|
sysinfo.DUMMYUNIONNAME.DUMMYSTRUCTNAME.wProcessorArchitecture);
|
||||||
|
printf("\twReserved: %" PRIu16 "\n", sysinfo.DUMMYUNIONNAME.DUMMYSTRUCTNAME.wReserved);
|
||||||
printf("\tdwPageSize: 0x%08" PRIX32 "\n", sysinfo.dwPageSize);
|
printf("\tdwPageSize: 0x%08" PRIX32 "\n", sysinfo.dwPageSize);
|
||||||
printf("\tlpMinimumApplicationAddress: %p\n", sysinfo.lpMinimumApplicationAddress);
|
printf("\tlpMinimumApplicationAddress: %p\n", sysinfo.lpMinimumApplicationAddress);
|
||||||
printf("\tlpMaximumApplicationAddress: %p\n", sysinfo.lpMaximumApplicationAddress);
|
printf("\tlpMaximumApplicationAddress: %p\n", sysinfo.lpMaximumApplicationAddress);
|
||||||
|
|||||||
Reference in New Issue
Block a user