I recently saw this block at the beginning of a .h
file.
#ifdef __cplusplus
extern "C" {
#include <cstddef>
#include <cstdint>
#else
#include <stddef.h>
#include <stdint.h>
#endif /* __cplusplus */
Does wrapping a #include
directive for a standard C++ header in extern "C" { ...
actually do anything? Is it functionally different from:
#ifdef __cplusplus
#include <cstddef>
#include <cstdint>
extern "C" {
#else
#include <stddef.h>
#include <stdint.h>
#endif /* __cplusplus */
I was under the impression that this makes no difference, but I'm seeing it so often I am becoming curious.