[86] | 1 | /***************************************************************************/
|
---|
| 2 | /* */
|
---|
| 3 | /* Softing Automation GmbH Richard-Reitzner-Allee 6 85540 Haar */
|
---|
| 4 | /* */
|
---|
| 5 | /***************************************************************************/
|
---|
| 6 | /* */
|
---|
| 7 | /* Copyright (C) Softing Industrial Automation GmbH 1997-2012 */
|
---|
| 8 | /* */
|
---|
| 9 | /***************************************************************************/
|
---|
| 10 | /* */
|
---|
| 11 | /* C A N _ D E F . H */
|
---|
| 12 | /* */
|
---|
| 13 | /***************************************************************************/
|
---|
| 14 | /* */
|
---|
| 15 | /* PROJECT: CANLIB */
|
---|
| 16 | /* */
|
---|
| 17 | /* MODULE: CAN_DEF.H */
|
---|
| 18 | /* */
|
---|
| 19 | /* AUTHOR: Softing GmbH */
|
---|
| 20 | /* */
|
---|
| 21 | /* MODULE_DESCRIPTION definitions for CAN-LAYER2 LIB */
|
---|
| 22 | /* CANcard and CAN-AC2 */
|
---|
| 23 | /* */
|
---|
| 24 | /* USAGE description of the macro definitions */
|
---|
| 25 | /* */
|
---|
| 26 | /* Macro Description */
|
---|
| 27 | /* */
|
---|
| 28 | /* WIN16 define for building 16-bit windows (WIN3.11) */
|
---|
| 29 | /* applications */
|
---|
| 30 | /* */
|
---|
| 31 | /* WIN32 define for building 32-bit applications */
|
---|
| 32 | /* (WIN-NT 4.0 and WIN 95) */
|
---|
| 33 | /* */
|
---|
| 34 | /* DOS define for MSDOS applications. DOS is */
|
---|
| 35 | /* automatically defined, if neither WIN16 */
|
---|
| 36 | /* nor WIN32 is set. */
|
---|
| 37 | /* */
|
---|
| 38 | /* __cplusplus define for C++ applications (normally defined */
|
---|
| 39 | /* automatically by the compiler) */
|
---|
| 40 | /* */
|
---|
| 41 | /***************************************************************************/
|
---|
| 42 | /*
|
---|
| 43 | *
|
---|
| 44 | */
|
---|
| 45 |
|
---|
| 46 | #ifndef _CAN_DEF_H
|
---|
| 47 | #define _CAN_DEF_H
|
---|
| 48 |
|
---|
| 49 | /* remove comment lines for building a WIN3.11 application */
|
---|
| 50 | /* #define WIN16 */
|
---|
| 51 | /* remove comment lines for building a WIN-NT4.0 or WIN95 application */
|
---|
| 52 | /* #define WIN32 */
|
---|
| 53 | /* remove comment lines for building a MS-DOS application */
|
---|
| 54 | /* #define DOS */
|
---|
| 55 |
|
---|
| 56 | /* compatibility with borland */
|
---|
| 57 | #ifdef __WIN32__
|
---|
| 58 | #ifndef WIN32
|
---|
| 59 | #define WIN32
|
---|
| 60 | #endif
|
---|
| 61 | #endif
|
---|
| 62 |
|
---|
| 63 | /* compatibility with borland */
|
---|
| 64 | #if defined (__MSDOS__) || defined (_DOS)
|
---|
| 65 | #ifndef DOS
|
---|
| 66 | #define DOS
|
---|
| 67 | #endif
|
---|
| 68 | #endif
|
---|
| 69 |
|
---|
| 70 |
|
---|
| 71 | #if !(defined (WIN16) || defined (WIN32))
|
---|
| 72 | /* default setting is DOS */
|
---|
| 73 | #ifndef DOS
|
---|
| 74 | #define DOS
|
---|
| 75 | #endif
|
---|
| 76 | #endif
|
---|
| 77 |
|
---|
| 78 | /* check macro definitions */
|
---|
| 79 | #ifdef DOS
|
---|
| 80 | #if defined(WIN16) || defined (WIN32)
|
---|
| 81 | #error only one macro definition (DOS or WIN16 or WIN32) allowed
|
---|
| 82 | #endif
|
---|
| 83 | #endif
|
---|
| 84 |
|
---|
| 85 | #ifdef WIN16
|
---|
| 86 | #if defined(DOS) || defined (WIN32)
|
---|
| 87 | #error only one macro definition (DOS or WIN16 or WIN32) allowed
|
---|
| 88 | #endif
|
---|
| 89 | #endif
|
---|
| 90 |
|
---|
| 91 | #ifdef WIN32
|
---|
| 92 | #if defined(WIN16) || defined (DOS)
|
---|
| 93 | #error only one macro definition (DOS or WIN16 or WIN32) allowed
|
---|
| 94 | #endif
|
---|
| 95 | #endif
|
---|
| 96 |
|
---|
| 97 | /* set the switch DOS, if a MS-DOS application is build */
|
---|
| 98 | #ifdef DOS
|
---|
| 99 |
|
---|
| 100 | #ifdef F_M /* far memory model */
|
---|
| 101 | #ifndef FAR
|
---|
| 102 | #define FAR far
|
---|
| 103 | #endif
|
---|
| 104 | #else /* F_M */
|
---|
| 105 | #ifndef FAR
|
---|
| 106 | #define FAR
|
---|
| 107 | #endif
|
---|
| 108 | #endif/* F_M */
|
---|
| 109 |
|
---|
| 110 | #ifdef __cplusplus
|
---|
| 111 | #ifndef PRAEDEF
|
---|
| 112 | #define PRAEDEF extern "C"
|
---|
| 113 | #endif
|
---|
| 114 | #ifndef PRAEDECL
|
---|
| 115 | #define PRAEDECL extern "C"
|
---|
| 116 | #endif
|
---|
| 117 | #else /* cplusplus */
|
---|
| 118 | #ifndef PRAEDEF
|
---|
| 119 | #define PRAEDEF
|
---|
| 120 | #endif
|
---|
| 121 | #ifndef PRAEDECL
|
---|
| 122 | #define PRAEDECL
|
---|
| 123 | #endif
|
---|
| 124 | #endif
|
---|
| 125 |
|
---|
| 126 |
|
---|
| 127 | #ifndef PRAEDECL
|
---|
| 128 | #define PRAEDECL
|
---|
| 129 | #endif
|
---|
| 130 |
|
---|
| 131 | #ifndef MIDDECL
|
---|
| 132 | #define MIDDECL
|
---|
| 133 | #endif
|
---|
| 134 |
|
---|
| 135 | #ifndef MIDDEF
|
---|
| 136 | #define MIDDEF
|
---|
| 137 | #endif
|
---|
| 138 |
|
---|
| 139 | typedef int BOOL;
|
---|
| 140 | #define FALSE 0
|
---|
| 141 | #define TRUE 1
|
---|
| 142 | typedef unsigned char BYTE;
|
---|
| 143 | typedef unsigned short WORD;
|
---|
| 144 | typedef unsigned long DWORD;
|
---|
| 145 | typedef unsigned int UINT;
|
---|
| 146 | #ifndef NULL
|
---|
| 147 | #define NULL 0
|
---|
| 148 | #endif
|
---|
| 149 |
|
---|
| 150 | typedef char FAR* LPSTR;
|
---|
| 151 | typedef const char FAR* LPCSTR;
|
---|
| 152 | typedef BYTE FAR* LPBYTE;
|
---|
| 153 | typedef int FAR* LPINT;
|
---|
| 154 | typedef WORD FAR* LPWORD;
|
---|
| 155 | typedef long FAR* LPLONG;
|
---|
| 156 | typedef DWORD FAR* LPDWORD;
|
---|
| 157 | typedef void FAR* LPVOID;
|
---|
| 158 | #endif /* _DOS */
|
---|
| 159 |
|
---|
| 160 |
|
---|
| 161 |
|
---|
| 162 | /* set the switch WIN32, if a Windows 95 or a Windows NT application is build */
|
---|
| 163 | #ifdef WIN32
|
---|
| 164 |
|
---|
| 165 |
|
---|
| 166 | // export / import definition for the API functions
|
---|
| 167 | #ifdef SFCAN_INTERFACE_EXPORTS
|
---|
| 168 | #define SFCAN_INTERFACE __declspec(dllexport)
|
---|
| 169 | #else // SFCAN_INTERFACE_EXPORTS
|
---|
| 170 | #define SFCAN_INTERFACE __declspec(dllimport)
|
---|
| 171 | #endif // else SFCAN_INTERFACE_EXPORTS
|
---|
| 172 |
|
---|
| 173 |
|
---|
| 174 | #ifdef EMU
|
---|
| 175 |
|
---|
| 176 | #ifdef __cplusplus
|
---|
| 177 | #define PRAEDEF extern "C"
|
---|
| 178 | #define PRAEDECL extern "C"
|
---|
| 179 | #else
|
---|
| 180 | #define PRAEDEF
|
---|
| 181 | #define PRAEDECL
|
---|
| 182 | #endif
|
---|
| 183 |
|
---|
| 184 | #define MIDDECL pascal
|
---|
| 185 | #define MIDDEF pascal
|
---|
| 186 |
|
---|
| 187 | #else // EMU
|
---|
| 188 |
|
---|
| 189 | #ifdef __cplusplus
|
---|
| 190 | #define PRAEDEF extern "C" SFCAN_INTERFACE
|
---|
| 191 | #define PRAEDECL extern "C" SFCAN_INTERFACE
|
---|
| 192 | #else
|
---|
| 193 | #define PRAEDEF SFCAN_INTERFACE
|
---|
| 194 | #define PRAEDECL SFCAN_INTERFACE
|
---|
| 195 | #endif
|
---|
| 196 |
|
---|
| 197 | #define MIDDECL __stdcall
|
---|
| 198 | #define MIDDEF __stdcall
|
---|
| 199 |
|
---|
| 200 | #endif // EMU
|
---|
| 201 |
|
---|
| 202 |
|
---|
| 203 | #ifndef FAR
|
---|
| 204 | #define FAR
|
---|
| 205 | #endif
|
---|
| 206 |
|
---|
| 207 | #ifndef PASCAL
|
---|
| 208 | #define PASCAL
|
---|
| 209 | #endif
|
---|
| 210 |
|
---|
| 211 |
|
---|
| 212 | #ifndef _export
|
---|
| 213 | #define _export
|
---|
| 214 | #endif
|
---|
| 215 |
|
---|
| 216 |
|
---|
| 217 |
|
---|
| 218 | #endif /* WIN32 */
|
---|
| 219 |
|
---|
| 220 | /* set the switch WIN16, if a Windows 3.11 application is build */
|
---|
| 221 | #ifdef WIN16
|
---|
| 222 |
|
---|
| 223 | #ifndef FAR
|
---|
| 224 | #define FAR far
|
---|
| 225 | #endif
|
---|
| 226 |
|
---|
| 227 | #ifdef __cplusplus
|
---|
| 228 | #define PRAEDEF extern "C"
|
---|
| 229 | #else
|
---|
| 230 | #define PRAEDEF
|
---|
| 231 | #endif
|
---|
| 232 | #define MIDDEF __export FAR PASCAL
|
---|
| 233 |
|
---|
| 234 | #ifdef __cplusplus
|
---|
| 235 | #define PRAEDECL extern "C"
|
---|
| 236 | #else
|
---|
| 237 | #define PRAEDECL
|
---|
| 238 | #endif
|
---|
| 239 | #define MIDDECL FAR PASCAL
|
---|
| 240 |
|
---|
| 241 | #endif /* WIN16 */
|
---|
| 242 | /*##############################################*/
|
---|
| 243 |
|
---|
| 244 | #endif /* _CAN_DEF_H */
|
---|
| 245 |
|
---|