Skip to content

Commit 1d65922

Browse files
authored
Merge pull request #292 from wravery/reorder-attributes
Fix DLL export attribute order for clang on Windows
2 parents 00a6d4b + 1d54869 commit 1d65922

23 files changed

+397
-402
lines changed

cmake/test_boost_beast.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This is a dummy program that just needs to compile to tell us if Boost.Asio
2+
// supports co_await and Boost.Beast is installed.
3+
4+
#include <boost/asio/use_awaitable.hpp>
5+
6+
#include <boost/beast.hpp>
7+
8+
int main()
9+
{
10+
#ifdef BOOST_ASIO_HAS_CO_AWAIT
11+
return 0;
12+
#else
13+
#error BOOST_ASIO_HAS_CO_AWAIT is undefined
14+
#endif
15+
}

cmake/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.5.3
1+
4.5.4

doc/subscriptions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ the subscriptions to those listeners.
1313
Subscriptions are created by calling the `Request::subscribe` method in
1414
[GraphQLService.h](../include/graphqlservice/GraphQLService.h):
1515
```cpp
16-
GRAPHQLSERVICE_EXPORT [[nodiscard("leaked subscription")]] AwaitableSubscribe subscribe(RequestSubscribeParams params);
16+
[[nodiscard("leaked subscription")]] GRAPHQLSERVICE_EXPORT AwaitableSubscribe subscribe(RequestSubscribeParams params);
1717
```
1818
1919
You need to fill in a `RequestSubscribeParams` struct with the subscription event
@@ -64,7 +64,7 @@ The `internal::Awaitable<T>` template is described in [awaitable.md](./awaitable
6464
Subscriptions are removed by calling the `Request::unsubscribe` method in
6565
[GraphQLService.h](../include/graphqlservice/GraphQLService.h):
6666
```cpp
67-
GRAPHQLSERVICE_EXPORT [[nodiscard("potentially leaked subscription")]] AwaitableUnsubscribe unsubscribe(RequestUnsubscribeParams params);
67+
[[nodiscard("potentially leaked subscription")]] GRAPHQLSERVICE_EXPORT AwaitableUnsubscribe unsubscribe(RequestUnsubscribeParams params);
6868
```
6969
7070
You need to fill in a `RequestUnsubscribeParams` struct with the `SubscriptionKey`
@@ -186,6 +186,6 @@ that, there's a public `Request::findOperationDefinition` method which returns
186186
the operation type as a `std::string_view` along with a pointer to the AST node
187187
for the selected operation in the parsed query:
188188
```cpp
189-
GRAPHQLSERVICE_EXPORT [[nodiscard("unnecessary call")]] std::pair<std::string_view, const peg::ast_node*>
189+
[[nodiscard("unnecessary call")]] GRAPHQLSERVICE_EXPORT std::pair<std::string_view, const peg::ast_node*>
190190
findOperationDefinition(peg::ast& query, std::string_view operationName) const;
191191
```

include/Validation.h

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ using ValidateArgumentVariant = std::variant<ValidateArgumentVariable, int, doub
8585

8686
struct [[nodiscard("unnecessary construction")]] ValidateArgumentValue
8787
{
88-
ValidateArgumentValue(ValidateArgumentVariable && value);
88+
ValidateArgumentValue(ValidateArgumentVariable&& value);
8989
ValidateArgumentValue(int value);
9090
ValidateArgumentValue(double value);
9191
ValidateArgumentValue(std::string_view value);
9292
ValidateArgumentValue(bool value);
93-
ValidateArgumentValue(ValidateArgumentEnumValue && value);
94-
ValidateArgumentValue(ValidateArgumentList && value);
95-
ValidateArgumentValue(ValidateArgumentMap && value);
93+
ValidateArgumentValue(ValidateArgumentEnumValue&& value);
94+
ValidateArgumentValue(ValidateArgumentList&& value);
95+
ValidateArgumentValue(ValidateArgumentMap&& value);
9696

9797
ValidateArgumentVariant data;
9898
};
@@ -102,7 +102,7 @@ struct [[nodiscard("unnecessary construction")]] ValidateArgumentValue
102102
class [[nodiscard("unnecessary construction")]] ValidateArgumentValueVisitor
103103
{
104104
public:
105-
ValidateArgumentValueVisitor(std::list<schema_error> & errors);
105+
ValidateArgumentValueVisitor(std::list<schema_error>& errors);
106106

107107
void visit(const peg::ast_node& value);
108108

@@ -127,10 +127,8 @@ using ValidateFieldArguments = internal::string_view_map<ValidateArgumentValuePt
127127

128128
struct [[nodiscard("unnecessary construction")]] ValidateField
129129
{
130-
ValidateField(ValidateType && returnType,
131-
ValidateType && objectType,
132-
std::string_view fieldName,
133-
ValidateFieldArguments && arguments);
130+
ValidateField(ValidateType&& returnType, ValidateType&& objectType, std::string_view fieldName,
131+
ValidateFieldArguments&& arguments);
134132

135133
[[nodiscard("unnecessary call")]] bool operator==(const ValidateField& other) const;
136134

@@ -147,8 +145,8 @@ using ValidateTypes = internal::string_view_map<ValidateType>;
147145
class [[nodiscard("unnecessary construction")]] ValidateVariableTypeVisitor
148146
{
149147
public:
150-
ValidateVariableTypeVisitor(const std::shared_ptr<schema::Schema>& schema,
151-
const ValidateTypes& types);
148+
ValidateVariableTypeVisitor(
149+
const std::shared_ptr<schema::Schema>& schema, const ValidateTypes& types);
152150

153151
void visit(const peg::ast_node& typeName);
154152

@@ -176,7 +174,7 @@ class [[nodiscard("unnecessary construction")]] ValidateExecutableVisitor
176174

177175
GRAPHQLSERVICE_EXPORT void visit(const peg::ast_node& root);
178176

179-
GRAPHQLSERVICE_EXPORT [[nodiscard("unnecessary construction")]] std::list<schema_error>
177+
[[nodiscard("unnecessary construction")]] GRAPHQLSERVICE_EXPORT std::list<schema_error>
180178
getStructuredErrors();
181179

182180
private:
@@ -201,12 +199,11 @@ class [[nodiscard("unnecessary construction")]] ValidateExecutableVisitor
201199
[[nodiscard("unnecessary call")]] static const ValidateType& getValidateFieldType(
202200
const InputFieldTypes::mapped_type& value);
203201
template <class _FieldTypes>
204-
[[nodiscard("unnecessary call")]] static ValidateType getFieldType(const _FieldTypes& fields,
205-
std::string_view name);
202+
[[nodiscard("unnecessary call")]] static ValidateType getFieldType(
203+
const _FieldTypes& fields, std::string_view name);
206204
template <class _FieldTypes>
207205
[[nodiscard("unnecessary call")]] static ValidateType getWrappedFieldType(
208-
const _FieldTypes& fields,
209-
std::string_view name);
206+
const _FieldTypes& fields, std::string_view name);
210207

211208
void visitFragmentDefinition(const peg::ast_node& fragmentDefinition);
212209
void visitOperationDefinition(const peg::ast_node& operationDefinition);
@@ -217,15 +214,13 @@ class [[nodiscard("unnecessary construction")]] ValidateExecutableVisitor
217214
void visitFragmentSpread(const peg::ast_node& fragmentSpread);
218215
void visitInlineFragment(const peg::ast_node& inlineFragment);
219216

220-
void visitDirectives(introspection::DirectiveLocation location,
221-
const peg::ast_node& directives);
217+
void visitDirectives(
218+
introspection::DirectiveLocation location, const peg::ast_node& directives);
222219

223220
[[nodiscard("unnecessary call")]] bool validateInputValue(bool hasNonNullDefaultValue,
224-
const ValidateArgumentValuePtr& argument,
225-
const ValidateType& type);
221+
const ValidateArgumentValuePtr& argument, const ValidateType& type);
226222
[[nodiscard("unnecessary call")]] bool validateVariableType(bool isNonNull,
227-
const ValidateType& variableType,
228-
const schema_location& position,
223+
const ValidateType& variableType, const schema_location& position,
229224
const ValidateType& inputType);
230225

231226
const std::shared_ptr<schema::Schema> _schema;

include/graphqlservice/GraphQLClient.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct [[nodiscard("unnecessary construction")]] ServiceResponse
5959
};
6060

6161
// Split a service response into separate ServiceResponse data and errors members.
62-
GRAPHQLCLIENT_EXPORT [[nodiscard("unnecessary conversion")]] ServiceResponse parseServiceResponse(
62+
[[nodiscard("unnecessary conversion")]] GRAPHQLCLIENT_EXPORT ServiceResponse parseServiceResponse(
6363
response::Value response);
6464

6565
// GraphQL types are nullable by default, but they may be wrapped with non-null or list types.
@@ -105,22 +105,19 @@ concept ScalarVariableClass = std::is_same_v<Type, std::string>
105105

106106
// Any non-scalar class used in a variable is a generated INPUT_OBJECT type.
107107
template <typename Type>
108-
concept InputVariableClass = std::is_class_v<Type> && !
109-
ScalarVariableClass<Type>;
108+
concept InputVariableClass = std::is_class_v<Type> && !ScalarVariableClass<Type>;
110109

111110
// Test if there are any non-None modifiers left.
112111
template <TypeModifier... Other>
113112
concept OnlyNoneModifiers = (... && (Other == TypeModifier::None));
114113

115114
// Test if the next modifier is Nullable.
116115
template <TypeModifier Modifier>
117-
concept NullableModifier = Modifier ==
118-
TypeModifier::Nullable;
116+
concept NullableModifier = Modifier == TypeModifier::Nullable;
119117

120118
// Test if the next modifier is List.
121119
template <TypeModifier Modifier>
122-
concept ListModifier = Modifier ==
123-
TypeModifier::List;
120+
concept ListModifier = Modifier == TypeModifier::List;
124121

125122
// Special-case an innermost nullable INPUT_OBJECT type.
126123
template <typename Type, TypeModifier... Other>

include/graphqlservice/GraphQLParse.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ struct [[nodiscard("unnecessary parse")]] ast
3838
// another value for the depthLimit parameter in these parse functions.
3939
constexpr size_t c_defaultDepthLimit = 25;
4040

41-
GRAPHQLPEG_EXPORT [[nodiscard("unnecessary parse")]] ast parseSchemaString(
41+
[[nodiscard("unnecessary parse")]] GRAPHQLPEG_EXPORT ast parseSchemaString(
4242
std::string_view input, size_t depthLimit = c_defaultDepthLimit);
43-
GRAPHQLPEG_EXPORT [[nodiscard("unnecessary parse")]] ast parseSchemaFile(
43+
[[nodiscard("unnecessary parse")]] GRAPHQLPEG_EXPORT ast parseSchemaFile(
4444
std::string_view filename, size_t depthLimit = c_defaultDepthLimit);
4545

46-
GRAPHQLPEG_EXPORT [[nodiscard("unnecessary parse")]] ast parseString(
46+
[[nodiscard("unnecessary parse")]] GRAPHQLPEG_EXPORT ast parseString(
4747
std::string_view input, size_t depthLimit = c_defaultDepthLimit);
48-
GRAPHQLPEG_EXPORT [[nodiscard("unnecessary parse")]] ast parseFile(
48+
[[nodiscard("unnecessary parse")]] GRAPHQLPEG_EXPORT ast parseFile(
4949
std::string_view filename, size_t depthLimit = c_defaultDepthLimit);
5050

5151
} // namespace peg
5252

53-
GRAPHQLPEG_EXPORT [[nodiscard("unnecessary parse")]] peg::ast operator"" _graphql(
53+
[[nodiscard("unnecessary parse")]] GRAPHQLPEG_EXPORT peg::ast operator"" _graphql(
5454
const char* text, size_t size);
5555

5656
} // namespace graphql

0 commit comments

Comments
 (0)