Browse Source

misc: Change BUILD_IPHONE define to IS_IOS.

Also, some code needed additional differentiation between macOS and iOS, since __APPLE__ doesn't necessarily imply macOS anymore.
Donny Lawrence 6 years ago
parent
commit
9afbd59d55

+ 1 - 1
direct/src/showbase/showBase.cxx

@@ -11,7 +11,7 @@
  * @date 2000-02-02
  */
 
-#ifdef __APPLE__
+#ifdef IS_OSX
 // We have to include this before we include any Panda libraries, because one
 // of the things we pick up in Panda defines a macro for TCP_NODELAY and
 // friends, causing heartaches for the header files picked up here.

+ 1 - 1
dtool/src/dtoolbase/dtool_platform.h

@@ -31,7 +31,7 @@
 #define DTOOL_PLATFORM "win_i386"
 
 #elif defined(__APPLE__)
-#if defined(BUILD_IPHONE)
+#if defined(IS_IOS)
 #define DTOOL_PLATFORM "iphone"
 #elif defined(__ppc__)
 #define DTOOL_PLATFORM "osx_ppc"

+ 1 - 1
dtool/src/dtoolutil/executionEnvironment.cxx

@@ -43,7 +43,7 @@ using std::string;
 #ifdef __APPLE__
 // This is for _NSGetExecutablePath() and _NSGetEnviron().
 #include <mach-o/dyld.h>
-#ifndef BUILD_IPHONE
+#ifndef IS_IOS
 #include <crt_externs.h>  // For some reason, not in the IPhone SDK.
 #endif
 #define environ (*_NSGetEnviron())

+ 4 - 4
dtool/src/dtoolutil/filename_assist.mm

@@ -18,7 +18,7 @@
 #include <strings.h>
 #include <Foundation/Foundation.h>
 
-#ifndef BUILD_IPHONE
+#ifndef IS_IOS
 #include <AppKit/AppKit.h>
 #endif
 
