Skip to content

Commit cd8dc40

Browse files
committed
Move default of PCRE2_CALL_CONVENTION from pcre2posix.c to pcre2posix.h
1 parent 7c49b40 commit cd8dc40

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/pcre2posix.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,6 @@ changed. This #define is a copy of the one in pcre2_internal.h. */
9292
#include "pcre2.h"
9393
#include "pcre2posix.h"
9494

95-
/* When compiling with the MSVC compiler, it is sometimes necessary to include
96-
a "calling convention" before exported function names. (This is secondhand
97-
information; I know nothing about MSVC myself). For example, something like
98-
99-
void __cdecl function(....)
100-
101-
might be needed. In order to make this easy, all the exported functions have
102-
PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not
103-
set, we ensure here that it has no effect. */
104-
105-
#ifndef PCRE2_CALL_CONVENTION
106-
#define PCRE2_CALL_CONVENTION
107-
#endif
108-
10995
/* Table to translate PCRE2 compile time error codes into POSIX error codes.
11096
Only a few PCRE2 errors with a value greater than 23 turn into special POSIX
11197
codes: most go to REG_BADPAT. The second table lists, in pairs, those that

src/pcre2posix.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ POSIX wrapper interface.
99
1010
Written by Philip Hazel
1111
Original API code Copyright (c) 1997-2012 University of Cambridge
12-
New API code Copyright (c) 2016-2019 University of Cambridge
12+
New API code Copyright (c) 2016-2022 University of Cambridge
1313
1414
-----------------------------------------------------------------------------
1515
Redistribution and use in source and binary forms, with or without
@@ -116,6 +116,20 @@ typedef struct {
116116
regoff_t rm_eo;
117117
} regmatch_t;
118118

119+
/* When compiling with the MSVC compiler, it is sometimes necessary to include
120+
a "calling convention" before exported function names. (This is secondhand
121+
information; I know nothing about MSVC myself). For example, something like
122+
123+
void __cdecl function(....)
124+
125+
might be needed. In order to make this easy, all the exported functions have
126+
PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not
127+
set, we ensure here that it has no effect. */
128+
129+
#ifndef PCRE2_CALL_CONVENTION
130+
#define PCRE2_CALL_CONVENTION
131+
#endif
132+
119133
/* When an application links to a PCRE2 DLL in Windows, the symbols that are
120134
imported have to be identified as such. When building PCRE2, the appropriate
121135
export settings are needed, and are set in pcre2posix.c before including this

0 commit comments

Comments
 (0)