Skip to content

Commit 99470b4

Browse files
committed
uri: Update to uriparser-0.9.9-59-gc3b4956
This is specifically to backport uriparser/uriparser#276. Fixes #20431.
1 parent a0b918d commit 99470b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+9337
-9899
lines changed

ext/uri/uriparser/include/uriparser/Uri.h

Lines changed: 355 additions & 483 deletions
Large diffs are not rendered by default.

ext/uri/uriparser/include/uriparser/UriBase.h

Lines changed: 123 additions & 147 deletions
Large diffs are not rendered by default.

ext/uri/uriparser/include/uriparser/UriDefsAnsi.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,18 @@
4646
/* Allow multi inclusion */
4747
#include "UriDefsConfig.h"
4848

49-
50-
5149
#undef URI_CHAR
5250
#define URI_CHAR char
5351

5452
#undef _UT
5553
#define _UT(x) x
5654

57-
58-
5955
#undef URI_FUNC
6056
#define URI_FUNC(x) uri##x##A
6157

6258
#undef URI_TYPE
6359
#define URI_TYPE(x) Uri##x##A
6460

65-
66-
6761
#undef URI_STRLEN
6862
#define URI_STRLEN strlen
6963
#undef URI_STRCPY
@@ -76,7 +70,7 @@
7670
/* TODO Remove on next source-compatibility break */
7771
#undef URI_SNPRINTF
7872
#if (defined(__WIN32__) || defined(_WIN32) || defined(WIN32))
79-
# define URI_SNPRINTF _snprintf
73+
# define URI_SNPRINTF _snprintf
8074
#else
81-
# define URI_SNPRINTF snprintf
75+
# define URI_SNPRINTF snprintf
8276
#endif

ext/uri/uriparser/include/uriparser/UriDefsConfig.h

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -43,59 +43,51 @@
4343
*/
4444

4545
#ifndef URI_DEFS_CONFIG_H
46-
#define URI_DEFS_CONFIG_H 1
47-
48-
46+
# define URI_DEFS_CONFIG_H 1
4947

5048
/* Deny external overriding */
51-
#undef URI_ENABLE_ANSI /* Internal for !URI_NO_ANSI */
52-
#undef URI_ENABLE_UNICODE /* Internal for !URI_NO_UNICODE */
53-
54-
49+
# undef URI_ENABLE_ANSI /* Internal for !URI_NO_ANSI */
50+
# undef URI_ENABLE_UNICODE /* Internal for !URI_NO_UNICODE */
5551

5652
/* Encoding */
57-
#ifdef URI_NO_ANSI
58-
# ifdef URI_NO_UNICODE
53+
# ifdef URI_NO_ANSI
54+
# ifdef URI_NO_UNICODE
5955
/* No encoding at all */
60-
# error URI_NO_ANSI and URI_NO_UNICODE cannot go together.
61-
# else
56+
# error URI_NO_ANSI and URI_NO_UNICODE cannot go together.
57+
# else
6258
/* Wide strings only */
63-
# define URI_ENABLE_UNICODE 1
64-
# endif
65-
#else
66-
# ifdef URI_NO_UNICODE
59+
# define URI_ENABLE_UNICODE 1
60+
# endif
61+
# else
62+
# ifdef URI_NO_UNICODE
6763
/* Narrow strings only */
68-
# define URI_ENABLE_ANSI 1
69-
# else
64+
# define URI_ENABLE_ANSI 1
65+
# else
7066
/* Both narrow and wide strings */
71-
# define URI_ENABLE_ANSI 1
72-
# define URI_ENABLE_UNICODE 1
73-
# endif
74-
#endif
75-
76-
67+
# define URI_ENABLE_ANSI 1
68+
# define URI_ENABLE_UNICODE 1
69+
# endif
70+
# endif
7771

7872
/* Function inlining, not ANSI/ISO C! */
79-
#if defined(URI_DOXYGEN)
80-
# define URI_INLINE
81-
#elif defined(__INTEL_COMPILER)
73+
# if defined(URI_DOXYGEN)
74+
# define URI_INLINE
75+
# elif defined(__INTEL_COMPILER)
8276
/* Intel C/C++ */
8377
/* http://predef.sourceforge.net/precomp.html#sec20 */
8478
/* http://www.intel.com/support/performancetools/c/windows/sb/CS-007751.htm#2 */
85-
# define URI_INLINE __forceinline
86-
#elif defined(_MSC_VER)
79+
# define URI_INLINE __forceinline
80+
# elif defined(_MSC_VER)
8781
/* Microsoft Visual C++ */
8882
/* http://predef.sourceforge.net/precomp.html#sec32 */
8983
/* http://msdn2.microsoft.com/en-us/library/ms882281.aspx */
90-
# define URI_INLINE __forceinline
91-
#elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
84+
# define URI_INLINE __forceinline
85+
# elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
9286
/* C99, "inline" is a keyword */
93-
# define URI_INLINE inline
94-
#else
87+
# define URI_INLINE inline
88+
# else
9589
/* No inlining */
96-
# define URI_INLINE
97-
#endif
98-
99-
90+
# define URI_INLINE
91+
# endif
10092

10193
#endif /* URI_DEFS_CONFIG_H */

ext/uri/uriparser/include/uriparser/UriDefsUnicode.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,18 @@
4646
/* Allow multi inclusion */
4747
#include "UriDefsConfig.h"
4848

49-
50-
5149
#undef URI_CHAR
5250
#define URI_CHAR wchar_t
5351

