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

Clean up use of 'extern "C"' in header files #504

Merged
merged 1 commit into from
May 19, 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
8 changes: 0 additions & 8 deletions blosc/b2nd_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
#include <b2nd.h>
#include <../plugins/plugin_utils.h>

#ifdef __cplusplus
extern "C" {
#endif


int b2nd_copy_buffer(int8_t ndim,
uint8_t itemsize,
Expand All @@ -26,8 +22,4 @@ int b2nd_copy_buffer(int8_t ndim,
void *dst, const int64_t *dst_pad_shape,
int64_t *dst_start);

#ifdef __cplusplus
}
#endif

#endif // B2ND_B2ND_UTILS_H_
9 changes: 0 additions & 9 deletions blosc/bitshuffle-altivec.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

#include "blosc2/blosc2-common.h"

#ifdef __cplusplus
extern "C" {
#endif


BLOSC_NO_EXPORT int64_t
bshuf_trans_byte_elem_altivec(void* in, void* out, const size_t size,
Expand Down Expand Up @@ -46,9 +42,4 @@ BLOSC_NO_EXPORT int64_t
bshuf_untrans_bit_elem_altivec(void* in, void* out, const size_t size,
const size_t elem_size, void* tmp_buf);

#ifdef __cplusplus
}
#endif


#endif /* BITSHUFFLE_ALTIVEC_H */
8 changes: 0 additions & 8 deletions blosc/bitshuffle-avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

#include <blosc2/blosc2-common.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
AVX2-accelerated bitshuffle routine.
*/
Expand All @@ -33,8 +29,4 @@ BLOSC_NO_EXPORT int64_t
bshuf_untrans_bit_elem_avx2(void* in, void* out, const size_t size,
const size_t elem_size, void* tmp_buf);

#ifdef __cplusplus
}
#endif

#endif /* BITSHUFFLE_AVX2_H */
9 changes: 0 additions & 9 deletions blosc/bitshuffle-generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
#include <blosc2/blosc2-common.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif


/* Macros. */
#define CHECK_MULT_EIGHT(n) if ((n) % 8) return -80;
Expand Down Expand Up @@ -158,9 +154,4 @@ BLOSC_NO_EXPORT int64_t
bshuf_untrans_bit_elem_scal(const void* in, void* out, const size_t size,
const size_t elem_size, void* tmp_buf);


#ifdef __cplusplus
}
#endif

#endif /* BITSHUFFLE_GENERIC_H */
8 changes: 0 additions & 8 deletions blosc/bitshuffle-neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@

#include "blosc2/blosc2-common.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
NEON-accelerated bitshuffle routine.
*/
Expand All @@ -33,8 +29,4 @@ BLOSC_NO_EXPORT int64_t bitshuffle_neon(void* _src, void* _dest, const size_t bl
BLOSC_NO_EXPORT int64_t bitunshuffle_neon(void* _src, void* _dest, const size_t blocksize,
const size_t bytesoftype, void* tmp_buf);

#ifdef __cplusplus
}
#endif

#endif /* BITSHUFFLE_NEON_H */
8 changes: 0 additions & 8 deletions blosc/bitshuffle-sse2.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

#include "blosc2/blosc2-common.h"

