Skip to content

Commit 1b02e31

Browse files
authored
being more restrictive with the ADA_INCLUDE_URL_PATTERN guards (#944)
1 parent 5e9d511 commit 1b02e31

12 files changed

+17
-19
lines changed

include/ada.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@
3030
#include "ada/url_search_params.h"
3131
#include "ada/url_search_params-inl.h"
3232

33-
#if ADA_INCLUDE_URL_PATTERN
3433
#include "ada/url_pattern.h"
3534
#include "ada/url_pattern-inl.h"
3635
#include "ada/url_pattern_helpers.h"
3736
#include "ada/url_pattern_helpers-inl.h"
3837
#include "ada/url_pattern_regex.h"
39-
#endif // ADA_INCLUDE_URL_PATTERN
4038

4139
// Public API
4240
#include "ada/ada_version.h"

include/ada/implementation-inl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
#ifndef ADA_IMPLEMENTATION_INL_H
55
#define ADA_IMPLEMENTATION_INL_H
66

7-
#if ADA_INCLUDE_URL_PATTERN
87
#include "ada/url_pattern_regex.h"
9-
#endif // ADA_INCLUDE_URL_PATTERN
108

119
#include "ada/expected.h"
1210
#include "ada/implementation.h"

include/ada/implementation.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
#include "ada/url.h"
1414
#include "ada/common_defs.h"
1515
#include "ada/errors.h"
16-
17-
#if ADA_INCLUDE_URL_PATTERN
1816
#include "ada/url_pattern_init.h"
19-
#endif // ADA_INCLUDE_URL_PATTERN
2017

2118
namespace ada {
2219

include/ada/parser-inl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
#define ADA_PARSER_INL_H
66

77
#include "ada/expected.h"
8-
#if ADA_INCLUDE_URL_PATTERN
98
#include "ada/url_pattern.h"
109
#include "ada/url_pattern_helpers.h"
11-
#endif // ADA_INCLUDE_URL_PATTERN
1210
#include "ada/parser.h"
1311

1412
#include <string>

include/ada/parser.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010

1111
#include "ada/expected.h"
1212

13-
#if ADA_INCLUDE_URL_PATTERN
1413
#include "ada/url_pattern_regex.h"
1514
#include "ada/url_pattern_init.h"
16-
#endif // ADA_INCLUDE_URL_PATTERN
1715

1816
/**
1917
* @private

include/ada/url_pattern-inl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <string_view>
1414
#include <utility>
1515

16+
#if ADA_INCLUDE_URL_PATTERN
1617
namespace ada {
1718

1819
inline bool url_pattern_init::operator==(const url_pattern_init& other) const {
@@ -481,5 +482,5 @@ result<std::optional<url_pattern_result>> url_pattern<regex_provider>::match(
481482
}
482483

483484
} // namespace ada
484-
485+
#endif // ADA_INCLUDE_URL_PATTERN
485486
#endif

include/ada/url_pattern.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <iostream>
2222
#endif // ADA_TESTING
2323

24+
#if ADA_INCLUDE_URL_PATTERN
2425
namespace ada {
2526

2627
enum class url_pattern_part_type : uint8_t {
@@ -353,7 +354,6 @@ class url_pattern {
353354
*/
354355
bool ignore_case_ = false;
355356
};
356-
357357
} // namespace ada
358-
358+
#endif // ADA_INCLUDE_URL_PATTERN
359359
#endif

include/ada/url_pattern_helpers-inl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "ada/url_pattern_helpers.h"
1414
#include "ada/implementation.h"
1515

16+
#if ADA_INCLUDE_URL_PATTERN
1617
namespace ada::url_pattern_helpers {
1718
#ifdef ADA_TESTING
1819
inline std::string to_string(token_type type) {
@@ -1089,5 +1090,5 @@ constructor_string_parser<regex_provider>::parse(std::string_view input) {
10891090
}
10901091

10911092
} // namespace ada::url_pattern_helpers
1092-
1093+
#endif // ADA_INCLUDE_URL_PATTERN
10931094
#endif

include/ada/url_pattern_helpers.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <tuple>
1414
#include <vector>
1515

16+
#if ADA_INCLUDE_URL_PATTERN
1617
namespace ada {
1718
enum class errors : uint8_t;
1819
}
@@ -344,5 +345,5 @@ std::string generate_segment_wildcard_regexp(
344345
url_pattern_compile_component_options options);
345346

346347
} // namespace ada::url_pattern_helpers
347-
348+
#endif // ADA_INCLUDE_URL_PATTERN
348349
#endif

include/ada/url_pattern_init.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <iostream>
1717
#endif // ADA_TESTING
1818

19+
#if ADA_INCLUDE_URL_PATTERN
1920
namespace ada {
2021

2122
// Important: C++20 allows us to use concept rather than `using` or `typedef
@@ -119,5 +120,5 @@ struct url_pattern_init {
119120
std::optional<std::string> base_url{};
120121
};
121122
} // namespace ada
122-
123+
#endif // ADA_INCLUDE_URL_PATTERN
123124
#endif // ADA_URL_PATTERN_INIT_H

0 commit comments

Comments
 (0)