summaryrefslogtreecommitdiff
path: root/pcreposix.h
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-04-04 14:06:52 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-04-04 14:06:52 +0000
commit765b484a8ea8410faa15130c965d56b81eff29d6 (patch)
tree5c81c25f181ff13a5e1016cd9d967df2fd14e42b /pcreposix.h
parent538ef4f8d6632b422169714282844c34b4bfc271 (diff)
downloadpcre-765b484a8ea8410faa15130c965d56b81eff29d6.tar.gz
Reworked all the WIN32 __declspec stuff in the hope of getting it right.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@145 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcreposix.h')
-rw-r--r--pcreposix.h38
1 files changed, 17 insertions, 21 deletions
diff --git a/pcreposix.h b/pcreposix.h
index 04782de..cca559b 100644
--- a/pcreposix.h
+++ b/pcreposix.h
@@ -105,40 +105,36 @@ typedef struct {
regoff_t rm_eo;
} regmatch_t;
-/* Win32 uses DLL by default; it needs special stuff for exported functions
-when building PCRE. */
+/* When an application links to a PCRE DLL in Windows, the symbols that are
+imported have to be identified as such. When building PCRE, the appropriate
+export settings are needed. */
-#ifndef PCRE_DATA_SCOPE
#ifdef _WIN32
-# ifdef PCRE_DEFINITION
-# ifdef DLL_EXPORT
-# define PCRE_DATA_SCOPE __declspec(dllexport)
-# endif
-# else
-# ifndef PCRE_STATIC
-# define PCRE_DATA_SCOPE extern __declspec(dllimport)
-# endif
+# ifndef PCREPOSIX_STATIC
+# define PCREPOSIX_EXP_DECL extern __declspec(dllimport)
+# define PCREPOSIX_EXP_DEFN __declspec(dllimport)
# endif
#endif
-#endif
-/* Otherwise, we use the standard "extern". */
+/* By default, we use the standard "extern" declarations. */
-#ifndef PCRE_DATA_SCOPE
+#ifndef PCREPOSIX_EXP_DECL
# ifdef __cplusplus
-# define PCRE_DATA_SCOPE extern "C"
+# define PCREPOSIX_EXP_DECL extern "C"
+# define PCREPOSIX_EXP_DEFN extern "C"
# else
-# define PCRE_DATA_SCOPE extern
+# define PCREPOSIX_EXP_DECL extern
+# define PCREPOSIX_EXP_DEFN extern
# endif
#endif
/* The functions */
-PCRE_DATA_SCOPE int regcomp(regex_t *, const char *, int);
-PCRE_DATA_SCOPE int regexec(const regex_t *, const char *, size_t,
- regmatch_t *, int);
-PCRE_DATA_SCOPE size_t regerror(int, const regex_t *, char *, size_t);
-PCRE_DATA_SCOPE void regfree(regex_t *);
+PCREPOSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
+PCREPOSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
+ regmatch_t *, int);
+PCREPOSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
+PCREPOSIX_EXP_DECL void regfree(regex_t *);
#ifdef __cplusplus
} /* extern "C" */