#ifdef __cplusplus
extern "C" {
#endif


BLOSC_NO_EXPORT int64_t
bshuf_trans_byte_elem_sse2(void* in, void* out, const size_t size,
Expand Down Expand Up @@ -46,9 +42,5 @@ BLOSC_NO_EXPORT int64_t
bshuf_untrans_bit_elem_sse2(void* in, void* out, const size_t size,
const size_t elem_size, void* tmp_buf);

#ifdef __cplusplus
}
#endif


#endif /* BITSHUFFLE_SSE2_H */
7 changes: 0 additions & 7 deletions blosc/blosc-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
#ifndef IARRAY_BLOSC_PRIVATE_H
#define IARRAY_BLOSC_PRIVATE_H

#ifdef __cplusplus
extern "C" {
#endif

#include "stdbool.h"
#include "blosc2.h"
#include "blosc2/blosc2-common.h"
Expand Down Expand Up @@ -181,8 +177,5 @@ int fill_tuner(blosc2_tuner *tuner);

extern blosc2_tuner g_tuners[256];
extern int g_ntuners;
#ifdef __cplusplus
}
#endif

#endif //IARRAY_BLOSC_PRIVATE_H
8 changes: 0 additions & 8 deletions blosc/blosclz.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
#define BLOSCLZ_H
#include "context.h"

#if defined (__cplusplus)
extern "C" {
#endif

#define BLOSCLZ_VERSION_STRING "2.5.3"


Expand Down Expand Up @@ -63,8 +59,4 @@ int blosclz_compress(int opt_level, const void* input, int length,

int blosclz_decompress(const void* input, int length, void* output, int maxout);

#if defined (__cplusplus)
}
#endif

#endif /* BLOSCLZ_H */
8 changes: 0 additions & 8 deletions blosc/shuffle-altivec.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

#include "blosc2/blosc2-common.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
ALTIVEC-accelerated shuffle routine.
*/
Expand All @@ -31,8 +27,4 @@ BLOSC_NO_EXPORT void shuffle_altivec(const int32_t bytesoftype, const int32_t bl
BLOSC_NO_EXPORT void unshuffle_altivec(const int32_t bytesoftype, const int32_t blocksize,
const uint8_t *_src, uint8_t *_dest);

#ifdef __cplusplus
}
#endif

#endif /* SHUFFLE_ALTIVEC_H */
8 changes: 0 additions & 8 deletions blosc/shuffle-avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

#include "blosc2/blosc2-common.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
AVX2-accelerated shuffle routine.
*/
Expand All @@ -31,8 +27,4 @@ BLOSC_NO_EXPORT void shuffle_avx2(const int32_t bytesoftype, const int32_t block
BLOSC_NO_EXPORT void unshuffle_avx2(const int32_t bytesoftype, const int32_t blocksize,
const uint8_t *_src, uint8_t *_dest);

#ifdef __cplusplus
}
#endif

#endif /* SHUFFLE_AVX2_H */
8 changes: 0 additions & 8 deletions blosc/shuffle-generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
#include "blosc2/blosc2-common.h"
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
Generic (non-hardware-accelerated) shuffle routine.
This is the pure element-copying nested loop. It is used by the
Expand Down Expand Up @@ -95,8 +91,4 @@ BLOSC_NO_EXPORT void shuffle_generic(const int32_t bytesoftype, const int32_t bl
BLOSC_NO_EXPORT void unshuffle_generic(const int32_t bytesoftype, const int32_t blocksize,
const uint8_t *_src, uint8_t *_dest);

#ifdef __cplusplus
}
#endif

#endif /* SHUFFLE_GENERIC_H */
8 changes: 0 additions & 8 deletions blosc/shuffle-neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@

#include "blosc2/blosc2-common.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
NEON-accelerated shuffle routine.
*/
Expand All @@ -33,8 +29,4 @@ BLOSC_NO_EXPORT void shuffle_neon(const int32_t bytesoftype, const int32_t block
BLOSC_NO_EXPORT void unshuffle_neon(const int32_t bytesoftype, const int32_t blocksize,
const uint8_t *_src, uint8_t *_dest);

#ifdef __cplusplus
}
#endif

#endif /* SHUFFLE_NEON_H */
8 changes: 0 additions & 8 deletions blosc/shuffle-sse2.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

#include "blosc2/blosc2-common.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
SSE2-accelerated shuffle routine.
*/
Expand All @@ -31,8 +27,4 @@ BLOSC_NO_EXPORT void shuffle_sse2(const int32_t bytesoftype, const int32_t block
BLOSC_NO_EXPORT void unshuffle_sse2(const int32_t bytesoftype, const int32_t blocksize,
const uint8_t *_src, uint8_t *_dest);

#ifdef __cplusplus
}
#endif

#endif /* SHUFFLE_SSE2_H */
8 changes: 0 additions & 8 deletions blosc/shuffle.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
#define SHUFFLE_USE_NEON
#endif

#ifdef __cplusplus
extern "C" {
#endif

/**
Primary shuffle and bitshuffle routines.
This function dynamically dispatches to the appropriate hardware-accelerated
Expand Down Expand Up @@ -84,8 +80,4 @@ BLOSC_NO_EXPORT int32_t
const uint8_t *_src, const uint8_t *_dest,
const uint8_t *_tmp, const uint8_t format_version);

#ifdef __cplusplus
}
#endif

#endif /* SHUFFLE_H */
9 changes: 0 additions & 9 deletions blosc/transpose-altivec.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
#ifndef BLOSC_TRANSPOSE_ALTIVEC_H
#define BLOSC_TRANSPOSE_ALTIVEC_H

#ifdef __cplusplus
extern "C" {
#endif

static const __vector uint8_t even = (const __vector uint8_t) {
0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e,
0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e};
Expand Down Expand Up @@ -113,9 +109,4 @@ static void transpose16x16(__vector uint8_t * xmm0){
}
}


#ifdef __cplusplus
}
#endif

#endif //BLOSC_TRANSPOSE_ALTIVEC_H
6 changes: 0 additions & 6 deletions include/blosc2.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@
#ifndef BLOSC2_H
#define BLOSC2_H

#ifdef __cplusplus
extern "C" {
#endif
#include "blosc2/blosc2-export.h"
#include "blosc2/blosc2-common.h"
#include "blosc2/blosc2-stdio.h"
#ifdef __cplusplus
}
#endif

#if defined(_WIN32) && !defined(__MINGW32__)
#include <windows.h>
Expand Down
8 changes: 8 additions & 0 deletions include/blosc2/blosc2-stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#include <stdint.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
FILE *file;
} blosc2_stdio_file;
Expand All @@ -37,4 +41,8 @@ BLOSC_EXPORT int64_t blosc2_stdio_write(const void *ptr, int64_t size, int64_t n
BLOSC_EXPORT int64_t blosc2_stdio_read(void *ptr, int64_t size, int64_t nitems, void *stream);
BLOSC_EXPORT int blosc2_stdio_truncate(void *stream, int64_t size);

#ifdef __cplusplus
}
#endif

#endif //BLOSC_BLOSC2_STDIO_H
8 changes: 8 additions & 0 deletions include/blosc2/codecs-registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
See LICENSE.txt for details about copyright and rights to use.
**********************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

enum {
BLOSC_CODEC_NDLZ = 32,
BLOSC_CODEC_ZFP_FIXED_ACCURACY = 33,
Expand All @@ -25,3 +29,7 @@ typedef struct {

// Silence unused codec_info typedef warning
static codec_info codec_info_defaults BLOSC_ATTRIBUTE_UNUSED = {0};

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions include/blosc2/filters-registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
See LICENSE.txt for details about copyright and rights to use.
**********************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

enum {
BLOSC_FILTER_NDCELL = 32,
BLOSC_FILTER_NDMEAN = 33,
Expand All @@ -21,3 +25,7 @@ typedef struct {
char *forward;
char *backward;
} filter_info;

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions include/blosc2/plugins-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#define popen _popen
#define pclose _pclose

#ifdef __cplusplus
extern "C" {
#endif

static struct {
long lasterror;
const char *err_rutin;
Expand Down Expand Up @@ -98,3 +102,7 @@ static inline void* load_lib(char *plugin_name, char *libpath) {
}
return loaded_lib;
}

#ifdef __cplusplus
}
#endif
Loading