soc/arm/nxp*: rearrange for standard use of extern "C"

Consistently place C++ use of extern "C" after all include directives,
within the negative branch of _ASMLANGUAGE if used.

Remove extern "C" support from files that don't declare objects or
functions.

Background from issue #17997:

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2019-08-12 12:55:33 -05:00 committed by Ioannis Glaropoulos
commit ddf9b144ce
8 changed files with 6 additions and 62 deletions

View file

@ -7,10 +7,6 @@
#ifndef _SOC__H_
#define _SOC__H_
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASMLANGUAGE
#include "rdc.h"
@ -20,8 +16,4 @@ extern "C" {
#endif /* !_ASMLANGUAGE */
#ifdef __cplusplus
}
#endif
#endif /* _SOC__H_ */

View file

@ -7,10 +7,6 @@
#ifndef _SOC__H_
#define _SOC__H_
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASMLANGUAGE
#include "rdc.h"
@ -21,8 +17,4 @@ extern "C" {
#endif /* !_ASMLANGUAGE */
#ifdef __cplusplus
}
#endif
#endif /* _SOC__H_ */

View file

@ -9,10 +9,6 @@
#include <sys/util.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASMLANGUAGE
#include <fsl_common.h>
@ -23,6 +19,10 @@ extern "C" {
*/
#include <kernel_includes.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CONFIG_DISK_ACCESS_USDHC1) || \
defined(CONFIG_DISK_ACCESS_USDHC2)
@ -36,10 +36,10 @@ void imxrt_usdhc_pinmux_cb_register(usdhc_pin_cfg_cb cb);
#endif
#endif /* !_ASMLANGUAGE */
#ifdef __cplusplus
}
#endif
#endif /* !_ASMLANGUAGE */
#endif /* _SOC__H_ */