Skip to content

Commit 8f7aabb

Browse files
committed
fix(includes): get rid of dependencies from internal headers on public headers
1 parent 8553608 commit 8f7aabb

File tree

19 files changed

+100
-86
lines changed

19 files changed

+100
-86
lines changed

include/graphqlservice/GraphQLClient.h

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,10 @@
66
#ifndef GRAPHQLCLIENT_H
77
#define GRAPHQLCLIENT_H
88

9-
// clang-format off
10-
#ifdef GRAPHQL_DLLEXPORTS
11-
#ifdef IMPL_GRAPHQLCLIENT_DLL
12-
#define GRAPHQLCLIENT_EXPORT __declspec(dllexport)
13-
#else // !IMPL_GRAPHQLCLIENT_DLL
14-
#define GRAPHQLCLIENT_EXPORT __declspec(dllimport)
15-
#endif // !IMPL_GRAPHQLCLIENT_DLL
16-
#else // !GRAPHQL_DLLEXPORTS
17-
#define GRAPHQLCLIENT_EXPORT
18-
#endif // !GRAPHQL_DLLEXPORTS
19-
// clang-format on
20-
21-
#include "graphqlservice/GraphQLResponse.h"
22-
23-
#include "graphqlservice/internal/Version.h"
9+
#include "GraphQLResponse.h"
10+
11+
#include "internal/Version.h"
12+
#include "internal/DllExports.h"
2413

2514
#include <algorithm>
2615
#include <iterator>

include/graphqlservice/GraphQLParse.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,7 @@
66
#ifndef GRAPHQLPARSE_H
77
#define GRAPHQLPARSE_H
88

9-
// clang-format off
10-
#ifdef GRAPHQL_DLLEXPORTS
11-
#ifdef IMPL_GRAPHQLPEG_DLL
12-
#define GRAPHQLPEG_EXPORT __declspec(dllexport)
13-
#else // !IMPL_GRAPHQLPEG_DLL
14-
#define GRAPHQLPEG_EXPORT __declspec(dllimport)
15-
#endif // !IMPL_GRAPHQLPEG_DLL
16-
#else // !GRAPHQL_DLLEXPORTS
17-
#define GRAPHQLPEG_EXPORT
18-
#endif // !GRAPHQL_DLLEXPORTS
19-
// clang-format on
9+
#include "internal/DllExports.h"
2010

2111
#include <memory>
2212
#include <string_view>

include/graphqlservice/GraphQLResponse.h

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,8 @@
66
#ifndef GRAPHQLRESPONSE_H
77
#define GRAPHQLRESPONSE_H
88

9-
// clang-format off
10-
#ifdef GRAPHQL_DLLEXPORTS
11-
#ifdef IMPL_GRAPHQLRESPONSE_DLL
12-
#define GRAPHQLRESPONSE_EXPORT __declspec(dllexport)
13-
#else // !IMPL_GRAPHQLRESPONSE_DLL
14-
#define GRAPHQLRESPONSE_EXPORT __declspec(dllimport)
15-
#endif // !IMPL_GRAPHQLRESPONSE_DLL
16-
#else // !GRAPHQL_DLLEXPORTS
17-
#define GRAPHQLRESPONSE_EXPORT
18-
#endif // !GRAPHQL_DLLEXPORTS
19-
// clang-format on
20-
21-
#include "graphqlservice/internal/Awaitable.h"
9+
#include "internal/Awaitable.h"
10+
#include "internal/DllExports.h"
2211

2312
#include <cstdint>
2413
#include <initializer_list>

include/graphqlservice/GraphQLService.h

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,13 @@
66
#ifndef GRAPHQLSERVICE_H
77
#define GRAPHQLSERVICE_H
88

9-
// clang-format off
10-
#ifdef GRAPHQL_DLLEXPORTS
11-
#ifdef IMPL_GRAPHQLSERVICE_DLL
12-
#define GRAPHQLSERVICE_EXPORT __declspec(dllexport)
13-
#else // !IMPL_GRAPHQLSERVICE_DLL
14-
#define GRAPHQLSERVICE_EXPORT __declspec(dllimport)
15-
#endif // !IMPL_GRAPHQLSERVICE_DLL
16-
#else // !GRAPHQL_DLLEXPORTS
17-
#define GRAPHQLSERVICE_EXPORT
18-
#endif // !GRAPHQL_DLLEXPORTS
19-
// clang-format on
20-
21-
#include "graphqlservice/GraphQLParse.h"
22-
#include "graphqlservice/GraphQLResponse.h"
23-
24-
#include "graphqlservice/internal/Awaitable.h"
25-
#include "graphqlservice/internal/SortedMap.h"
26-
#include "graphqlservice/internal/Version.h"
9+
#include "GraphQLParse.h"
10+
#include "GraphQLResponse.h"
11+
12+
#include "internal/Awaitable.h"
13+
#include "internal/DllExports.h"
14+
#include "internal/SortedMap.h"
15+
#include "internal/Version.h"
2716

2817
#include <chrono>
2918
#include <condition_variable>

include/graphqlservice/JSONResponse.h

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,9 @@
66
#ifndef JSONRESPONSE_H
77
#define JSONRESPONSE_H
88

