Skip to content

Commit 97d1b5e

Browse files
clean up config headers
- all the compilers we support have __has_include(), so use that instead of checking it in cmake - nothing in the library uses HAS__ATTRIBUTE__, so remove it
1 parent 0b83006 commit 97d1b5e

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

src/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,9 @@ include(CheckIncludeFile)
178178
include(CheckCSourceCompiles)
179179
include(CheckCSourceRuns)
180180
include(CheckSymbolExists)
181-
CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
182181
CHECK_C_SOURCE_COMPILES(
183182
"int main() { __builtin_expect(0,0); return 0; }"
184183
HAVE___BUILTIN_EXPECT)
185-
CHECK_C_SOURCE_COMPILES("
186-
int f(void) __attribute__ (());
187-
int main() { return 0; }
188-
" HAVE___ATTRIBUTE__)
189184

190185
CONFIGURE_FILE(
191186
${CMAKE_CURRENT_SOURCE_DIR}/config.h.in

src/config.h.in

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,16 @@
55
extern "C" {
66
#endif
77

8-
#cmakedefine HAVE_STDBOOL_H
9-
10-
#ifdef HAVE_STDBOOL_H
8+
#if __has_include(<stdbool.h>)
119
#include <stdbool.h>
1210
#elif !defined(__cplusplus)
1311
typedef char bool;
1412
#endif
1513

1614
#cmakedefine HAVE___BUILTIN_EXPECT
1715

18-
#cmakedefine HAVE___ATTRIBUTE__
19-
2016
#cmakedefine CMARK_THREADING
2117

22-
#ifdef HAVE___ATTRIBUTE__
23-
#define CMARK_ATTRIBUTE(list) __attribute__ (list)
24-
#else
25-
#define CMARK_ATTRIBUTE(list)
26-
#endif
27-
2818
#ifndef CMARK_INLINE
2919
#if defined(_MSC_VER) && !defined(__cplusplus)
3020
#define CMARK_INLINE __inline

src/include/cmark-gfm_config.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,16 @@
99
extern "C" {
1010
#endif
1111

12-
#define HAVE_STDBOOL_H
13-
14-
#ifdef HAVE_STDBOOL_H
12+
#if __has_include(<stdbool.h>)
1513
#include <stdbool.h>
1614
#elif !defined(__cplusplus)
1715
typedef char bool;
1816
#endif
1917

2018
#define HAVE___BUILTIN_EXPECT
2119

22-
#define HAVE___ATTRIBUTE__
23-
2420
#define CMARK_THREADING
2521

26-
#ifdef HAVE___ATTRIBUTE__
27-
#define CMARK_ATTRIBUTE(list) __attribute__ (list)
28-
#else
29-
#define CMARK_ATTRIBUTE(list)
30-
#endif
31-
3222
#ifndef CMARK_INLINE
3323
#if defined(_MSC_VER) && !defined(__cplusplus)
3424
#define CMARK_INLINE __inline

0 commit comments

Comments
 (0)