* Port to macOS This port to macOS is an amalgam of the existing Linux and Win32 ports. Consequently code is duplicated from each in this port: primarily from win32 in oshw, and Linux is osal. Synthesizing a shared common posix port, did not seem warranted given the modest amount of code, and stable api. This port uses the default pcap interface provided in the development libraries shipped with XCode. Limited testing on os releases: 10.13 and 10.14. * fix possible race condition as for win32 See aed0f81724e5a2d482491bd6e5e9932a83a42646 * fix spelling as for linux / win32 See 7beba91c6286900f07c8831afe1e1468b665815f
39 lines
649 B
C
39 lines
649 B
C
/*
|
|
* Licensed under the GNU General Public License version 2 with exceptions. See
|
|
* LICENSE file in the project root for full license information
|
|
*/
|
|
|
|
#ifndef _osal_defs_
|
|
#define _osal_defs_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
// define if debug printf is needed
|
|
//#define EC_DEBUG
|
|
|
|
#ifdef EC_DEBUG
|
|
#define EC_PRINT printf
|
|
#else
|
|
#define EC_PRINT(...) do {} while (0)
|
|
#endif
|
|
|
|
#ifndef PACKED
|
|
#define PACKED_BEGIN
|
|
#define PACKED __attribute__((__packed__))
|
|
#define PACKED_END
|
|
#endif
|
|
|
|
#include <pthread.h>
|
|
#define OSAL_THREAD_HANDLE pthread_t *
|
|
#define OSAL_THREAD_FUNC void
|
|
#define OSAL_THREAD_FUNC_RT void
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|