Skip to content

Commit

Permalink
Remove cpp_magic.h import and ancient Clang compatibility hack from…
Browse files Browse the repository at this point in the history
… `CNIOAtomics.h` (#1111)

The inclusion of `cpp_magic.h` in `CNIOAtomics.h` is unnecessary and pollutes the namespace of anyone else importing the header. NIO now also requires Swift 5, which itself will not be built with a Clang too old to understand `_Nonnull`. Note: Removing the extra import of cpp-magic.h required moving it to the src/ directory to avoid complaints about its inclusion (or lack thereof) in the module's umbrella header.
  • Loading branch information
gwynne authored and weissi committed Aug 15, 2019
1 parent 415b48e commit 7908278
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions Sources/CNIOAtomics/include/CNIOAtomics.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
#include <stdbool.h>
#include <stdint.h>

#include "cpp_magic.h"

#if __clang_major__ == 3 && __clang_minor__ <= 6
/* clang 3.6 doesn't seem to know about _Nonnull yet */
#define _Nonnull __attribute__((nonnull))
#endif

struct catmc_atomic__Bool;
struct catmc_atomic__Bool * _Nonnull catmc_atomic__Bool_create(bool value);
void catmc_atomic__Bool_destroy(struct catmc_atomic__Bool * _Nonnull atomic);
Expand Down
2 changes: 1 addition & 1 deletion Sources/CNIOAtomics/src/c-atomics.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <stdio.h>

#include "../include/CNIOAtomics.h"
#include "../include/cpp_magic.h"
#include "cpp_magic.h"

#define MAKE(type) /*
*/ struct catmc_atomic_##type { /*
Expand Down
File renamed without changes.

0 comments on commit 7908278

Please sign in to comment.