ifreerdp: fix iOS/OSX platform detection

This commit is contained in:
Marc-André Moreau 2013-12-03 15:19:58 -05:00
parent 8f310980ca
commit cea8c08328
4 changed files with 22 additions and 9 deletions

View File

@ -6,3 +6,5 @@ bin/
build/
project.pbxproj
!iFreeRDP.xcodeproj/
iFreeRDP.app/

View File

@ -154,19 +154,28 @@
/* GNU/Linux (__gnu_linux__) */
/* Mac OS X (__MACOSX__) */
/* Apple Platforms (iOS, Mac OS X) */
#if (defined(__APPLE__) && defined(__MACH__))
#include <TargetConditionals.h>
#if (TARGET_OS_IPHONE == 1) || (TARGET_IPHONE_SIMULATOR == 1)
/* iOS (__IOS__) */
#ifndef __IOS__
#define __IOS__ 1
#endif
#elif (TARGET_OS_MAC == 1)
/* Mac OS X (__MACOSX__) */
#ifndef __MACOSX__
#define __MACOSX__ 1
#endif
#endif
/* iOS (__IOS__)*/
#if (defined(__APPLE__) && defined(TARGET_OS_IPHONE))
#ifndef __IOS__
#define __IOS__ 1
#endif
#endif

View File

@ -37,7 +37,9 @@
#include <unistd.h>
#endif
#ifdef __MACOSX__
#if defined(__IOS__)
#elif defined(__MACOSX__)
#include <crt_externs.h>
#define environ (*_NSGetEnviron())
#endif

View File

@ -84,7 +84,7 @@
#include <winpr/crt.h>
#include <winpr/platform.h>
#if defined(__MACOSX__) || \
#if defined(__MACOSX__) || defined(__IOS__) || \
defined(__FreeBSD__) || defined(__NetBSD__) || \
defined(__OpenBSD__) || defined(__DragonFly__)
#include <sys/sysctl.h>