浏览代码

ENH: Added DLL support.

Brad King 22 年之前
父节点
当前提交
ef76ed76f8

+ 20 - 12
Source/kwsys/Base64.h.in

@@ -17,11 +17,14 @@
 #ifndef @KWSYS_NAMESPACE@_Base64_h
 #ifndef @KWSYS_NAMESPACE@_Base64_h
 #define @KWSYS_NAMESPACE@_Base64_h
 #define @KWSYS_NAMESPACE@_Base64_h
 
 
+#include <@KWSYS_NAMESPACE@/Configure.h>
+
 /* Redefine all public interface symbol names to be in the proper
 /* Redefine all public interface symbol names to be in the proper
    namespace.  These macros are used internally to kwsys only, and are
    namespace.  These macros are used internally to kwsys only, and are
    not visible to user code.  Use kwsysHeaderDump.pl to reproduce
    not visible to user code.  Use kwsysHeaderDump.pl to reproduce
    these macros after making changes to the interface.  */
    these macros after making changes to the interface.  */
 #define kwsys(x) @KWSYS_NAMESPACE@##x
 #define kwsys(x) @KWSYS_NAMESPACE@##x
+#define kwsysEXPORT          kwsys(_EXPORT)
 #define kwsysBase64          kwsys(Base64)
 #define kwsysBase64          kwsys(Base64)
 #define kwsysBase64_Decode   kwsys(Base64_Decode)
 #define kwsysBase64_Decode   kwsys(Base64_Decode)
 #define kwsysBase64_Decode3  kwsys(Base64_Decode3)
 #define kwsysBase64_Decode3  kwsys(Base64_Decode3)
@@ -38,17 +41,20 @@ extern "C"
 /**
 /**
  * Encode 3 bytes into a 4 byte string.
  * Encode 3 bytes into a 4 byte string.
  */
  */
-void kwsysBase64_Encode3(const unsigned char *src, unsigned char *dest);
+kwsysEXPORT void kwsysBase64_Encode3(const unsigned char *src,
+                                     unsigned char *dest);
 
 
 /**
 /**
  * Encode 2 bytes into a 4 byte string.
  * Encode 2 bytes into a 4 byte string.
  */
  */
-void kwsysBase64_Encode2(const unsigned char *src, unsigned char *dest);
+kwsysEXPORT void kwsysBase64_Encode2(const unsigned char *src,
+                                     unsigned char *dest);
 
 
 /**
 /**
  * Encode 1 bytes into a 4 byte string.
  * Encode 1 bytes into a 4 byte string.
  */
  */
-void kwsysBase64_Encode1(const unsigned char *src, unsigned char *dest);
+kwsysEXPORT void kwsysBase64_Encode1(const unsigned char *src,
+                                     unsigned char *dest);
 
 
 /**
 /**
  * Encode 'length' bytes from the input buffer and store the encoded
  * Encode 'length' bytes from the input buffer and store the encoded
@@ -63,16 +69,17 @@ void kwsysBase64_Encode1(const unsigned char *src, unsigned char *dest);
  * the extra padding needed to complete the encode 4 bytes will stop
  * the extra padding needed to complete the encode 4 bytes will stop
  * the decoding anyway).
  * the decoding anyway).
  */
  */
-unsigned long kwsysBase64_Encode(const unsigned char *input,
-                                 unsigned long length,
-                                 unsigned char *output,
-                                 int mark_end);
+kwsysEXPORT unsigned long kwsysBase64_Encode(const unsigned char *input,
+                                             unsigned long length,
+                                             unsigned char *output,
+                                             int mark_end);
 
 
 /**
 /**
  * Decode 4 bytes into a 3 byte string.  Returns the number of bytes
  * Decode 4 bytes into a 3 byte string.  Returns the number of bytes
  * actually decoded.
  * actually decoded.
  */
  */
-int kwsysBase64_Decode3(const unsigned char *src, unsigned char *dest);
+kwsysEXPORT int kwsysBase64_Decode3(const unsigned char *src,
+                                    unsigned char *dest);
 
 
 /**
 /**
  * Decode bytes from the input buffer and store the decoded stream
  * Decode bytes from the input buffer and store the decoded stream
@@ -86,10 +93,10 @@ int kwsysBase64_Decode3(const unsigned char *src, unsigned char *dest);
  * much decoded data to expect (of course, the buffer must be large
  * much decoded data to expect (of course, the buffer must be large
  * enough).
  * enough).
  */
  */