5452
#undef _UT
5553
#define _UT(x) L##x
5654

57-
58-
5955
#undef URI_FUNC
6056
#define URI_FUNC(x) uri##x##W
6157

6258
#undef URI_TYPE
6359
#define URI_TYPE(x) Uri##x##W
6460

65-
66-
6761
#undef URI_STRLEN
6862
#define URI_STRLEN wcslen
6963
#undef URI_STRCPY
@@ -76,7 +70,7 @@
7670
/* TODO Remove on next source-compatibility break */
7771
#undef URI_SNPRINTF
7872
#if (defined(__WIN32__) || defined(_WIN32) || defined(WIN32))
79-
# define URI_SNPRINTF _snwprintf
73+
# define URI_SNPRINTF _snwprintf
8074
#else
81-
# define URI_SNPRINTF swprintf
75+
# define URI_SNPRINTF swprintf
8276
#endif

ext/uri/uriparser/include/uriparser/UriIp4.h

Lines changed: 37 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -44,48 +44,43 @@
4444
*/
4545

4646
#if (defined(URI_PASS_ANSI) && !defined(URI_IP4_TWICE_H_ANSI)) \
47-
|| (defined(URI_PASS_UNICODE) && !defined(URI_IP4_TWICE_H_UNICODE)) \
48-
|| (!defined(URI_PASS_ANSI) && !defined(URI_PASS_UNICODE))
47+
|| (defined(URI_PASS_UNICODE) && !defined(URI_IP4_TWICE_H_UNICODE)) \
48+
|| (!defined(URI_PASS_ANSI) && !defined(URI_PASS_UNICODE))
4949
/* What encodings are enabled? */
50-
#include "UriDefsConfig.h"
51-
#if (!defined(URI_PASS_ANSI) && !defined(URI_PASS_UNICODE))
50+
# include "UriDefsConfig.h"
51+
# if (!defined(URI_PASS_ANSI) && !defined(URI_PASS_UNICODE))
5252
/* Include SELF twice */
53-
# ifdef URI_ENABLE_ANSI
54-
# define URI_PASS_ANSI 1
55-
# include "UriIp4.h"
56-
# undef URI_PASS_ANSI
57-
# endif
58-
# ifdef URI_ENABLE_UNICODE
59-
# define URI_PASS_UNICODE 1
60-
# include "UriIp4.h"
61-
# undef URI_PASS_UNICODE
62-
# endif
53+
# ifdef URI_ENABLE_ANSI
54+
# define URI_PASS_ANSI 1
55+
# include "UriIp4.h"
56+
# undef URI_PASS_ANSI
57+
# endif
58+
# ifdef URI_ENABLE_UNICODE
59+
# define URI_PASS_UNICODE 1
60+
# include "UriIp4.h"
61+
# undef URI_PASS_UNICODE
62+
# endif
6363
/* Only one pass for each encoding */
64-
#elif (defined(URI_PASS_ANSI) && !defined(URI_IP4_TWICE_H_ANSI) \
65-
&& defined(URI_ENABLE_ANSI)) || (defined(URI_PASS_UNICODE) \
66-
&& !defined(URI_IP4_TWICE_H_UNICODE) && defined(URI_ENABLE_UNICODE))
67-
# ifdef URI_PASS_ANSI
68-
# define URI_IP4_TWICE_H_ANSI 1
69-
# include "UriDefsAnsi.h"
70-
# else
71-
# define URI_IP4_TWICE_H_UNICODE 1
72-
# include "UriDefsUnicode.h"
73-
# include <wchar.h>
74-
# endif
75-
76-
77-
78-
#ifdef __cplusplus
64+
# elif (defined(URI_PASS_ANSI) && !defined(URI_IP4_TWICE_H_ANSI) \
65+
&& defined(URI_ENABLE_ANSI)) \
66+
|| (defined(URI_PASS_UNICODE) && !defined(URI_IP4_TWICE_H_UNICODE) \
67+
&& defined(URI_ENABLE_UNICODE))
68+
# ifdef URI_PASS_ANSI
69+
# define URI_IP4_TWICE_H_ANSI 1
70+
# include "UriDefsAnsi.h"
71+
# else
72+
# define URI_IP4_TWICE_H_UNICODE 1
73+
# include "UriDefsUnicode.h"
74+
# include <wchar.h>
75+
# endif
76+
77+
# ifdef __cplusplus
7978
extern "C" {
80-
#endif
81-
82-
83-
84-
#ifndef URI_DOXYGEN
85-
# include "UriBase.h"
86-
#endif
87-
79+
# endif
8880

81+
# ifndef URI_DOXYGEN
82+
# include "UriBase.h"
83+
# endif
8984

9085
/**
9186
* Converts an IPv4 text representation into four bytes.
@@ -99,15 +94,12 @@ extern "C" {
9994
* @see uriParseIpSixAddressMmA
10095
*/
10196
URI_PUBLIC int URI_FUNC(ParseIpFourAddress)(unsigned char * octetOutput,
102-
const URI_CHAR * first, const URI_CHAR * afterLast);
103-
97+
const URI_CHAR * first,
98+
const URI_CHAR * afterLast);
10499

105-
106-
#ifdef __cplusplus
100+
# ifdef __cplusplus
107101
}
108-
#endif
102+
# endif
109103

110-
111-
112-
#endif
104+
# endif
113105
#endif

0 commit comments

Comments
 (0)