@@ -46,7 +46,7 @@ call_NSSearchPathForDirectories(NSSearchPathDirectory dirkey, NSSearchPathDomain
   // Ensure that Carbon has been initialized, and that we have an auto-release
   // pool.  Unfortunately, this very important function doesn't exist on the
   // IPhone.
-#ifndef BUILD_IPHONE
+#ifndef IS_IOS
   NSApplicationLoad();
 #endif
 
@@ -67,7 +67,7 @@ call_NSSearchPathForDirectories(NSSearchPathDirectory dirkey, NSSearchPathDomain
  */
 string
 get_osx_home_directory() {
-#ifndef BUILD_IPHONE
+#ifndef IS_IOS
   NSApplicationLoad();
 #endif
 
@@ -85,7 +85,7 @@ get_osx_home_directory() {
  */
 string
 get_osx_temp_directory() {
-#ifndef BUILD_IPHONE
+#ifndef IS_IOS
   NSApplicationLoad();
 #endif
 

+ 3 - 3
dtool/src/prc/notify.cxx

@@ -21,7 +21,7 @@
 
 #include <ctype.h>
 
-#ifdef BUILD_IPHONE
+#ifdef IS_IOS
 #include <fcntl.h>
 #endif
 
@@ -445,7 +445,7 @@ config_initialized() {
       } else {
         Filename filename = notify_output;
         filename.set_text();
-#ifdef BUILD_IPHONE
+#ifdef IS_IOS
         // On the iPhone, route everything through cerr, and then send cerr to
         // the log file, since we can't get the cerr output otherwise.
         string os_specific = filename.to_os_specific();
@@ -468,7 +468,7 @@ config_initialized() {
           out->setf(std::ios::unitbuf);
           set_ostream_ptr(out, true);
         }
-#endif  // BUILD_IPHONE
+#endif  // IS_IOS
       }
     }
   }

+ 1 - 1
panda/src/device/inputDeviceManager.cxx

@@ -38,7 +38,7 @@ make_global_ptr() {
 
 #ifdef _WIN32
   _global_ptr = new WinInputDeviceManager;
-#elif defined(__APPLE__)
+#elif defined(IS_OSX)
   _global_ptr = new IOKitInputDeviceManager;
 #elif defined(PHAVE_LINUX_INPUT_H)
   _global_ptr = new LinuxInputDeviceManager;

+ 2 - 2
panda/src/device/ioKitInputDevice.cxx

@@ -13,7 +13,7 @@
 
 #include "ioKitInputDevice.h"
 
-#if defined(__APPLE__) && !defined(CPPPARSER)
+#if defined(IS_OSX) && !defined(CPPPARSER)
 
 #include <IOKit/hid/IOHIDElement.h>
 
@@ -798,4 +798,4 @@ do_poll() {
   }
 }
 
-#endif  // __APPLE__
+#endif  // IS_OSX

+ 2 - 2
panda/src/device/ioKitInputDevice.h

@@ -17,7 +17,7 @@
 #include "pandabase.h"
 #include "inputDevice.h"
 
-#if defined(__APPLE__) && !defined(CPPPARSER)
+#if defined(IS_OSX) && !defined(CPPPARSER)
 
 #include <IOKit/hid/IOHIDDevice.h>
 
@@ -50,6 +50,6 @@ private:
   uint64_t _scroll_wheel_timestamp;
 };
 
-#endif  // __APPLE__
+#endif  // IS_OSX
 
 #endif

+ 1 - 1
panda/src/device/ioKitInputDeviceManager.cxx

@@ -14,7 +14,7 @@
 #include "ioKitInputDeviceManager.h"
 #include "ioKitInputDevice.h"
 
-#if defined(__APPLE__) && !defined(CPPPARSER)
+#if defined(IS_OSX) && !defined(CPPPARSER)
 
 /**
  * Initializes the input device manager by scanning which devices are currently

+ 1 - 1
panda/src/device/ioKitInputDeviceManager.h

@@ -16,7 +16,7 @@
 
 #include "inputDeviceManager.h"
 
-#if defined(__APPLE__) && !defined(CPPPARSER)
+#if defined(IS_OSX) && !defined(CPPPARSER)
 #include <IOKit/hid/IOHIDManager.h>
 
 /**

+ 1 - 1
panda/src/gles2gsg/gles2gsg.h

@@ -51,7 +51,7 @@
 // OpenGL ES 2 has no fixed-function pipeline.
 #undef SUPPORT_FIXED_FUNCTION
 
-#ifdef BUILD_IPHONE
+#ifdef IS_IOS
   #include <OpenGLES/ES2/gl.h>
 // #include <OpenGLESES2glext.h>
 #else

+ 1 - 1
panda/src/glesgsg/glesgsg.h

@@ -54,7 +54,7 @@
 #define __glext_h_
 #define ES1_GLEXT_H_GUARD
 
-#ifdef BUILD_IPHONE
+#ifdef IS_IOS
   #include <OpenGLES/ES1/gl.h>
 // #include <OpenGLESES1glext.h>
 #else

+ 1 - 1
panda/src/glstuff/CMakeLists.txt

@@ -1,4 +1,4 @@
-if(NOT HAVE_GL)
+if(NOT HAVE_GL AND NOT HAVE_GLES AND NOT HAVE_GLES2)
   return()
 endif()
 

+ 1 - 1
panda/src/nativenet/socket_portable.h

@@ -215,7 +215,7 @@ const int LOCAL_CONNECT_BLOCKING = EINPROGRESS;
 * LINUX and FreeBSD STUFF
 ************************************************************************/
 
-#elif defined(IS_LINUX) || defined(IS_OSX) || defined(IS_FREEBSD)
+#elif defined(IS_LINUX) || defined(IS_OSX) || defined(IS_FREEBSD) || defined(IS_IOS)
 
 #include <sys/types.h>
 #include <sys/time.h>