-unsigned long kwsysBase64_Decode(const unsigned char *input, 
-                                 unsigned long length,
-                                 unsigned char *output,
-                                 unsigned long max_input_length);
+kwsysEXPORT unsigned long kwsysBase64_Decode(const unsigned char *input, 
+                                             unsigned long length,
+                                             unsigned char *output,
+                                             unsigned long max_input_length);
 
 
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 } /* extern "C" */
 } /* extern "C" */
@@ -99,6 +106,7 @@ unsigned long kwsysBase64_Decode(const unsigned char *input,
    undefine them to keep the namespace clean.  */
    undefine them to keep the namespace clean.  */
 #if !defined(KWSYS_IN_BASE64_C)
 #if !defined(KWSYS_IN_BASE64_C)
 # undef kwsys
 # undef kwsys
+# undef kwsysEXPORT
 # undef kwsysBase64
 # undef kwsysBase64
 # undef kwsysBase64_Decode
 # undef kwsysBase64_Decode
 # undef kwsysBase64_Decode3
 # undef kwsysBase64_Decode3

+ 15 - 2
Source/kwsys/CMakeLists.txt

@@ -147,6 +147,19 @@ SET(KWSYS_NO_STD_NAMESPACE ${CMAKE_NO_STD_NAMESPACE})
 SET(KWSYS_NO_ANSI_STREAM_HEADERS ${CMAKE_NO_ANSI_STREAM_HEADERS})
 SET(KWSYS_NO_ANSI_STREAM_HEADERS ${CMAKE_NO_ANSI_STREAM_HEADERS})
 SET(KWSYS_NO_ANSI_STRING_STREAM ${CMAKE_NO_ANSI_STRING_STREAM})
 SET(KWSYS_NO_ANSI_STRING_STREAM ${CMAKE_NO_ANSI_STRING_STREAM})
 
 
+# Choose default shared/static build if not specified.
+IF(KWSYS_BUILD_SHARED MATCHES "^KWSYS_BUILD_SHARED$")
+  SET(KWSYS_BUILD_SHARED ${BUILD_SHARED_LIBS})
+ENDIF(KWSYS_BUILD_SHARED MATCHES "^KWSYS_BUILD_SHARED$")
+
+IF(KWSYS_BUILD_SHARED)
+  SET(KWSYS_BUILD_SHARED 1)
+  SET(KWSYS_LIBRARY_TYPE SHARED)
+ELSE(KWSYS_BUILD_SHARED)
+  SET(KWSYS_BUILD_SHARED 0)
+  SET(KWSYS_LIBRARY_TYPE STATIC)
+ENDIF(KWSYS_BUILD_SHARED)
+
 #-----------------------------------------------------------------------------
 #-----------------------------------------------------------------------------
 # Choose a directory for the generated headers.
 # Choose a directory for the generated headers.
 IF(NOT KWSYS_HEADER_ROOT)
 IF(NOT KWSYS_HEADER_ROOT)
@@ -192,7 +205,7 @@ ENDFOREACH(header)
 # Build a list of classes and headers we need to implement the
 # Build a list of classes and headers we need to implement the
 # selected components.  Initialize with required components.
 # selected components.  Initialize with required components.
 SET(KWSYS_CLASSES)
 SET(KWSYS_CLASSES)
-SET(KWSYS_H_FILES)
+SET(KWSYS_H_FILES Configure)
 SET(KWSYS_HXX_FILES Configure)
 SET(KWSYS_HXX_FILES Configure)
 
 
 # Enforce component dependencies (none currently exists).
 # Enforce component dependencies (none currently exists).
@@ -283,7 +296,7 @@ ENDFOREACH(h)
 
 
 #-----------------------------------------------------------------------------
 #-----------------------------------------------------------------------------
 # Add the library with the configured name and list of sources.
 # Add the library with the configured name and list of sources.
-ADD_LIBRARY(${KWSYS_NAMESPACE} ${KWSYS_SRCS})
+ADD_LIBRARY(${KWSYS_NAMESPACE} ${KWSYS_LIBRARY_TYPE} ${KWSYS_SRCS})
 
 
 # Create an install target for the library.
 # Create an install target for the library.
 IF(KWSYS_LIBRARY_INSTALL_DIR)
 IF(KWSYS_LIBRARY_INSTALL_DIR)

+ 30 - 0
Source/kwsys/Configure.h.in

@@ -0,0 +1,30 @@
+/*=========================================================================
+
+  Program:   KWSys - Kitware System Library
+  Module:    $RCSfile$
+  Language:  C++
+  Date:      $Date$
+  Version:   $Revision$
+
+  Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
+  See http://www.cmake.org/HTML/Copyright.html for details.
+
+     This software is distributed WITHOUT ANY WARRANTY; without even 
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+     PURPOSE.  See the above copyright notices for more information.
+
+=========================================================================*/
+#ifndef @KWSYS_NAMESPACE@_Configure_h
+#define @KWSYS_NAMESPACE@_Configure_h
+
+#if defined(_WIN32) && @KWSYS_BUILD_SHARED@
+# if defined(@KWSYS_NAMESPACE@_EXPORTS)
+#  define @KWSYS_NAMESPACE@_EXPORT __declspec(dllexport)
+# else
+#  define @KWSYS_NAMESPACE@_EXPORT __declspec(dllexport)
+# endif
+#else
+# define @KWSYS_NAMESPACE@_EXPORT
+#endif
+
+#endif

+ 2 - 0
Source/kwsys/Directory.cxx

@@ -16,6 +16,8 @@
 =========================================================================*/
 =========================================================================*/
 #include <Directory.hxx>
 #include <Directory.hxx>
 
 
+#include <Configure.hxx>
+
 #include <std/string>
 #include <std/string>
 #include <std/vector>
 #include <std/vector>
 
 

+ 2 - 2
Source/kwsys/Directory.hxx.in

@@ -17,7 +17,7 @@
 #ifndef @KWSYS_NAMESPACE@_Directory_hxx
 #ifndef @KWSYS_NAMESPACE@_Directory_hxx
 #define @KWSYS_NAMESPACE@_Directory_hxx
 #define @KWSYS_NAMESPACE@_Directory_hxx
 
 
-#include <@KWSYS_NAMESPACE@/Configure.hxx>
+#include <@KWSYS_NAMESPACE@/Configure.h>
 
 
 namespace @KWSYS_NAMESPACE@
 namespace @KWSYS_NAMESPACE@
 {
 {
@@ -32,7 +32,7 @@ class DirectoryInternals;
  *
  *
  * Directory currently works with Windows and Unix operating systems.
  * Directory currently works with Windows and Unix operating systems.
  */
  */
-class Directory 
+class @KWSYS_NAMESPACE@_EXPORT Directory 
 {
 {
 public:
 public:
   Directory();
   Directory();

+ 3 - 2
Source/kwsys/EncodeExecutable.c

@@ -50,6 +50,7 @@ int main(int argc, char* argv[])
   /* Prepend header comment.  */
   /* Prepend header comment.  */
   fprintf(ofp, "/*\n * DO NOT EDIT\n * This file is generated by:\n");
   fprintf(ofp, "/*\n * DO NOT EDIT\n * This file is generated by:\n");
   fprintf(ofp, " * %s\n */\n\n", argv[0]);
   fprintf(ofp, " * %s\n */\n\n", argv[0]);
+  fprintf(ofp, "#include <Configure.h>\n\n");
   fprintf(ofp, "#include <stdio.h>\n\n");
   fprintf(ofp, "#include <stdio.h>\n\n");
   
   
   /* Split file up in 1024-byte chunks.  */
   /* Split file up in 1024-byte chunks.  */
@@ -74,8 +75,8 @@ int main(int argc, char* argv[])
   fclose(ifp);
   fclose(ifp);
   
   
   /* Provide a function to write the data to a file.  */
   /* Provide a function to write the data to a file.  */
-  fprintf(ofp, "extern int %sEncodedWriteArray%s(const char* fname)\n",
-          argv[3], argv[4]);
+  fprintf(ofp, "extern %s_EXPORT int %sEncodedWriteArray%s(const char* fname)\n",
+          argv[3], argv[3], argv[4]);
   fprintf(ofp, "{\n");
   fprintf(ofp, "{\n");
   fprintf(ofp, "  FILE* ofp = fopen(fname, \"wb\");\n");
   fprintf(ofp, "  FILE* ofp = fopen(fname, \"wb\");\n");
   fprintf(ofp, "  if(!ofp) { return 0; }\n");
   fprintf(ofp, "  if(!ofp) { return 0; }\n");

+ 20 - 14
Source/kwsys/Process.h.in

@@ -17,11 +17,14 @@
 #ifndef @KWSYS_NAMESPACE@_Process_h
 #ifndef @KWSYS_NAMESPACE@_Process_h
 #define @KWSYS_NAMESPACE@_Process_h
 #define @KWSYS_NAMESPACE@_Process_h
 
 
+#include <@KWSYS_NAMESPACE@/Configure.h>
+
 /* Redefine all public interface symbol names to be in the proper
 /* Redefine all public interface symbol names to be in the proper
    namespace.  These macros are used internally to kwsys only, and are
    namespace.  These macros are used internally to kwsys only, and are
    not visible to user code.  Use kwsysHeaderDump.pl to reproduce
    not visible to user code.  Use kwsysHeaderDump.pl to reproduce
    these macros after making changes to the interface.  */
    these macros after making changes to the interface.  */
 #define kwsys(x) @KWSYS_NAMESPACE@##x
 #define kwsys(x) @KWSYS_NAMESPACE@##x
+#define kwsysEXPORT                      kwsys(_EXPORT)
 #define kwsysProcess                     kwsys(Process)
 #define kwsysProcess                     kwsys(Process)
 #define kwsysProcess_s                   kwsys(Process_s)
 #define kwsysProcess_s                   kwsys(Process_s)
 #define kwsysProcess_New                 kwsys(Process_New)
 #define kwsysProcess_New                 kwsys(Process_New)
@@ -70,20 +73,21 @@ typedef struct kwsysProcess_s kwsysProcess;
 /**
 /**
  * Create a new Process instance.
  * Create a new Process instance.
  */
  */
-kwsysProcess* kwsysProcess_New();
+kwsysEXPORT kwsysProcess* kwsysProcess_New();
 
 
 /**
 /**
  * Delete an existing Process instance.  If the instance is currently
  * Delete an existing Process instance.  If the instance is currently
  * executing a process, this blocks until the process terminates.
  * executing a process, this blocks until the process terminates.
  */
  */
-void kwsysProcess_Delete(kwsysProcess* cp);
+kwsysEXPORT void kwsysProcess_Delete(kwsysProcess* cp);
 
 
 /**
 /**
  * Set the command line to be executed.  Argument is an array of
  * Set the command line to be executed.  Argument is an array of
  * pointers to the command and each argument.  Ths array must end with
  * pointers to the command and each argument.  Ths array must end with
  * a NULL pointer.
  * a NULL pointer.
  */
  */
-void kwsysProcess_SetCommand(kwsysProcess* cp, char const* const* command);
+kwsysEXPORT void kwsysProcess_SetCommand(kwsysProcess* cp,
+                                         char const* const* command);
 
 
 /**
 /**
  * Set the timeout for the child process.  The timeout period begins
  * Set the timeout for the child process.  The timeout period begins
@@ -91,7 +95,7 @@ void kwsysProcess_SetCommand(kwsysProcess* cp, char const* const* command);
  * the timeout expires, it will be killed.  A non-positive (<= 0)
  * the timeout expires, it will be killed.  A non-positive (<= 0)
  * value will disable the timeout.
  * value will disable the timeout.
  */
  */
-void kwsysProcess_SetTimeout(kwsysProcess* cp, double timeout);
+kwsysEXPORT void kwsysProcess_SetTimeout(kwsysProcess* cp, double timeout);
 
 
 /**
 /**
  * Get the current state of the Process instance.  Possible states are:
  * Get the current state of the Process instance.  Possible states are:
@@ -104,7 +108,7 @@ void kwsysProcess_SetTimeout(kwsysProcess* cp, double timeout);
  *  kwsysProcess_State_Expired   = Child process's timeout expired.
  *  kwsysProcess_State_Expired   = Child process's timeout expired.
  *  kwsysProcess_State_Killed    = Child process terminated by Kill method.
  *  kwsysProcess_State_Killed    = Child process terminated by Kill method.
  */
  */
-int kwsysProcess_GetState(kwsysProcess* cp);
+kwsysEXPORT int kwsysProcess_GetState(kwsysProcess* cp);
 enum kwsysProcess_State_e
 enum kwsysProcess_State_e
 {
 {
   kwsysProcess_State_Starting,
   kwsysProcess_State_Starting,
@@ -128,7 +132,7 @@ enum kwsysProcess_State_e
  *  kwsysProcess_Exception_Numerical = Child crashed with a numerical exception.
  *  kwsysProcess_Exception_Numerical = Child crashed with a numerical exception.
  *  kwsysProcess_Exception_Other     = Child terminated for another reason.
  *  kwsysProcess_Exception_Other     = Child terminated for another reason.
  */
  */
-int kwsysProcess_GetExitException(kwsysProcess* cp);
+kwsysEXPORT int kwsysProcess_GetExitException(kwsysProcess* cp);
 enum kwsysProcess_Exception_e
 enum kwsysProcess_Exception_e
 {
 {
   kwsysProcess_Exception_None,
   kwsysProcess_Exception_None,
@@ -149,25 +153,25 @@ enum kwsysProcess_Exception_e
  * If GetState returns "Exited", use GetExitValue to get the
  * If GetState returns "Exited", use GetExitValue to get the
  * platform-independent child return value.
  * platform-independent child return value.
  */
  */
-int kwsysProcess_GetExitCode(kwsysProcess* cp);
+kwsysEXPORT int kwsysProcess_GetExitCode(kwsysProcess* cp);
 
 
 /**
 /**
  * When GetState returns "Exited", this method returns the child's
  * When GetState returns "Exited", this method returns the child's
  * platform-independent exit code (such as the value returned by the
  * platform-independent exit code (such as the value returned by the
  * child's main).
  * child's main).
  */
  */
-int kwsysProcess_GetExitValue(kwsysProcess* cp);
+kwsysEXPORT int kwsysProcess_GetExitValue(kwsysProcess* cp);
 
 
 /**
 /**
  * When GetState returns "Error", this method returns a string
  * When GetState returns "Error", this method returns a string
  * describing the problem.  Otherwise, it returns NULL.
  * describing the problem.  Otherwise, it returns NULL.
  */
  */
-const char* kwsysProcess_GetErrorString(kwsysProcess* cp);
+kwsysEXPORT const char* kwsysProcess_GetErrorString(kwsysProcess* cp);
 
 
 /**
 /**
  * Start executing the child process.
  * Start executing the child process.
  */
  */
-void kwsysProcess_Execute(kwsysProcess* cp);
+kwsysEXPORT void kwsysProcess_Execute(kwsysProcess* cp);
 
 
 /**
 /**
  * Block until data are available on a requested pipe, a timeout
  * Block until data are available on a requested pipe, a timeout
@@ -198,8 +202,9 @@ void kwsysProcess_Execute(kwsysProcess* cp);
  *                  call.  Time elapsed has been subtracted from timeout
  *                  call.  Time elapsed has been subtracted from timeout
  *                  argument.
  *                  argument.
  */
  */
-int kwsysProcess_WaitForData(kwsysProcess* cp, int pipes, char** data,
-                             int* length, double* timeout);
+kwsysEXPORT int kwsysProcess_WaitForData(kwsysProcess* cp, int pipes,
+                                         char** data, int* length,
+                                         double* timeout);
 enum kwsysProcess_Pipes_e
 enum kwsysProcess_Pipes_e
 {
 {
   kwsysProcess_Pipe_STDOUT=1,
   kwsysProcess_Pipe_STDOUT=1,
@@ -225,14 +230,14 @@ enum kwsysProcess_Pipes_e
  *        argument.
  *        argument.
  *    1 = Child has terminated or was not running.
  *    1 = Child has terminated or was not running.
  */
  */
-int kwsysProcess_WaitForExit(kwsysProcess* cp, double* timeout);
+kwsysEXPORT int kwsysProcess_WaitForExit(kwsysProcess* cp, double* timeout);
 
 
 /**
 /**
  * Forcefully terminate the child process that is currently running.
  * Forcefully terminate the child process that is currently running.
  * The caller should call WaitForExit after this returns to wait for
  * The caller should call WaitForExit after this returns to wait for
  * the child to terminate.
  * the child to terminate.
  */
  */
-void kwsysProcess_Kill(kwsysProcess* cp);
+kwsysEXPORT void kwsysProcess_Kill(kwsysProcess* cp);
 
 
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 } /* extern "C" */
 } /* extern "C" */
@@ -242,6 +247,7 @@ void kwsysProcess_Kill(kwsysProcess* cp);
    Otherwise, undefine them to keep the namespace clean.  */
    Otherwise, undefine them to keep the namespace clean.  */
 #if !defined(KWSYS_IN_PROCESS_C)
 #if !defined(KWSYS_IN_PROCESS_C)
 # undef kwsys
 # undef kwsys
+# undef kwsysEXPORT
 # undef kwsysProcess
 # undef kwsysProcess
 # undef kwsysProcess_s
 # undef kwsysProcess_s
 # undef kwsysProcess_New
 # undef kwsysProcess_New

+ 2 - 2
Source/kwsys/ProcessWin32.c

@@ -51,7 +51,7 @@ Q190351 and Q150956.
 /* The maximum amount to read from a pipe at a time.  */
 /* The maximum amount to read from a pipe at a time.  */
 #define CMPE_PIPE_BUFFER_SIZE 1024
 #define CMPE_PIPE_BUFFER_SIZE 1024
 
 
-#define kwsysEncodedWriteArrayProcessFwd kwsys(EncodedWriteArrayProcessFwd)
+#define kwsysEncodedWriteArrayProcessFwd9x kwsys(EncodedWriteArrayProcessFwd9x)
 
 
 typedef LARGE_INTEGER kwsysProcessTime;
 typedef LARGE_INTEGER kwsysProcessTime;
 
 
@@ -72,7 +72,7 @@ static kwsysProcessTime kwsysProcessTimeFromDouble(double d);
 static int kwsysProcessTimeLess(kwsysProcessTime in1, kwsysProcessTime in2);
 static int kwsysProcessTimeLess(kwsysProcessTime in1, kwsysProcessTime in2);
 static kwsysProcessTime kwsysProcessTimeAdd(kwsysProcessTime in1, kwsysProcessTime in2);
 static kwsysProcessTime kwsysProcessTimeAdd(kwsysProcessTime in1, kwsysProcessTime in2);
 static kwsysProcessTime kwsysProcessTimeSubtract(kwsysProcessTime in1, kwsysProcessTime in2);
 static kwsysProcessTime kwsysProcessTimeSubtract(kwsysProcessTime in1, kwsysProcessTime in2);
-extern int kwsysEncodedWriteArrayProcessFwd9x(const char* fname);
+extern kwsysEXPORT int kwsysEncodedWriteArrayProcessFwd9x(const char* fname);
 
 
 /*--------------------------------------------------------------------------*/
 /*--------------------------------------------------------------------------*/
 /* A structure containing data for each pipe's thread.  */
 /* A structure containing data for each pipe's thread.  */

+ 2 - 2
Source/kwsys/RegularExpression.cxx

@@ -413,7 +413,7 @@ static char* reg (int paren, int *flagp) {
 
 
     // Make an OPEN node, if parenthesized.
     // Make an OPEN node, if parenthesized.
     if (paren) {
     if (paren) {
-        if (regnpar >= RegularExpressionNSUBEXP) {
+        if (regnpar >=  RegularExpression::NSUBEXP) {
           //RAISE Error, SYM(RegularExpression), SYM(Too_Many_Parens),
           //RAISE Error, SYM(RegularExpression), SYM(Too_Many_Parens),
           printf ("RegularExpression::compile(): Too many parentheses.\n");
           printf ("RegularExpression::compile(): Too many parentheses.\n");
           return 0;
           return 0;
@@ -925,7 +925,7 @@ static int regtry (const char* string, const char* *start,
 
 
     sp1 = start;
     sp1 = start;
     ep = end;
     ep = end;
-    for (i = RegularExpressionNSUBEXP; i > 0; i--) {
+    for (i = RegularExpression::NSUBEXP; i > 0; i--) {
         *sp1++ = 0;
         *sp1++ = 0;
         *ep++ = 0;
         *ep++ = 0;
     }
     }

+ 5 - 5
Source/kwsys/RegularExpression.hxx.in

@@ -35,6 +35,7 @@
 #ifndef @KWSYS_NAMESPACE@_RegularExpression_hxx
 #ifndef @KWSYS_NAMESPACE@_RegularExpression_hxx
 #define @KWSYS_NAMESPACE@_RegularExpression_hxx
 #define @KWSYS_NAMESPACE@_RegularExpression_hxx
 
 
+#include <@KWSYS_NAMESPACE@/Configure.h>
 #include <@KWSYS_NAMESPACE@/Configure.hxx>
 #include <@KWSYS_NAMESPACE@/Configure.hxx>
 
 
 #include <@KWSYS_NAMESPACE@/std/string>
 #include <@KWSYS_NAMESPACE@/std/string>
@@ -47,8 +48,6 @@
 namespace @KWSYS_NAMESPACE@
 namespace @KWSYS_NAMESPACE@
 {
 {
 
 
-const int RegularExpressionNSUBEXP = 10;
-
 /** \class RegularExpression
 /** \class RegularExpression
  * \brief Implements pattern matching with regular expressions.
  * \brief Implements pattern matching with regular expressions.
  *
  *
@@ -186,7 +185,7 @@ const int RegularExpressionNSUBEXP = 10;
  *      the line.  It would match "drepa qrepb" in "rep drepa qrepb".
  *      the line.  It would match "drepa qrepb" in "rep drepa qrepb".
  *
  *
  */
  */
-class RegularExpression 
+class @KWSYS_NAMESPACE@_EXPORT RegularExpression 
 {
 {
 public:
 public:
   /**
   /**
@@ -273,9 +272,10 @@ public:
   kwsys_std::string::size_type end(int n) const;
   kwsys_std::string::size_type end(int n) const;
   kwsys_std::string match(int n) const;
   kwsys_std::string match(int n) const;
   
   
+  enum { NSUBEXP = 10 };
 private: 
 private: 
-  const char* startp[RegularExpressionNSUBEXP];
-  const char* endp[RegularExpressionNSUBEXP];
+  const char* startp[NSUBEXP];
+  const char* endp[NSUBEXP];
   char  regstart;                       // Internal use only
   char  regstart;                       // Internal use only
   char  reganch;                        // Internal use only
   char  reganch;                        // Internal use only
   const char* regmust;                  // Internal use only
   const char* regmust;                  // Internal use only

+ 3 - 1
Source/kwsys/SystemTools.hxx.in

@@ -21,6 +21,8 @@
 #include <@KWSYS_NAMESPACE@/std/string>
 #include <@KWSYS_NAMESPACE@/std/string>
 #include <@KWSYS_NAMESPACE@/std/vector>
 #include <@KWSYS_NAMESPACE@/std/vector>
 
 
+#include <@KWSYS_NAMESPACE@/Configure.h>
+
 /* Define this macro temporarily to keep the code readable.  */
 /* Define this macro temporarily to keep the code readable.  */
 #if !defined (KWSYS_NAMESPACE) && !defined(@KWSYS_NAMESPACE@_NAME_IS_KWSYS)
 #if !defined (KWSYS_NAMESPACE) && !defined(@KWSYS_NAMESPACE@_NAME_IS_KWSYS)
 # define kwsys_std @KWSYS_NAMESPACE@_std
 # define kwsys_std @KWSYS_NAMESPACE@_std
@@ -32,7 +34,7 @@ namespace @KWSYS_NAMESPACE@
 /** \class SystemTools
 /** \class SystemTools
  * \brief A collection of useful platform-independent system functions.
  * \brief A collection of useful platform-independent system functions.
  */
  */
-class SystemTools
+class @KWSYS_NAMESPACE@_EXPORT SystemTools
 {
 {
 public:
 public:
   /**
   /**