Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of extern C block #981

Merged
merged 3 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions source/include/FreeRTOS_ARP.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,16 @@
#ifndef FREERTOS_ARP_H
#define FREERTOS_ARP_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* Application level configuration options. */
#include "FreeRTOSIPConfig.h"
#include "FreeRTOSIPConfigDefaults.h"
#include "IPTraceMacroDefaults.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */
/*-----------------------------------------------------------*/
/* Miscellaneous structure and definitions. */
/*-----------------------------------------------------------*/
Expand Down
10 changes: 5 additions & 5 deletions source/include/FreeRTOS_DHCP.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@
#ifndef FREERTOS_DHCP_H
#define FREERTOS_DHCP_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif

#include "FreeRTOS_Sockets.h"
#include "FreeRTOS_Routing.h"

/* Application level configuration options. */
#include "FreeRTOSIPConfig.h"
#include "IPTraceMacroDefaults.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif

#if ( ipconfigUSE_DHCP != 0 ) && ( ipconfigNETWORK_MTU < 586U )

/* DHCP must be able to receive an options field of 312 bytes, the fixed
Expand Down
8 changes: 4 additions & 4 deletions source/include/FreeRTOS_DHCPv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
#ifndef FREERTOS_DHCPV6_H
#define FREERTOS_DHCPV6_H

#ifdef __cplusplus
extern "C" {
#endif

/* Application level configuration options. */
#include "FreeRTOS_DHCP.h"
#include "FreeRTOSIPConfig.h"
#include "IPTraceMacroDefaults.h"

