/[pcre]/code/trunk/pcrecpp_internal.h
ViewVC logotype

Diff of /code/trunk/pcrecpp_internal.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 199 by ph10, Tue Jul 31 14:39:09 2007 UTC revision 200 by ph10, Wed Aug 1 09:10:40 2007 UTC
# Line 1  Line 1 
1    /*************************************************
2    *       Perl-Compatible Regular Expressions      *
3    *************************************************/
4    
5    /*
6    -----------------------------------------------------------------------------
7    Redistribution and use in source and binary forms, with or without
8    modification, are permitted provided that the following conditions are met:
9    
10        * Redistributions of source code must retain the above copyright notice,
11          this list of conditions and the following disclaimer.
12    
13        * Redistributions in binary form must reproduce the above copyright
14          notice, this list of conditions and the following disclaimer in the
15          documentation and/or other materials provided with the distribution.
16    
17        * Neither the name of the University of Cambridge nor the names of its
18          contributors may be used to endorse or promote products derived from
19          this software without specific prior written permission.
20    
21    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31    POSSIBILITY OF SUCH DAMAGE.
32    -----------------------------------------------------------------------------
33    */
34    
35    
36  #ifndef PCRECPP_INTERNAL_H  #ifndef PCRECPP_INTERNAL_H
37  #define PCRECPP_INTERNAL_H  #define PCRECPP_INTERNAL_H
38    
# Line 6  using some MS magic. I found some useful Line 41  using some MS magic. I found some useful
41  http://msdn2.microsoft.com/en-us/library/y4h7bcy6(VS.80).aspx. According to the  http://msdn2.microsoft.com/en-us/library/y4h7bcy6(VS.80).aspx. According to the
42  information there, using __declspec(dllexport) without "extern" we have a  information there, using __declspec(dllexport) without "extern" we have a
43  definition; with "extern" we have a declaration. The settings here override the  definition; with "extern" we have a declaration. The settings here override the
44  setting in pcrecpp.h; it defines only PCRECPP_EXP_DECL, which is all that is  setting in pcre.h. We use:
 needed for applications (they just import the symbols). We use:  
45    
46    PCRECPP_EXP_DECL       for declarations    PCRECPP_EXP_DECL       for declarations
47    PCRECPP_EXP_DEFN       for definitions of exported functions    PCRECPP_EXP_DEFN       for definitions of exported functions
   PCRECPP_EXP_DATA_DEFN  for definitions of exported variables  
48    
49  The reason for the two DEFN macros is that in non-Windows environments, one  */
 does not want to have "extern" before variable definitions because it leads to  
 compiler warnings. So we distinguish between functions and variables. In  
 Windows, the two should always be the same.  
   
 The reason for wrapping this in #ifndef PCRECPP_EXP_DECL is so that pcretest,  
 which is an application, but needs to import this file in order to "peek" at  
 internals, can #include pcre.h first to get an application's-eye view.  
   
 In principle, people compiling for non-Windows, non-Unix-like (i.e. uncommon,  
 special-purpose environments) might want to stick other stuff in front of  
 exported symbols. That's why, in the non-Windows case, we set PCRECPP_EXP_DEFN and  
 PCRECPP_EXP_DATA_DEFN only if they are not already set. */  
50    
51  #ifndef PCRECPP_EXP_DECL  #ifndef PCRECPP_EXP_DECL
52  #  ifdef _WIN32  #  ifdef _WIN32
53  #    ifndef PCRECPP_STATIC  #    ifndef PCRECPP_STATIC
54  #      define PCRECPP_EXP_DECL       extern __declspec(dllexport)  #      define PCRECPP_EXP_DECL       extern __declspec(dllexport)
55  #      define PCRECPP_EXP_DEFN       __declspec(dllexport)  #      define PCRECPP_EXP_DEFN       __declspec(dllexport)
 #      define PCRECPP_EXP_DATA_DEFN  __declspec(dllexport)  
56  #    else  #    else
57  #      define PCRECPP_EXP_DECL       extern  #      define PCRECPP_EXP_DECL       extern
58  #      define PCRECPP_EXP_DEFN  #      define PCRECPP_EXP_DEFN
 #      define PCRECPP_EXP_DATA_DEFN  
59  #    endif  #    endif
60  #  else  #  else
61  #    define PCRECPP_EXP_DECL  #    define PCRECPP_EXP_DECL         extern
62  #    define PCRECPP_EXP_DEFN  #    define PCRECPP_EXP_DEFN
 #    define PCRECPP_EXP_DATA_DEFN  
63  #  endif  #  endif
64  #endif  #endif
65    
66  #endif  #endif  /* PCRECPP_INTERNAL_H */
67    
68  /* End of pcrecpp_internal.h */  /* End of pcrecpp_internal.h */

Legend:
Removed from v.199  
changed lines
  Added in v.200

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12