Skip to content

Commit 28e9723

Browse files
authored
Add c++ guards (#48)
* Add guards for C++ linkage
1 parent d35316b commit 28e9723

15 files changed

Lines changed: 178 additions & 1 deletion

modules/bg96/cellular_bg96.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#ifndef __CELLULAR_BG96_H__
22
#define __CELLULAR_BG96_H__
33

4+
/* *INDENT-OFF* */
5+
#ifdef __cplusplus
6+
extern "C" {
7+
#endif
8+
/* *INDENT-ON* */
9+
410
/* AT Command timeout for PDN activation */
511
#define PDN_ACTIVATION_PACKET_REQ_TIMEOUT_MS ( 150000UL )
612

@@ -66,4 +72,10 @@ extern uint32_t CellularSrcTokenSuccessTableSize;
6672
extern const char * CellularUrcTokenWoPrefixTable[];
6773
extern uint32_t CellularUrcTokenWoPrefixTableSize;
6874

75+
/* *INDENT-OFF* */
76+
#ifdef __cplusplus
77+
}
78+
#endif
79+
/* *INDENT-ON* */
80+
6981
#endif /* ifndef __CELLULAR_BG96_H__ */

modules/hl7802/cellular_hl7802.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
#ifndef __CELLULAR_HL7802_H__
2727
#define __CELLULAR_HL7802_H__
2828

29+
/* *INDENT-OFF* */
30+
#ifdef __cplusplus
31+
extern "C" {
32+
#endif
33+
/* *INDENT-ON* */
34+
2935
#define MIN_TCP_SESSION_ID ( 1U )
3036
#define MAX_TCP_SESSION_ID ( 6U )
3137
#define TCP_SESSION_TABLE_LEGNTH ( MAX_TCP_SESSION_ID + 1 )
@@ -94,4 +100,10 @@ extern uint32_t CellularSrcTokenSuccessTableSize;
94100
extern const char * CellularUrcTokenWoPrefixTable[];
95101
extern uint32_t CellularUrcTokenWoPrefixTableSize;
96102

103+
/* *INDENT-OFF* */
104+
#ifdef __cplusplus
105+
}
106+
#endif
107+
/* *INDENT-ON* */
108+
97109
#endif /* ifndef __CELLULAR_HL7802_H__ */

modules/sara_r4/cellular_r4.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
#ifndef __CELLULAR_R4_H__
2727
#define __CELLULAR_R4_H__
2828

29+
/* *INDENT-OFF* */
30+
#ifdef __cplusplus
31+
extern "C" {
32+
#endif
33+
/* *INDENT-ON* */
34+
2935
/*-----------------------------------------------------------*/
3036

3137
#define MIN_TCP_SESSION_ID ( 0U )
@@ -145,4 +151,10 @@ extern uint32_t CellularUrcTokenWoPrefixTableSize;
145151

146152
/*-----------------------------------------------------------*/
147153

154+
/* *INDENT-OFF* */
155+
#ifdef __cplusplus
156+
}
157+
#endif
158+
/* *INDENT-ON* */
159+
148160
#endif /* ifndef __CELLULAR_R4_H__ */

source/include/cellular_api.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
#ifndef __CELLULAR_API_H__
3131
#define __CELLULAR_API_H__
3232

33+
/* *INDENT-OFF* */
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
/* *INDENT-ON* */
38+
3339
/* IoT Cellular data types. */
3440
#include "cellular_types.h"
3541
#include "cellular_common.h"
@@ -632,4 +638,10 @@ CellularError_t Cellular_SocketRegisterClosedCallback( CellularHandle_t cellular
632638
CellularSocketClosedCallback_t closedCallback,
633639
void * pCallbackContext );
634640

641+
/* *INDENT-OFF* */
642+
#ifdef __cplusplus
643+
}
644+
#endif
645+
/* *INDENT-ON* */
646+
635647
#endif /* __CELLULAR_API_H__ */

source/include/cellular_config_defaults.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
#ifndef __CELLULAR_CONFIG_DEFAULTS_H__
3939
#define __CELLULAR_CONFIG_DEFAULTS_H__
4040

41+
/* *INDENT-OFF* */
42+
#ifdef __cplusplus
43+
extern "C" {
44+
#endif
45+
/* *INDENT-ON* */
46+
4147
/* The macro definition for CELLULAR_DO_NOT_USE_CUSTOM_CONFIG is for Doxygen
4248
* documentation only. */
4349

@@ -427,4 +433,10 @@
427433
#define LogDebug( message )
428434
#endif
429435

436+
/* *INDENT-OFF* */
437+
#ifdef __cplusplus
438+
}
439+
#endif
440+
/* *INDENT-ON* */
441+
430442
#endif /* __CELLULAR_CONFIG_DEFAULTS_H__ */