#ifdef __cplusplus
extern "C" {
#endif

/* IPv6 option numbers. */
/** @brief IPv6 DHCP option number - Solicit */
#define DHCPv6_message_Type_Solicit 1U
Expand Down
10 changes: 5 additions & 5 deletions source/include/FreeRTOS_DNS.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
#ifndef FREERTOS_DNS_H
#define FREERTOS_DNS_H

/* Application level configuration options. */
#include "FreeRTOS_DNS_Globals.h"
#include "FreeRTOS_DNS_Callback.h"
#include "FreeRTOS_DNS_Cache.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* Application level configuration options. */
#include "FreeRTOS_DNS_Globals.h"
#include "FreeRTOS_DNS_Callback.h"
#include "FreeRTOS_DNS_Cache.h"

/*
* LLMNR is very similar to DNS, so is handled by the DNS routines.
*/
Expand Down
13 changes: 7 additions & 6 deletions source/include/FreeRTOS_DNS_Callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
#ifndef FREERTOS_DNS_CALLBACK_H
#define FREERTOS_DNS_CALLBACK_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* FreeRTOS includes. */
#include "FreeRTOS.h"

Expand All @@ -45,6 +39,13 @@

/* Standard includes. */
#include <stdint.h>

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* Application level configuration options. */

#if ( ( ipconfigDNS_USE_CALLBACKS == 1 ) && ( ipconfigUSE_DNS != 0 ) )
Expand Down
12 changes: 6 additions & 6 deletions source/include/FreeRTOS_ICMP.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
#ifndef FREERTOS_ICMP_H
#define FREERTOS_ICMP_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* Standard includes. */
#include <stdint.h>
#include <stdio.h>
Expand All @@ -61,6 +55,12 @@
#include "NetworkBufferManagement.h"
#include "FreeRTOS_DNS.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* ICMP protocol definitions. */
#define ipICMP_ECHO_REQUEST ( ( uint8_t ) 8 ) /**< ICMP echo request. */
#define ipICMP_ECHO_REPLY ( ( uint8_t ) 0 ) /**< ICMP echo reply. */
Expand Down
12 changes: 6 additions & 6 deletions source/include/FreeRTOS_IP.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
#ifndef FREERTOS_IP_H
#define FREERTOS_IP_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

#include "FreeRTOS.h"
#include "task.h"

Expand All @@ -43,6 +37,12 @@
#include "FreeRTOS_IP_Common.h"
#include "IPTraceMacroDefaults.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* Constants defining the current version of the FreeRTOS+TCP
* network stack. */
#define ipFR_TCP_VERSION_NUMBER "V4.0.999"
Expand Down
11 changes: 6 additions & 5 deletions source/include/FreeRTOS_IP_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@

#ifndef FREERTOS_IP_PRIVATE_H
#define FREERTOS_IP_PRIVATE_H
/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* Application level configuration options. */
#include "FreeRTOSIPConfig.h"
Expand All @@ -50,6 +45,12 @@

#include "event_groups.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

#ifdef TEST
int ipFOREVER( void );
#else
Expand Down
12 changes: 6 additions & 6 deletions source/include/FreeRTOS_IP_Timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
#ifndef FREERTOS_IP_TIMERS_H
#define FREERTOS_IP_TIMERS_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* Standard includes. */
#include <stdint.h>
#include <stdio.h>
Expand All @@ -61,6 +55,12 @@
#include "NetworkBufferManagement.h"
#include "FreeRTOS_DNS.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/*
* Checks the ARP, DHCP and TCP timers to see if any periodic or timeout
* processing is required.
Expand Down
18 changes: 9 additions & 9 deletions source/include/FreeRTOS_IP_Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,14 @@
* http://www.FreeRTOS.org
*/

#ifndef FREERTOS_IP_UTILS_H
#define FREERTOS_IP_UTILS_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/**
* @file FreeRTOS_IP_Utils.h
* @brief Implements the utility functions for FreeRTOS_IP.c
*/

#ifndef FREERTOS_IP_UTILS_H
#define FREERTOS_IP_UTILS_H

/* Standard includes. */
#include <stdint.h>
#include <stdio.h>
Expand All @@ -65,6 +59,12 @@
#include "FreeRTOS_IPv4_Utils.h"
#include "FreeRTOS_IPv6_Utils.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

#if ( ipconfigUSE_DHCP != 0 )

/**
Expand Down
12 changes: 6 additions & 6 deletions source/include/FreeRTOS_IPv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
#ifndef FREERTOS_IPV4_H
#define FREERTOS_IPV4_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

#include "FreeRTOS.h"
#include "task.h"
#include "FreeRTOS_IP.h"
Expand All @@ -43,6 +37,12 @@
#include "FreeRTOSIPConfigDefaults.h"
#include "IPTraceMacroDefaults.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

#define ipSIZE_OF_IPv4_HEADER 20U
#define ipSIZE_OF_IPv4_ADDRESS 4U
#define ipSIZE_OF_ICMPv4_HEADER 8U
Expand Down
5 changes: 3 additions & 2 deletions source/include/FreeRTOS_IPv4_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@

#ifndef FREERTOS_IPV4_PRIVATE_H
#define FREERTOS_IPV4_PRIVATE_H

#include "FreeRTOS_IP_Private.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

#include "FreeRTOS_IP_Private.h"

/* The maximum UDP payload length. */
#define ipMAX_UDP_PAYLOAD_LENGTH ( ( ipconfigNETWORK_MTU - ipSIZE_OF_IPv4_HEADER ) - ipSIZE_OF_UDP_HEADER )

Expand Down
8 changes: 4 additions & 4 deletions source/include/FreeRTOS_IPv4_Sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
#ifndef FREERTOS_IPV4_SOCKETS_H
#define FREERTOS_IPV4_SOCKETS_H

#ifdef __cplusplus
extern "C" {
#endif

/* Standard includes. */
#include <string.h>

/* FreeRTOS includes. */
#include "FreeRTOS.h"

#ifdef __cplusplus
extern "C" {
#endif


/* Translate from 192.168.1.1 to a 32-bit number. */
BaseType_t FreeRTOS_inet_pton4( const char * pcSource,
Expand Down
12 changes: 6 additions & 6 deletions source/include/FreeRTOS_IPv4_Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
#ifndef FREERTOS_IPV4_UTILS_H
#define FREERTOS_IPV4_UTILS_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/**
* @file FreeRTOS_IPv4_Utils.h
* @brief Implements the utility functions for FreeRTOS_IP.c
Expand All @@ -49,6 +43,12 @@
/* FreeRTOS+TCP includes. */
#include "FreeRTOS_IP.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* Set the MAC-address that belongs to a given IPv4 multi-cast address. */
void vSetMultiCastIPv4MacAddress( uint32_t ulIPAddress,
MACAddress_t * pxMACAddress );
Expand Down
12 changes: 6 additions & 6 deletions source/include/FreeRTOS_IPv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
#ifndef FREERTOS_IPV6_H
#define FREERTOS_IPV6_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

#include "FreeRTOS.h"
#include "task.h"
#include "FreeRTOS_IP.h"
#include "FreeRTOS_IP_Common.h"
#include "FreeRTOS_IPv6_Private.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* Some constants defining the sizes of several parts of a packet.
* These defines come before including the configuration header files. */
#define ipSIZE_OF_IPv6_HEADER 40U
Expand Down
11 changes: 6 additions & 5 deletions source/include/FreeRTOS_IPv6_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@

#ifndef FREERTOS_IPV6_PRIVATE_H
#define FREERTOS_IPV6_PRIVATE_H
/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* Application level configuration options. */
#include "FreeRTOSIPConfig.h"
Expand All @@ -49,6 +44,12 @@

#include "event_groups.h"

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* MISRA Ref 20.5.1 [Use of undef] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-2051 */
/* coverity[misra_c_2012_rule_20_5_violation] */
Expand Down
Loading