Commit 04adec22 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

Add extern "C" wrapper to all public headers



Also consistently place the extern "C" before any includes or other
declarations in files that already had it.

Change-Id: Ia316d5be3e509ec76c4a98cfa90ed516073351e0
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent bfd92d47
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -34,6 +34,10 @@
#ifndef SPDK_ASSERT_H
#define SPDK_ASSERT_H

#ifdef __cplusplus
extern "C" {
#endif

#include <assert.h>

#define SPDK_CONCAT_(x, y) x##y
@@ -52,4 +56,8 @@
        typedef char SPDK_CONCAT(SPDK_STATIC_ASSERT_, __LINE__)[!!(cond) - 1]
#endif

#ifdef __cplusplus
}
#endif

#endif /* SPDK_ASSERT_H */
+8 −0
Original line number Diff line number Diff line
@@ -34,7 +34,15 @@
#ifndef SPDK_BARRIER_H
#define SPDK_BARRIER_H

#ifdef __cplusplus
extern "C" {
#endif

#define spdk_wmb()	__asm volatile("sfence" ::: "memory")
#define spdk_mb()	__asm volatile("mfence" ::: "memory")

#ifdef __cplusplus
}
#endif

#endif
+8 −0
Original line number Diff line number Diff line
@@ -34,9 +34,17 @@
#ifndef SPDK_FILE_H
#define SPDK_FILE_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

uint64_t spdk_file_get_size(int fd);
uint32_t spdk_dev_get_blocklen(int fd);

#ifdef __cplusplus
}
#endif

#endif
+8 −0
Original line number Diff line number Diff line
@@ -38,6 +38,10 @@
#ifndef SPDK_IOAT_H
#define SPDK_IOAT_H

#ifdef __cplusplus
extern "C" {
#endif

#include <inttypes.h>
#include <stdbool.h>
#include "spdk/pci.h"
@@ -149,4 +153,8 @@ enum spdk_ioat_dma_capability_flags {
 */
uint32_t spdk_ioat_get_dma_capabilities(void);

#ifdef __cplusplus
}
#endif

#endif
+8 −0
Original line number Diff line number Diff line
@@ -34,6 +34,10 @@
#ifndef SPDK_IOAT_SPEC_H
#define SPDK_IOAT_SPEC_H

#ifdef __cplusplus
extern "C" {
#endif

#include <inttypes.h>

#include "spdk/assert.h"
@@ -312,4 +316,8 @@ union spdk_ioat_hw_desc {
};
SPDK_STATIC_ASSERT(sizeof(union spdk_ioat_hw_desc) == 64, "incorrect spdk_ioat_hw_desc layout");

#ifdef __cplusplus
}
#endif

#endif /* SPDK_IOAT_SPEC_H */
Loading