Skip to content

Commit

Permalink
Move default of PCRE2_CALL_CONVENTION from pcre2posix.c to pcre2posix.h
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipHazel committed Dec 9, 2022
1 parent 7c49b40 commit cd8dc40
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
14 changes: 0 additions & 14 deletions src/pcre2posix.c
Expand Up @@ -92,20 +92,6 @@ changed. This #define is a copy of the one in pcre2_internal.h. */
#include "pcre2.h"
#include "pcre2posix.h"

/* When compiling with the MSVC compiler, it is sometimes necessary to include
a "calling convention" before exported function names. (This is secondhand
information; I know nothing about MSVC myself). For example, something like
void __cdecl function(....)
might be needed. In order to make this easy, all the exported functions have
PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not
set, we ensure here that it has no effect. */

#ifndef PCRE2_CALL_CONVENTION
#define PCRE2_CALL_CONVENTION
#endif

/* Table to translate PCRE2 compile time error codes into POSIX error codes.
Only a few PCRE2 errors with a value greater than 23 turn into special POSIX
codes: most go to REG_BADPAT. The second table lists, in pairs, those that
Expand Down
16 changes: 15 additions & 1 deletion src/pcre2posix.h
Expand Up @@ -9,7 +9,7 @@ POSIX wrapper interface.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2019 University of Cambridge
New API code Copyright (c) 2016-2022 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -116,6 +116,20 @@ typedef struct {
regoff_t rm_eo;
} regmatch_t;

/* When compiling with the MSVC compiler, it is sometimes necessary to include
a "calling convention" before exported function names. (This is secondhand
information; I know nothing about MSVC myself). For example, something like
void __cdecl function(....)
might be needed. In order to make this easy, all the exported functions have
PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not
set, we ensure here that it has no effect. */

#ifndef PCRE2_CALL_CONVENTION
#define PCRE2_CALL_CONVENTION
#endif

/* When an application links to a PCRE2 DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE2, the appropriate
export settings are needed, and are set in pcre2posix.c before including this
Expand Down

0 comments on commit cd8dc40

Please sign in to comment.