source/include/cellular_types.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
#ifndef __CELLULAR_TYPES_H__
3131
#define __CELLULAR_TYPES_H__
3232

33+
/* *INDENT-OFF* */
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
/* *INDENT-ON* */
38+
3339
#include <stdbool.h>
3440

3541
/**
@@ -813,4 +819,10 @@ typedef void ( * CellularSocketDataReadyCallback_t )( CellularSocketHandle_t soc
813819
typedef void ( * CellularSocketClosedCallback_t )( CellularSocketHandle_t socketHandle,
814820
void * pCallbackContext );
815821

822+
/* *INDENT-OFF* */
823+
#ifdef __cplusplus
824+
}
825+
#endif
826+
/* *INDENT-ON* */
827+
816828
#endif /* __CELLULAR_TYPES_H__ */

source/include/common/cellular_at_core.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
#ifndef __CELLULAR_AT_CORE_H__
3131
#define __CELLULAR_AT_CORE_H__
3232

33+
/* *INDENT-OFF* */
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
/* *INDENT-ON* */
38+
3339
/* Standard includes */
3440
#include <stdbool.h>
3541
#include <string.h>
@@ -396,4 +402,10 @@ CellularATError_t Cellular_ATStrtoi( const char * pStr,
396402
int32_t base,
397403
int32_t * pResult );
398404

405+
/* *INDENT-OFF* */
406+
#ifdef __cplusplus
407+
}
408+
#endif
409+
/* *INDENT-ON* */
410+
399411
#endif /* __CELLULAR_AT_CORE_H__ */

source/include/common/cellular_common.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
#ifndef __CELLULAR_COMMON_H__
3131
#define __CELLULAR_COMMON_H__
3232

33+
/* *INDENT-OFF* */
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
/* *INDENT-ON* */
38+
3339
/* Standard includes. */
3440
#include <stdbool.h>
3541

@@ -561,4 +567,10 @@ CellularPktStatus_t _Cellular_TimeoutAtcmdDataSendSuccessToken( CellularContext_
561567
const char ** pCellularSrcTokenSuccessTable,
562568
uint32_t cellularSrcTokenSuccessTableSize );
563569

570+
/* *INDENT-OFF* */
571+
#ifdef __cplusplus
572+
}
573+
#endif
574+
/* *INDENT-ON* */
575+
564576
#endif /* __CELLULAR_COMMON_H__ */

source/include/common/cellular_common_api.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
#ifndef __CELLULAR_COMMON_API_H__
3131
#define __CELLULAR_COMMON_API_H__
3232

33+
/* *INDENT-OFF* */
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
/* *INDENT-ON* */
38+
3339
#include "cellular_types.h"
3440
#include "cellular_comm_interface.h"
3541

@@ -296,4 +302,10 @@ CellularPktStatus_t Cellular_CommonUrcProcessCgreg( CellularContext_t * pContext
296302
CellularPktStatus_t Cellular_CommonUrcProcessCreg( CellularContext_t * pContext,
297303
char * pInputLine );
298304

305+
/* *INDENT-OFF* */
306+
#ifdef __cplusplus
307+
}
308+
#endif
309+
/* *INDENT-ON* */
310+
299311
#endif /* __CELLULAR_COMMON_API_H__ */

source/include/common/cellular_common_portable.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
#ifndef __CELLULAR_COMMON_PORTABLE_H__
3131
#define __CELLULAR_COMMON_PORTABLE_H__
3232

33+
/* *INDENT-OFF* */
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
/* *INDENT-ON* */
38+
3339
#include <stdint.h>
3440
#include "cellular_common.h"
3541

@@ -85,4 +91,10 @@ CellularError_t Cellular_ModuleEnableUE( CellularContext_t * pContext );
8591
*/
8692
CellularError_t Cellular_ModuleEnableUrc( CellularContext_t * pContext );
8793

94+
/* *INDENT-OFF* */
95+
#ifdef __cplusplus
96+
}
97+
#endif
98+
/* *INDENT-ON* */
99+
88100
#endif /* End of __CELLULAR_COMMON_PORTABLE_H__. */

0 commit comments

Comments
 (0)