Commit ee012c8a933b6283872a6dd799b955b769986a40

Authored by Stéphane Raimbault
1 parent 8d9d2f23

Fix MaxOS X support

modbus/modbus.c
@@ -50,9 +50,9 @@ @@ -50,9 +50,9 @@
50 50
51 #include "modbus.h" 51 #include "modbus.h"
52 52
53 -#ifdef SYS_PLATFORM_DARWIN 53 +#ifdef __APPLE_CC__
54 #include <netdb.h> 54 #include <netdb.h>
55 - #define SOL_CTP getprotobyname("TCP")->p_proto 55 + #define SOL_TCP getprotobyname("TCP")->p_proto
56 #endif 56 #endif
57 57
58 #define UNKNOWN_ERROR_MSG "Not defined in modbus specification" 58 #define UNKNOWN_ERROR_MSG "Not defined in modbus specification"
modbus/modbus.h
@@ -120,7 +120,7 @@ typedef struct { @@ -120,7 +120,7 @@ typedef struct {
120 was bigger than 19 bytes. Making it 67 bytes for now, but 120 was bigger than 19 bytes. Making it 67 bytes for now, but
121 OS X does support 256 byte file names. May become a problem 121 OS X does support 256 byte file names. May become a problem
122 in the future. */ 122 in the future. */
123 -#ifdef SYS_PLATFORM_DARWIN 123 +#ifdef __APPLE_CC__
124 char device[67]; 124 char device[67];
125 #else 125 #else
126 char device[19]; 126 char device[19];
@@ -45,12 +45,6 @@ def configure(conf): @@ -45,12 +45,6 @@ def configure(conf):
45 conf.define('VERSION', VERSION) 45 conf.define('VERSION', VERSION)
46 conf.define('PACKAGE', 'libmodbus') 46 conf.define('PACKAGE', 'libmodbus')
47 47
48 - import sys  
49 - if sys.platform[:6] == 'darwin':  
50 - print "Darwin platform detected"  
51 - conf.env.append_value('CCFLAGS', '-DPLATFORM_DARWIN')  
52 - conf.define('PLATFORM_DARWIN', '1')  
53 -  
54 conf.write_config_header() 48 conf.write_config_header()
55 49
56 def build(bld): 50 def build(bld):