9-
// clang-format off
10-
#ifdef GRAPHQL_DLLEXPORTS
11-
#ifdef IMPL_JSONRESPONSE_DLL
12-
#define JSONRESPONSE_EXPORT __declspec(dllexport)
13-
#else // !IMPL_JSONRESPONSE_DLL
14-
#define JSONRESPONSE_EXPORT __declspec(dllimport)
15-
#endif // !IMPL_JSONRESPONSE_DLL
16-
#else // !GRAPHQL_DLLEXPORTS
17-
#define JSONRESPONSE_EXPORT
18-
#endif // !GRAPHQL_DLLEXPORTS
19-
// clang-format on
20-
21-
#include "graphqlservice/GraphQLResponse.h"
9+
#include "GraphQLResponse.h"
10+
11+
#include "internal/DllExports.h"
2212

2313
namespace graphql::response {
2414

include/graphqlservice/internal/Base64.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,7 @@
66
#ifndef GRAPHQLBASE64_H
77
#define GRAPHQLBASE64_H
88

9-
// clang-format off
10-
#ifdef GRAPHQL_DLLEXPORTS
11-
#ifdef IMPL_GRAPHQLRESPONSE_DLL
12-
#define GRAPHQLRESPONSE_EXPORT __declspec(dllexport)
13-
#else // !IMPL_GRAPHQLRESPONSE_DLL
14-
#define GRAPHQLRESPONSE_EXPORT __declspec(dllimport)
15-
#endif // !IMPL_GRAPHQLRESPONSE_DLL
16-
#else // !GRAPHQL_DLLEXPORTS
17-
#define GRAPHQLRESPONSE_EXPORT
18-
#endif // !GRAPHQL_DLLEXPORTS
19-
// clang-format on
9+
#include "DllExports.h"
2010

2111
#include <cstdint>
2212
#include <string>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#pragma once
5+
6+
#ifndef DLLEXPORTS_H
7+
#define DLLEXPORTS_H
8+
9+
// clang-format off
10+
#ifdef GRAPHQL_DLLEXPORTS
11+
#ifdef IMPL_GRAPHQLCLIENT_DLL
12+
#define GRAPHQLCLIENT_EXPORT __declspec(dllexport)
13+
#else // !IMPL_GRAPHQLCLIENT_DLL
14+
#define GRAPHQLCLIENT_EXPORT __declspec(dllimport)
15+
#endif // !IMPL_GRAPHQLCLIENT_DLL
16+
17+
#ifdef IMPL_GRAPHQLPEG_DLL
18+
#define GRAPHQLPEG_EXPORT __declspec(dllexport)
19+
#else // !IMPL_GRAPHQLPEG_DLL
20+
#define GRAPHQLPEG_EXPORT __declspec(dllimport)
21+
#endif // !IMPL_GRAPHQLPEG_DLL
22+
23+
#ifdef IMPL_GRAPHQLRESPONSE_DLL
24+
#define GRAPHQLRESPONSE_EXPORT __declspec(dllexport)
25+
#else // !IMPL_GRAPHQLRESPONSE_DLL
26+
#define GRAPHQLRESPONSE_EXPORT __declspec(dllimport)
27+
#endif // !IMPL_GRAPHQLRESPONSE_DLL
28+
29+
#ifdef IMPL_GRAPHQLSERVICE_DLL
30+
#define GRAPHQLSERVICE_EXPORT __declspec(dllexport)
31+
#else // !IMPL_GRAPHQLSERVICE_DLL
32+
#define GRAPHQLSERVICE_EXPORT __declspec(dllimport)
33+
#endif // !IMPL_GRAPHQLSERVICE_DLL
34+
35+
#ifdef IMPL_JSONRESPONSE_DLL
36+
#define JSONRESPONSE_EXPORT __declspec(dllexport)
37+
#else // !IMPL_JSONRESPONSE_DLL
38+
#define JSONRESPONSE_EXPORT __declspec(dllimport)
39+
#endif // !IMPL_JSONRESPONSE_DLL
40+
#else // !GRAPHQL_DLLEXPORTS
41+
#define GRAPHQLCLIENT_EXPORT
42+
#define GRAPHQLPEG_EXPORT
43+
#define GRAPHQLRESPONSE_EXPORT
44+
#define GRAPHQLSERVICE_EXPORT
45+
#define JSONRESPONSE_EXPORT
46+
#endif // !GRAPHQL_DLLEXPORTS
47+
// clang-format on
48+
49+
#endif // DLLEXPORTS_H

include/graphqlservice/internal/Grammar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef GRAPHQLGRAMMAR_H
1010
#define GRAPHQLGRAMMAR_H
1111

12-
#include "graphqlservice/internal/SyntaxTree.h"
12+
#include "SyntaxTree.h"
1313

1414
#include <functional>
1515

include/graphqlservice/internal/Introspection.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
#include "graphqlservice/introspection/IntrospectionSchema.h"
1010

11-
#include "graphqlservice/internal/Schema.h"
11+
#include "DllExports.h"
12+
#include "Schema.h"
1213

1314
namespace graphql::introspection {
1415

include/graphqlservice/internal/Schema.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
#ifndef GRAPHQLSCHEMA_H
77
#define GRAPHQLSCHEMA_H
88

9-
#include "graphqlservice/GraphQLService.h"
9+
#include "DllExports.h"
10+
#include "SortedMap.h"
11+
#include "Version.h"
1012

1113
#include <shared_mutex>
14+
#include <vector>
1215

1316
namespace graphql {
1417
namespace introspection {

0 commit comments

Comments
 (0)