mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Try to define ZT_NO_TYPE_PUNNING on iOS in case it wasn't.
This commit is contained in:
parent
284e5d83b5
commit
8035afae87
1 changed files with 13 additions and 14 deletions
|
@ -51,8 +51,19 @@
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Disable type punning on ARM architecture -- some ARM chips throw SIGBUS on unaligned access
|
#ifdef __APPLE__
|
||||||
#if defined(__arm__) || defined(__ARMEL__)
|
#include <TargetConditionals.h>
|
||||||
|
#ifndef __UNIX_LIKE__
|
||||||
|
#define __UNIX_LIKE__
|
||||||
|
#endif
|
||||||
|
#ifndef __BSD__
|
||||||
|
#define __BSD__
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Defined this macro to disable "type punning" on a number of targets that
|
||||||
|
// have issues with unaligned memory access.
|
||||||
|
#if defined(__arm__) || defined(__ARMEL__) || (defined(__APPLE__) && ( (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE != 0)) || (defined(TARGET_OS_WATCH) && (TARGET_OS_WATCH != 0)) || (defined(TARGET_IPHONE_SIMULATOR) && (TARGET_IPHONE_SIMULATOR != 0)) ) )
|
||||||
#ifndef ZT_NO_TYPE_PUNNING
|
#ifndef ZT_NO_TYPE_PUNNING
|
||||||
#define ZT_NO_TYPE_PUNNING
|
#define ZT_NO_TYPE_PUNNING
|
||||||
#endif
|
#endif
|
||||||
|
@ -73,18 +84,6 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: Android is what? Linux technically, but does it define it?
|
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
#include <TargetConditionals.h>
|
|
||||||
#ifndef __UNIX_LIKE__
|
|
||||||
#define __UNIX_LIKE__
|
|
||||||
#endif
|
|
||||||
#ifndef __BSD__
|
|
||||||
#define __BSD__
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
#ifndef __WINDOWS__
|
#ifndef __WINDOWS__
|
||||||
#define __WINDOWS__
|
#define __WINDOWS__
|
||||||
|
|
Loading…
Add table
Reference in a new issue