mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
4d629be602
* Users can now use libbsd string.h and sys/cdefs.h functionality (e.g., strlcpy, containerof) on Linux by just including string.h or sys/cdefs.h. In other words, the includes are the same on the Linux target as well as on chips targets (ESP32, etc.). * libbsd linking is done by the linux component (belongs to common components) now instead of handling it separately in each component
62 lines
1.6 KiB
C
62 lines
1.6 KiB
C
/*
|
|
* SPDX-FileCopyrightText: 2001-2003 Swedish Institute of Computer Science
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*
|
|
* SPDX-FileContributor: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
|
*/
|
|
#ifndef LWIP_ARCH_CC_H
|
|
#define LWIP_ARCH_CC_H
|
|
|
|
/* see https://sourceforge.net/p/predef/wiki/OperatingSystems/ */
|
|
#if defined __ANDROID__
|
|
#define LWIP_UNIX_ANDROID
|
|
#elif defined __linux__
|
|
#define LWIP_UNIX_LINUX
|
|
#elif defined __APPLE__
|
|
#define LWIP_UNIX_MACH
|
|
#elif defined __OpenBSD__
|
|
#define LWIP_UNIX_OPENBSD
|
|
#elif defined __CYGWIN__
|
|
#define LWIP_UNIX_CYGWIN
|
|
#elif defined __GNU__
|
|
#define LWIP_UNIX_HURD
|
|
#endif
|
|
|
|
#define LWIP_TIMEVAL_PRIVATE 0
|
|
#include <sys/time.h>
|
|
#include <sys/cdefs.h>
|
|
|
|
#define LWIP_ERRNO_INCLUDE <errno.h>
|
|
|
|
#if defined(LWIP_UNIX_LINUX) || defined(LWIP_UNIX_HURD)
|
|
#define LWIP_ERRNO_STDINCLUDE 1
|
|
#endif
|
|
|
|
/* different handling for unit test, normally not needed */
|
|
#ifdef LWIP_NOASSERT_ON_ERROR
|
|
#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \
|
|
handler;}} while(0)
|
|
#endif
|
|
|
|
#if defined(LWIP_UNIX_ANDROID) && defined(FD_SET)
|
|
typedef __kernel_fd_set fd_set;
|
|
#endif
|
|
|
|
#if defined(LWIP_UNIX_MACH)
|
|
/* sys/types.h and signal.h bring in Darwin byte order macros. pull the
|
|
header here and disable LwIP's version so that apps still can get
|
|
the macros via LwIP headers and use system headers */
|
|
#include <sys/types.h>
|
|
#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
|
|
#endif
|
|
|
|
struct sio_status_s;
|
|
typedef struct sio_status_s sio_status_t;
|
|
#define sio_fd_t sio_status_t*
|
|
#define __sio_fd_t_defined
|
|
|
|
typedef unsigned int sys_prot_t;
|
|
|
|
#endif /* LWIP_ARCH_CC_H */
|