Reorganized preprocessor declarations for Windows.
authorScott Cantor <cantor.2@osu.edu>
Sun, 29 Jun 2003 22:23:49 +0000 (22:23 +0000)
committerScott Cantor <cantor.2@osu.edu>
Sun, 29 Jun 2003 22:23:49 +0000 (22:23 +0000)
17 files changed:
shib-target/internal.h [new file with mode: 0644]
shib-target/shib-ccache.cpp
shib-target/shib-config.cpp
shib-target/shib-ini.cpp
shib-target/shib-mlp.cpp
shib-target/shib-resource.cpp
shib-target/shib-resourceentry.cpp
shib-target/shib-rm.cpp
shib-target/shib-rpcerror.cpp
shib-target/shib-rpchandle.cpp
shib-target/shib-rpcutil.c
shib-target/shib-shire.cpp
shib-target/shib-sock.c
shib-target/shib-target.cpp
shib-target/shib-target.h
shib-target/shibrpc-server.cpp
shib-target/shibtarget.dsp

diff --git a/shib-target/internal.h b/shib-target/internal.h
new file mode 100644 (file)
index 0000000..a801df1
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * The Shibboleth License, Version 1.
+ * Copyright (c) 2002
+ * University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution, if any, must include
+ * the following acknowledgment: "This product includes software developed by
+ * the University Corporation for Advanced Internet Development
+ * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement
+ * may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear.
+ *
+ * Neither the name of Shibboleth nor the names of its contributors, nor
+ * Internet2, nor the University Corporation for Advanced Internet Development,
+ * Inc., nor UCAID may be used to endorse or promote products derived from this
+ * software without specific prior written permission. For written permission,
+ * please contact shibboleth@shibboleth.org
+ *
+ * Products derived from this software may not be called Shibboleth, Internet2,
+ * UCAID, or the University Corporation for Advanced Internet Development, nor
+ * may Shibboleth appear in their name, without prior written permission of the
+ * University Corporation for Advanced Internet Development.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK
+ * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
+ * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+/* internal.h - internally visible declarations
+
+   Scott Cantor
+   6/29/03
+
+   $History:$
+*/
+
+#ifndef __shibtarget_internal_h__
+#define __shibtarget_internal_h__
+
+#ifdef WIN32
+# define SHIBTARGET_EXPORTS __declspec(dllexport)
+#endif
+
+// eventually we might be able to support autoconf via cygwin...
+#if defined (_MSC_VER) || defined(__BORLANDC__)
+# include "config_win32.h"
+#else
+# include "config.h"
+#endif
+
+#include "shib-target.h"
+
+#ifdef __cplusplus
+
+#include "ccache-utils.h"
+
+#include <log4cpp/Category.hh>
+
+using namespace std;
+using namespace log4cpp;
+using namespace saml;
+using namespace shibboleth;
+using namespace shibtarget;
+
+#endif
+
+#endif
index 8239945..4c5a819 100644 (file)
  * $Id$
  */
 
+#include "internal.h"
+
 #if HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
