RTU_ALL_AI/src/protocol/libmodbus/inc/config.h

54 lines
1.8 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 平台适配配置文件
*
* 替代 autotools 生成的 config.h提供跨平台编译所需的宏定义。
* 默认配置针对 Linux 平台,其他平台请根据实际情况修改以下宏定义。
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef MODBUS_CONFIG_H
#define MODBUS_CONFIG_H
/* ================================================================
* 版本信息(已硬编码,见 modbus-version.h
* 此处定义供源文件中 extern 声明使用
* ================================================================ */
#define LIBMODBUS_VERSION_MAJOR 3
#define LIBMODBUS_VERSION_MINOR 1
#define LIBMODBUS_VERSION_MICRO 12
/* ================================================================
* 平台功能检测开关
*
* 以下宏定义控制条件编译行为。默认启用 Linux 常见功能。
* 如果你的平台不支持某项功能,请注释掉对应的 #define。
* ================================================================ */
/* 是否提供 termios2 结构体Linux 4.x+ 支持,允许任意波特率) */
#define HAVE_STRUCT_TERMIOS2 1
/* 是否声明了 TIOCSRS485 ioctlLinux RS485 模式切换) */
#define HAVE_DECL_TIOCSRS485 1
/* 是否声明了 TIOCM_RTS ioctlLinux RTS 引脚控制) */
#define HAVE_DECL_TIOCM_RTS 1
/* 是否提供 strlcpy 函数OpenBSD/macOS 原生支持Linux 需自行实现) */
/* libmodbus 在 modbus.c 中提供了备用实现,因此这里通常不定义 */
/* #define HAVE_STRLCPY 1 */
/* 是否提供 <netinet/in.h> 头文件 */
#define HAVE_NETINET_IN_H 1
/* 是否提供 <netinet/ip.h> 头文件 */
#define HAVE_NETINET_IP_H 1
/* 是否提供 gai_strerror 函数(用于 getaddrinfo 错误信息) */
#define HAVE_GAI_STRERROR 1
/* 是否提供 accept4 系统调用Linux 2.6.28+ */
#define HAVE_ACCEPT4 1
#endif /* MODBUS_CONFIG_H */