Skip to content

Commit

Permalink
Remove -Wmodule-import-in-extern-c warnings (#654)
Browse files Browse the repository at this point in the history
When using [clang modules][1] (not C++ modules) #including stuff within `extern "C"` blocks causes warnings. Remove said warnings by moving the #include. See this [StackOverflow question] for an idea of what the warning looks like.


[1]: https://clang.llvm.org/docs/Modules.html
[2]: https://stackoverflow.com/questions/77113501/xcode-15-compile-error-import-of-c-module-zlib-appears-within-extern-c-la
  • Loading branch information
rockwotj authored Sep 4, 2024
1 parent 60d0e97 commit d2ee8e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/roaring/memory.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef INCLUDE_ROARING_MEMORY_H_
#define INCLUDE_ROARING_MEMORY_H_

#include <stddef.h> // for size_t

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h> // for size_t

typedef void* (*roaring_malloc_p)(size_t);
typedef void* (*roaring_realloc_p)(void*, size_t);
typedef void* (*roaring_calloc_p)(size_t, size_t);
Expand Down

0 comments on commit d2ee8e4

Please sign in to comment.