-
-#include "shib-target.h"
-#include "ccache-utils.h"
 #include <shib/shib-threads.h>
 
 #include <log4cpp/Category.hh>
 #include <dmalloc.h>
 #endif
 
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
-using namespace shibtarget;
-
 class InternalCCache;
 class InternalCCacheEntry : public CCacheEntry
 {
index 7402831..9ac735b 100644 (file)
  * $Id$
  */
 
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
+#include "internal.h"
 
-#include "shib-target.h"
-#include "ccache-utils.h"
 #include <shib/shib-threads.h>
 
 #include <log4cpp/PropertyConfigurator.hh>
 #include <log4cpp/Category.hh>
 
-using namespace saml;
-using namespace shibboleth;
-using namespace shibtarget;
-using namespace std;
-using namespace log4cpp;
-
 #ifndef SHIBTARGET_INIFILE
 #define SHIBTARGET_INIFILE "/opt/shibboleth/etc/shibboleth/shibboleth.ini"
 #endif
index b3f8bf3..de36ff4 100644 (file)
  * $Id$
  */
 
-// eventually we might be able to support autoconf via cygwin...
-#if defined (_MSC_VER) || defined(__BORLANDC__)
-# include "config_win32.h"
-#else
-# include "config.h"
-#endif
-
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
+#include "internal.h"
 
-#include "shib-target.h"
 #include <shib/shib-threads.h>
 
 #include <sstream>
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include <log4cpp/Category.hh>
-
-using namespace std;
-using namespace shibboleth;
-using namespace shibtarget;
-
 class HeaderIterator : public shibtarget::ShibINI::Iterator {
 public:
   HeaderIterator (ShibINIPriv* ini);
@@ -553,4 +537,3 @@ bool ShibINI::boolean(string& value)
   return false;
 }
 
-ShibINI::Iterator::~Iterator() {}
index bf43756..9458476 100644 (file)
  * $Id$
  */
 
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
+#include "internal.h"
 
-#include "shib-target.h"
 #include <sstream>
 #include <ctype.h>
 #include <xercesc/util/XercesDefs.hpp>
 
-#include <log4cpp/Category.hh>
-
-using namespace std;
-using namespace shibtarget;
-using namespace saml;
-
 class shibtarget::ShibMLPPriv {
 public:
   ShibMLPPriv();
index 4091069..91ffe78 100644 (file)
  * $Id$
  */
 
+#include "internal.h"
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
-
-#include "shib-target.h"
-
-#include <log4cpp/Category.hh>
-
 #include <stdexcept>
 
-using namespace std;
-using namespace shibtarget;
-using namespace saml;
-
 class shibtarget::ResourcePriv
 {
 public:
index d4b0478..9fb3408 100644 (file)
  * $Id$
  */
 
+#include "internal.h"
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
-
-#include "shib-target.h"
-#include "ccache-utils.h"
-
-#include <log4cpp/Category.hh>
-
 #ifdef HAVE_LIBDMALLOCXX
 #include <dmalloc.h>
 #endif
 
-using namespace std;
-using namespace saml;
-using namespace shibtarget;
-
 class shibtarget::ResourceEntryPriv
 {
 public:
index 87a9f40..3bb5fe1 100644 (file)
  * $Id$
  */
 
+#include "internal.h"
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
-
-#include "shib-target.h"
-
 #include <xercesc/util/Base64.hpp>
 #include <log4cpp/Category.hh>
 
 #include <sstream>
 #include <stdexcept>
 
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
-using namespace shibtarget;
-
 class shibtarget::RMPriv
 {
 public:
index 19f74a6..2cad73a 100644 (file)
  * $Id$
  */
 
+#include "internal.h"
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
-
-#include "shib-target.h"
-
 #include <stdexcept>
 #include <sstream>
 #include <typeinfo>
 
-#include <log4cpp/Category.hh>
-
-using namespace std;
-using namespace shibtarget;
-using namespace shibboleth;
-using namespace saml;
-
 namespace {
   int initializing = 0;
   int initialized = 0;
index 60f8f92..b5ccb1b 100644 (file)
  * $Id$
  */
 
+#include "internal.h"
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
-
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
-
-#include "shib-target.h"
 #include <shib/shib-threads.h>
 
-#include <log4cpp/Category.hh>
-
 #include <stdexcept>
 
-using namespace std;
-using namespace shibboleth;
-using namespace shibtarget;
-
-
 class shibtarget::RPCHandleInternal
 {
 public:
index d05b98b..24d92ca 100644 (file)
 # include <sys/socket.h>
 #endif
 
-// eventually we might be able to support autoconf via cygwin...
-#if defined (_MSC_VER) || defined(__BORLANDC__)
-# include "config_win32.h"
-#else
-# include "config.h"
-#endif
-
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
-
-#include "shib-target.h"
+#include "internal.h"
 
-CLIENT *
-shibrpc_client_create (ShibSocket sock, u_long program, u_long version)
+CLIENT* shibrpc_client_create (ShibSocket sock, u_long program, u_long version)
 {
   struct sockaddr_in sin;
 
index 820af5d..56ab25f 100644 (file)
  * $Id$
  */
 
+#include "internal.h"
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
-
-#include "shib-target.h"
-
-#include <log4cpp/Category.hh>
-
 #include <stdexcept>
 
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
-using namespace shibtarget;
-
 class shibtarget::SHIREPriv
 {
 public:
index b121337..97e8511 100644 (file)
@@ -55,6 +55,8 @@
  * $Id$
  */
 
+#include "internal.h"
+
 #ifndef HAVE_UNISTD_H
 # include <winsock.h>
 #else
 #include <errno.h>
 
 #ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
-
-#include "shib-target.h"
-
-#ifdef WIN32
 
 typedef struct sockaddr_in SHIBADDR;
 
index a0f9a00..2ef4bf3 100644 (file)
  * $Id$
  */
 
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
-
-#include "shib-target.h"
-
-#include <log4cpp/Category.hh>
-
-using namespace saml;
-using namespace shibboleth;
-using namespace shibtarget;
-using namespace std;
+#include "internal.h"
 
 /* shib-target.cpp */
 
index 04412b5..422ca4c 100644 (file)
@@ -383,7 +383,7 @@ namespace shibtarget {
 
     class SHIBTARGET_EXPORTS Iterator {
     public:
-      virtual ~Iterator() = 0;
+      virtual ~Iterator() {}
       virtual const std::string* begin() = 0;
       virtual const std::string* next() = 0;
     };
index 7c59543..073474a 100644 (file)
  * $Id$
  */
 
-#ifdef WIN32
-# define SHIBTARGET_EXPORTS __declspec(dllexport)
-#endif
+#include "internal.h"
 
-#include "shib-target.h"
 #include "shibrpc.h"
-#include "ccache-utils.h"
 
-#include <log4cpp/Category.hh>
 #include <sstream>
 
 #ifdef HAVE_LIBDMALLOCXX
 #include <dmalloc.h>
 #endif
 
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
-using namespace shibtarget;
-
-static std::string get_threadid (const char* proc)
+static string get_threadid (const char* proc)
 {
   static u_long counter = 0;
   ostringstream buf;
@@ -85,10 +75,10 @@ static std::string get_threadid (const char* proc)
   return buf.str();
 }
 
-static log4cpp::Category& get_category (void)
+static Category& get_category (void)
 {
   string ctx = "shibtarget.rpc-server";
-  return log4cpp::Category::getInstance(ctx);
+  return Category::getInstance(ctx);
 }
 
 extern "C" bool_t
@@ -124,7 +114,7 @@ shibrpc_session_is_valid_1_svc(shibrpc_session_is_valid_args_1 *argp,
                               shibrpc_session_is_valid_ret_1 *result,
                               struct svc_req *rqstp)
 {
-  log4cpp::Category& log = get_category();
+  Category& log = get_category();
   string ctx = get_threadid("session_is_valid");
   saml::NDC ndc(ctx);
 
@@ -216,7 +206,7 @@ extern "C" bool_t
 shibrpc_new_session_1_svc(shibrpc_new_session_args_1 *argp,
                          shibrpc_new_session_ret_1 *result, struct svc_req *rqstp)
 {
-  log4cpp::Category& log = get_category();
+  Category& log = get_category();
   string ctx = get_threadid("new_session");
   saml::NDC ndc(ctx);
 
@@ -372,7 +362,7 @@ extern "C" bool_t
 shibrpc_get_assertions_1_svc(shibrpc_get_assertions_args_1 *argp,
                        shibrpc_get_assertions_ret_1 *result, struct svc_req *rqstp)
 {
-  log4cpp::Category& log = get_category();
+  Category& log = get_category();
   string ctx = get_threadid("get_assertions");
   saml::NDC ndc(ctx);
 
index 28dd4d2..8ccdf27 100644 (file)
@@ -53,7 +53,8 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 log4cpp.lib xerces-c_2.lib xsec_lib_02.lib wsock32.lib saml.lib /nologo /dll /machine:I386 /libpath:"../../../opensaml/c/saml/Release"
+# ADD LINK32 log4cpp.lib xerces-c_2.lib xsec_lib_02.lib wsock32.lib saml.lib /nologo /dll /machine:I386 /libpath:"../../../opensaml/c/saml/Release" /export:shibrpc_prog_1
+# SUBTRACT LINK32 /pdb:none
 
 !ELSEIF  "$(CFG)" == "shibtarget - Win32 Debug"
 
@@ -79,7 +80,8 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 log4cppD.lib xerces-c_2D.lib xsec_lib_02D.lib wsock32.lib saml.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"../../../opensaml/c/saml/Debug"
+# ADD LINK32 log4cppD.lib xerces-c_2D.lib xsec_lib_02D.lib wsock32.lib saml.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"../../../opensaml/c/saml/Debug" /export:shibrpc_prog_1
+# SUBTRACT LINK32 /pdb:none
 
 !ENDIF 
 
@@ -93,6 +95,10 @@ SOURCE=".\ccache-utils.h"
 # End Source File
 # Begin Source File
 
+SOURCE=.\internal.h
+# End Source File
+# Begin Source File
+
 SOURCE=".\shib-ccache.cpp"
 # End Source File
 # Begin Source File