Browse Source

Fix MaxOS X support

Stéphane Raimbault 17 năm trước cách đây
mục cha
commit
ee012c8a93
3 tập tin đã thay đổi với 3 bổ sung9 xóa
  1. 2 2
      modbus/modbus.c
  2. 1 1
      modbus/modbus.h
  3. 0 6
      wscript

+ 2 - 2
modbus/modbus.c

@@ -50,9 +50,9 @@
 
 #include "modbus.h"
 
-#ifdef SYS_PLATFORM_DARWIN
+#ifdef __APPLE_CC__
     #include <netdb.h>
-    #define SOL_CTP getprotobyname("TCP")->p_proto
+    #define SOL_TCP getprotobyname("TCP")->p_proto
 #endif
 
 #define UNKNOWN_ERROR_MSG "Not defined in modbus specification"

+ 1 - 1
modbus/modbus.h

@@ -120,7 +120,7 @@ typedef struct {
            was bigger than 19 bytes. Making it 67 bytes for now, but
            OS X does support 256 byte file names. May become a problem
            in the future. */
-#ifdef SYS_PLATFORM_DARWIN
+#ifdef __APPLE_CC__
         char device[67];
 #else
         char device[19];

+ 0 - 6
wscript

@@ -45,12 +45,6 @@ def configure(conf):
      conf.define('VERSION', VERSION)
      conf.define('PACKAGE', 'libmodbus')
 
-     import sys
-     if sys.platform[:6] == 'darwin':
-          print "Darwin platform detected"
-          conf.env.append_value('CCFLAGS', '-DPLATFORM_DARWIN')
-          conf.define('PLATFORM_DARWIN', '1')
-
      conf.write_config_header()
 
 def build(bld):