|
1 | 1 | /*=============================================================================| |
2 | | -| PROJECT SNAP7 1.1.0 | |
| 2 | +| PROJECT SNAP7 1.2.0 | |
3 | 3 | |==============================================================================| |
4 | | -| Copyright (C) 2013, Davide Nardella | |
| 4 | +| Copyright (C) 2013, 2014 Davide Nardella | |
5 | 5 | | All rights reserved. | |
6 | 6 | |==============================================================================| |
7 | 7 | | SNAP7 is free software: you can redistribute it and/or modify | |
|
10 | 10 | | (at your option) any later version. | |
11 | 11 | | | |
12 | 12 | | It means that you can distribute your commercial software linked with | |
13 | | -| SMART7 without the requirement to distribute the source code of your | |
| 13 | +| SNAP7 without the requirement to distribute the source code of your | |
14 | 14 | | application and without the requirement that your application be itself | |
15 | 15 | | distributed under LGPL. | |
16 | 16 | | | |
|
53 | 53 | # define OS_BSD |
54 | 54 | #endif |
55 | 55 |
|
56 | | -#if defined(PLATFORM_UNIX) |
| 56 | +#if defined(__APPLE__) |
| 57 | +# define OS_OSX |
| 58 | +#endif |
| 59 | + |
| 60 | +#if defined(PLATFORM_UNIX) || defined(OS_OSX) |
57 | 61 | # include <unistd.h> |
58 | 62 | # if defined(_POSIX_VERSION) |
59 | 63 | # define POSIX |
@@ -96,12 +100,34 @@ extern "C" { |
96 | 100 | // C exact length types |
97 | 101 | //--------------------------------------------------------------------------- |
98 | 102 | #ifndef __cplusplus |
99 | | -typedef unsigned char uint8_t; // 8 bit unsigned integer |
100 | | -typedef unsigned short uint16_t; // 16 bit unsigned integer |
101 | | -typedef unsigned int uint32_t; // 32 bit unsigned integer |
102 | | -#if !defined(_UINTPTR_T_DEFINED) && !defined(OS_SOLARIS) && !defined(OS_BSD) |
| 103 | + |
| 104 | +#ifdef OS_BSD |
| 105 | +# include <stdint.h> |
| 106 | +# include <time.h> |
| 107 | +#endif |
| 108 | + |
| 109 | +#ifdef OS_OSX |
| 110 | +# include <stdint.h> |
| 111 | +# include <time.h> |
| 112 | +#endif |
| 113 | + |
| 114 | +#ifdef OS_SOLARIS |
| 115 | +# include <stdint.h> |
| 116 | +# include <time.h> |
| 117 | +#endif |
| 118 | + |
| 119 | +#if defined(_UINTPTR_T_DEFINED) |
| 120 | +# include <stdint.h> |
| 121 | +# include <time.h> |
| 122 | +#endif |
| 123 | + |
| 124 | +#if !defined(_UINTPTR_T_DEFINED) && !defined(OS_SOLARIS) && !defined(OS_BSD) && !defined(OS_OSX) |
| 125 | + typedef unsigned char uint8_t; // 8 bit unsigned integer |
| 126 | + typedef unsigned short uint16_t; // 16 bit unsigned integer |
| 127 | + typedef unsigned int uint32_t; // 32 bit unsigned integer |
103 | 128 | typedef unsigned long uintptr_t;// 64 bit unsigned integer |
104 | 129 | #endif |
| 130 | + |
105 | 131 | #endif |
106 | 132 |
|
107 | 133 | #ifdef OS_WINDOWS |
@@ -831,13 +857,13 @@ class TS7Server |
831 | 857 | int Stop(); |
832 | 858 | int GetParam(int ParamNumber, void *pValue); |
833 | 859 | int SetParam(int ParamNumber, void *pValue); |
834 | | - // Events |
835 | | - int SetEventsCallback(pfn_SrvCallBack PCallBack, void *UsrPtr); |
836 | | - int SetReadEventsCallback(pfn_SrvCallBack PCallBack, void *UsrPtr); |
837 | | - bool PickEvent(TSrvEvent *pEvent); |
838 | | - void ClearEvents(); |
| 860 | + // Events |
| 861 | + int SetEventsCallback(pfn_SrvCallBack PCallBack, void *UsrPtr); |
| 862 | + int SetReadEventsCallback(pfn_SrvCallBack PCallBack, void *UsrPtr); |
| 863 | + bool PickEvent(TSrvEvent *pEvent); |
| 864 | + void ClearEvents(); |
839 | 865 | longword GetEventsMask(); |
840 | | - longword GetLogMask(); |
| 866 | + longword GetLogMask(); |
841 | 867 | void SetEventsMask(longword Mask); |
842 | 868 | void SetLogMask(longword Mask); |
843 | 869 | // Resources |
|
0 commit comments