wrowe       00/10/11 10:05:07

  Modified:    src/lib/apr/include apr.h.in apr.hw
  Log:
    Take Greg's criticism very literally.  EXPORT (when it's really IMPORT)
    is a true Lewis Carrollism.  This patch replaces the following:
  
      APR_EXPORT()        -> APR_DECLARE()         This is a public fn
      APR_EXPORT_NONSTD() -> APR_DECLARE_NONSTD()  This is a varargs fn
      APR_VAR_EXPORT      -> APR_DECLARE_DATA      These are public vars
      APR_VAR_IMPORT      -> APR_DECLARE_DATA      ditto
  
      APR_EXPORT_SYMBOLS  -> APR_DECLARE_EXPORT    Compile the lib to export
      APR_STATIC          -> APR_DECLARE_STATIC    Compile:linked to the .lib
      no define                                    Compile:linked to the .dll
  
    The old symbols are retained in-place.  I will wait for the firestorm
    of controversy to die before we actually use these symbols in the APR,
    or will back out the new names under CtR
  
  Submitted by:  Greg Stein
  Reviewed by:   William Rowe
  
  Revision  Changes    Path
  1.43      +15 -4     apache-2.0/src/lib/apr/include/apr.h.in
  
  Index: apr.h.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr.h.in,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- apr.h.in  2000/09/22 11:37:06     1.42
  +++ apr.h.in  2000/10/11 17:05:06     1.43
  @@ -123,10 +123,21 @@
   /* Definitions that APR programs need to work properly. */
   
   #define APR_THREAD_FUNC
  -#define APR_EXPORT(type)         type
  -#define APR_EXPORT_NONSTD(type)  type
  -#define APR_VAR_IMPORT           extern
  -#define APR_VAR_EXPORT
  +
  +/* Create a set of APR_DECLARE(type), APR_DECLARE_NONSTD(type) and 
  + * APR_DECLARE_DATA with appropriate export and import tags for the platform.
  + * Simple case - see apr.hw for the complex example
  + */
  +#define APR_DECLARE(type)            type
  +#define APR_DECLARE_NONSTD(type)     type
  +#define APR_DECLARE_DATA
  +
  +/* These need to move into apr_compat.h when the symbol rename is complete 
  + */
  +#define APR_EXPORT(t)         APR_DECLARE(t)
  +#define APR_EXPORT_NONSTD(t)  APR_DECLARE_NONSTD(t)
  +#define APR_VAR_EXPORT        APR_DECLARE_DATA
  +#define APR_VAR_IMPORT        APR_DECLARE_DATA
   
   /* Define APR_SSIZE_T_FMT.  
    * If ssize_t is an integer we define it to be "d",
  
  
  
  1.27      +26 -16    apache-2.0/src/lib/apr/include/apr.hw
  
  Index: apr.hw
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr.hw,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- apr.hw    2000/09/22 11:37:06     1.26
  +++ apr.hw    2000/10/11 17:05:06     1.27
  @@ -179,24 +179,34 @@
   /* Local machine definition for console and log output. */
   #define APR_EOL_STR              "\r\n"
   
  -#if !defined(WIN32) || defined(APR_STATIC)
  -/* Default Non-WIN32 behavior removes all MSVCisms */
  -#define APR_EXPORT(type)         type
  -#define APR_EXPORT_NONSTD(type)  type
  -#define APR_VAR_EXPORT
  -#define APR_VAR_IMPORT           extern
  -#elif defined(APR_EXPORT_SYMBOLS)
  -#define APR_EXPORT(type)         __declspec(dllexport) type 
  -#define APR_EXPORT_NONSTD(type)  __declspec(dllexport) type 
  -#define APR_VAR_EXPORT           __declspec(dllexport)
  -#define APR_VAR_IMPORT           extern __declspec(dllexport)
  +/* Create a set of APR_DECLARE(type), APR_DECLARE_NONSTD(type) and 
  + * APR_DECLARE_DATA with appropriate export and import tags for the platform
  + */
  +#if !defined(WIN32)
  +#define APR_DECLARE(type)            type
  +#define APR_DECLARE_NONSTD(type)     type
  +#define APR_DECLARE_DATA
  +#elif defined(APR_DECLARE_STATIC)
  +#define APR_DECLARE(type)            type __stdcall
  +#define APR_DECLARE_NONSTD(type)     type
  +#define APR_DECLARE_DATA
  +#elif defined(APR_DECLARE_EXPORT)
  +#define APR_DECLARE(type)            __declspec(dllexport) type __stdcall
  +#define APR_DECLARE_NONSTD(type)     __declspec(dllexport) type
  +#define APR_DECLARE_DATA             __declspec(dllexport)
   #else
  -/* Default WIN32 behavior is to import the shared .dll */
  -#define APR_EXPORT(type)         __declspec(dllimport) type 
  -#define APR_EXPORT_NONSTD(type)  __declspec(dllimport) type 
  -#define APR_VAR_EXPORT           __declspec(dllimport)
  -#define APR_VAR_IMPORT           extern __declspec(dllimport)
  +#define APR_DECLARE(type)            __declspec(dllimport) type __stdcall
  +#define APR_DECLARE_NONSTD(type)     __declspec(dllimport) type
  +#define APR_DECLARE_DATA             __declspec(dllimport)
   #endif
  +
  +/* These need to move into apr_compat.h when the symbol rename is complete 
  + */
  +#define APR_EXPORT(t)         APR_DECLARE(t)
  +#define APR_EXPORT_NONSTD(t)  APR_DECLARE_NONSTD(t)
  +#define APR_VAR_EXPORT        APR_DECLARE_DATA
  +#define APR_VAR_IMPORT        APR_DECLARE_DATA
  +
   
   #define apr_signal(a,b) signal(a,b)
   
  
  
  

Reply via email to