Skip to content

Commit b022b08

Browse files
Merge pull request #58 from swiftlang/egorzhdan/include-inside-extern-c
NFC: Move `#include`s out of `extern "C"` block
2 parents fc07ab5 + 8a43e0a commit b022b08

File tree

9 files changed

+30
-30
lines changed

9 files changed

+30
-30
lines changed

src/include/cmark-gfm-extension_api.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#ifndef CMARK_GFM_EXTENSION_API_H
22
#define CMARK_GFM_EXTENSION_API_H
33

4-
#ifdef __cplusplus
5-
extern "C" {
6-
#endif
7-
84
#include "cmark-gfm.h"
95

106
#include <stdbool.h>
117

8+
#ifdef __cplusplus
9+
extern "C" {
10+
#endif
11+
1212
struct cmark_renderer;
1313
struct cmark_html_renderer;
1414
struct cmark_chunk;

src/include/cmark_ctype.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#ifndef CMARK_CMARK_CTYPE_H
22
#define CMARK_CMARK_CTYPE_H
33

4+
#include "export.h"
5+
46
#ifdef __cplusplus
57
extern "C" {
68
#endif
79

8-
#include "export.h"
9-
1010
/** Locale-independent versions of functions from ctype.h.
1111
* We want cmark to behave the same no matter what the system locale.
1212
*/

src/include/houdini.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#ifndef CMARK_HOUDINI_H
22
#define CMARK_HOUDINI_H
33

4-
#ifdef __cplusplus
5-
extern "C" {
6-
#endif
7-
84
#include <stdint.h>
95

106
#include "buffer.h"
117

8+
#ifdef __cplusplus
9+
extern "C" {
10+
#endif
11+
1212
#ifdef HOUDINI_USE_LOCALE
1313
#define _isxdigit(c) isxdigit(c)
1414
#define _isdigit(c) isdigit(c)

src/include/inlines.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#ifndef CMARK_INLINES_H
22
#define CMARK_INLINES_H
33

4-
#ifdef __cplusplus
5-
extern "C" {
6-
#endif
7-
84
#include <stdbool.h>
95
#include <stdlib.h>
106

117
#include "references.h"
128

9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif
12+
1313
cmark_chunk cmark_clean_url(cmark_mem *mem, cmark_chunk *url);
1414
cmark_chunk cmark_clean_title(cmark_mem *mem, cmark_chunk *title);
1515
cmark_chunk cmark_clean_attributes(cmark_mem *mem, cmark_chunk *attributes);

src/include/iterator.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#ifndef CMARK_ITERATOR_H
22
#define CMARK_ITERATOR_H
33

4+
#include "cmark-gfm.h"
5+
46
#ifdef __cplusplus
57
extern "C" {
68
#endif
79

8-
#include "cmark-gfm.h"
9-
1010
typedef struct {
1111
cmark_event_type ev_type;
1212
cmark_node *node;

src/include/node.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#ifndef CMARK_NODE_H
22
#define CMARK_NODE_H
33

4-
#ifdef __cplusplus
5-
extern "C" {
6-
#endif
7-
84
#include <stdbool.h>
95
#include <stdint.h>
106
#include <stdio.h>
@@ -14,6 +10,10 @@ extern "C" {
1410
#include "buffer.h"
1511
#include "chunk.h"
1612

13+
#ifdef __cplusplus
14+
extern "C" {
15+
#endif
16+
1717
typedef struct {
1818
cmark_list_type list_type;
1919
int marker_offset;

src/include/plugin.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#ifndef CMARK_PLUGIN_H
22
#define CMARK_PLUGIN_H
33

4+
#include "cmark-gfm.h"
5+
#include "cmark-gfm-extension_api.h"
6+
47
#ifdef __cplusplus
58
extern "C" {
69
#endif
710

8-
#include "cmark-gfm.h"
9-
#include "cmark-gfm-extension_api.h"
10-
1111
/**
1212
* cmark_plugin:
1313
*

src/include/registry.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#ifndef CMARK_REGISTRY_H
22
#define CMARK_REGISTRY_H
33

4+
#include "cmark-gfm.h"
5+
#include "cmark-gfm-extension_api.h"
6+
47
#ifdef __cplusplus
58
extern "C" {
69
#endif
710

8-
#include "cmark-gfm.h"
9-
#include "cmark-gfm-extension_api.h"
10-
1111
CMARK_GFM_EXPORT
1212
void cmark_register_plugin(cmark_plugin_init_func reg_fn);
1313

src/include/render.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#ifndef CMARK_RENDER_H
22
#define CMARK_RENDER_H
33

4-
#ifdef __cplusplus
5-
extern "C" {
6-
#endif
7-
84
#include <stdbool.h>
95
#include <stdlib.h>
106

117
#include "buffer.h"
128
#include "chunk.h"
139

10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
13+
1414
typedef enum { LITERAL, NORMAL, TITLE, URL } cmark_escaping;
1515

1616
struct cmark_renderer {

0 commit comments

Comments
 (0)