mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
Macros PR_BEGIN_EXTERN_C and PR_END_EXTERN_C were not defined in all contexts. Remove definition and replace with explicit expansion. From Stefan Kolb
This commit is contained in:
parent
84dbf4ee7c
commit
71d944a5d0
12 changed files with 38 additions and 27 deletions
|
|
@ -1425,4 +1425,6 @@
|
|||
first path was not being freed. From Bruno Herrera (2015-08-26).
|
||||
* apps/examples/netloop: Add a test of the local loopback device
|
||||
(2015-09-02).
|
||||
|
||||
* apps/modbus and apps/include/modbus: Macros PR_BEGIN_EXTERN_C and
|
||||
PR_END_EXTERN_C were not defined in all contexts. Replace with
|
||||
explicit expansion in all cases. From Stefan Kolb (2015-09-03).
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@
|
|||
#include <termios.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_BEGIN_EXTERN_C
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "mbport.h"
|
||||
|
|
@ -431,6 +432,6 @@ eMBErrorCode eMBRegDiscreteCB(uint8_t *pucRegBuffer, uint16_t usAddress,
|
|||
uint16_t usNDiscrete);
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_END_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -67,7 +67,8 @@
|
|||
#include <termios.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_BEGIN_EXTERN_C
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "mbport.h"
|
||||
|
|
@ -459,7 +460,7 @@ void vMBMasterSetErrorType(eMBMasterErrorEventType errorType);
|
|||
eMBMasterReqErrCode eMBMasterWaitRequestFinish(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_END_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPS_INCLUDE_MODBUS_MB_M_H */
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@
|
|||
#define __APPS_INCLUDE_MODBUS_MBFRAME_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_BEGIN_EXTERN_C
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -84,7 +85,7 @@ typedef eMBErrorCode (*peMBFrameSend)(uint8_t slaveAddress,
|
|||
typedef void (*pvMBFrameClose)(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_END_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPS_INCLUDE_MODBUS_MBFRAME_H */
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@
|
|||
#define __APPS_INCLUDE_MODBUS_MBFUNC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_BEGIN_EXTERN_C
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -81,7 +82,7 @@ eMBException eMBFuncReadWriteMultipleHoldingRegister(uint8_t *pucFrame, uint16_t
|
|||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_END_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPS_INCLUDE_MODBUS_MBFUNC_H */
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_BEGIN_EXTERN_C
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
|
|
@ -185,7 +186,7 @@ bool xMBTCPPortSendResponse(const uint8_t *pucMBTCPFrame, uint16_t usTCPLength);
|
|||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_END_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPS_INCLUDE_MODBUS_MBPORT_H */
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@
|
|||
#define __APPS_INCLUDE_MODBUS_MBPROTO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_BEGIN_EXTERN_C
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -87,7 +88,7 @@ typedef struct
|
|||
} xMBFunctionHandler;
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_END_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPS_INCLUDE_MODBUS_MBPROTO_H */
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@
|
|||
#define __APPS_INCLUDE_MODBUS_MBUTILS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_BEGIN_EXTERN_C
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -104,7 +105,7 @@ void xMBUtilSetBits(uint8_t *ucByteBuf, uint16_t usBitOffset,
|
|||
uint8_t xMBUtilGetBits(uint8_t *ucByteBuf, uint16_t usBitOffset, uint8_t ucNBits);
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_END_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPS_INCLUDE_MODBUS_MBUTILS_H */
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@
|
|||
#define __APPS_MODBUS_ASCII_MBASCII_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_BEGIN_EXTERN_C
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -55,7 +56,7 @@ bool xMBASCIITimerT1SExpired(void);
|
|||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_END_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPS_MODBUS_ASCII_MBASCII_H */
|
||||
|
|
|
|||
|
|
@ -44,14 +44,13 @@
|
|||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define INLINE
|
||||
#define PR_BEGIN_EXTERN_C extern "C" {
|
||||
#define PR_END_EXTERN_C }
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_BEGIN_EXTERN_C
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#define INLINE
|
||||
|
||||
#define ENTER_CRITICAL_SECTION( ) vMBPortEnterCritical()
|
||||
#define EXIT_CRITICAL_SECTION( ) vMBPortExitCritical()
|
||||
|
||||
|
|
@ -88,7 +87,7 @@ bool xMBPortSerialPoll(void);
|
|||
bool xMBPortSerialSetTimeout(uint32_t dwTimeoutMs);
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_END_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPS_MODBUS_NUTTX_PORT_H */
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@
|
|||
#define __APPS_MODBUS_RTU_MBRTU_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_BEGIN_EXTERN_C
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -68,7 +69,7 @@ bool xMBMasterRTUTimerExpired(void);
|
|||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_END_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPS_MODBUS_RTU_MBRTU_H */
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@
|
|||
#define __APPS_MODBUS_TCP_MBTCP_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_BEGIN_EXTERN_C
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -55,7 +56,7 @@ eMBErrorCode eMBTCPSend(uint8_t _unused, const uint8_t *pucFrame,
|
|||
uint16_t usLength);
|
||||
|
||||
#ifdef __cplusplus
|
||||
PR_END_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPS_MODBUS_TCP_MBTCP_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue