Skip to content

Commit

Permalink
complete windows
Browse files Browse the repository at this point in the history
  • Loading branch information
da2ce7 committed Feb 28, 2014
1 parent 6158a3d commit c88ab7d
Show file tree
Hide file tree
Showing 146 changed files with 1,185 additions and 1,100 deletions.
7 changes: 7 additions & 0 deletions include/otapi/OTAPI_Basic.hpp
Expand Up @@ -147,6 +147,13 @@ Every other type will be wrapped in a std::string.
#include <ExportWrapper.h>
#include <WinsockWrapper.h>

#ifdef SWIG
#ifdef EXPORT
#undef EXPORT
#endif
#define EXPORT
#endif

#include <string>


Expand Down
7 changes: 7 additions & 0 deletions include/otapi/OTMadeEasy.hpp
Expand Up @@ -148,6 +148,13 @@ Every other type will be wrapped in a std::string.
#include <ExportWrapper.h>
#include <WinsockWrapper.h>

#ifdef SWIG
#ifdef EXPORT
#undef EXPORT
#endif
#define EXPORT
#endif

#include <string>

class OT_ME;
Expand Down
2 changes: 2 additions & 0 deletions include/otlib/ExportWrapper.h
Expand Up @@ -2,6 +2,7 @@
#define _EXPORT_WRAPPER_H_
#endif // no guard.

#ifndef SWIG // no export for swig.
#ifdef _WIN32

// DLL Export/Import for Win32
Expand All @@ -22,3 +23,4 @@
#endif

#endif
#endif
7 changes: 7 additions & 0 deletions include/otlib/OTPassword.hpp
Expand Up @@ -136,6 +136,13 @@
#include <ExportWrapper.h>
#include <WinsockWrapper.h>

#ifdef SWIG
#ifdef EXPORT
#undef EXPORT
#endif
#define EXPORT
#endif

#include <OTCachedKey.hpp>

#include <string>
Expand Down
55 changes: 26 additions & 29 deletions include/otlib/OTStorage.hpp
Expand Up @@ -130,6 +130,13 @@
#include <ExportWrapper.h>
#include <WinsockWrapper.h>

#ifdef SWIG
#ifdef EXPORT
#undef EXPORT
#endif
#define EXPORT
#endif

#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
Expand All @@ -140,16 +147,6 @@
// we need to tell swig what parts to skip over.

#ifndef SWIG
#ifndef NOT_SWIG
#define NOT_SWIG
#endif
#else
#ifndef EXPORT
#define EXPORT
#endif
#endif

#ifdef NOT_SWIG

#include <OTAssert.hpp>

Expand Down Expand Up @@ -249,7 +246,7 @@ public: \



#endif // NOT_SWIG
#endif // (not) SWIG
// ----------------------------------------------------

namespace OTDB
Expand Down Expand Up @@ -277,13 +274,13 @@ namespace OTDB
STORE_TYPE_SUBCLASS // (Subclass provided by API client via SWIG.)
};

#ifdef NOT_SWIG
#ifndef SWIG
// -------------------------------------
//
// STORED OBJECT TYPES...
//
extern const char * StoredObjectTypeStrings[];
#endif // NOT_SWIG
#endif // (not) SWIG

enum StoredObjectType
{
Expand Down Expand Up @@ -314,7 +311,7 @@ namespace OTDB
STORED_OBJ_ERROR // (Should never be.)
};

#ifdef NOT_SWIG
#ifndef SWIG
// ********************************************************************

// ABSTRACT BASE CLASSES
Expand Down Expand Up @@ -402,23 +399,25 @@ namespace OTDB
virtual void hookAfterUnpack() {} // This is called just after unpacking a storable. (Opportunity to copy values...)
EndInterface

#endif // (not) SWIG

// ********************************************************************
//
// use this without a semicolon:
//
#endif // NOT_SWIG

#ifdef SWIG // swig version
#define DEFINE_OT_DYNAMIC_CAST(CLASS_NAME_A) \
CLASS_NAME_A * clone () const { std::cerr << "********* THIS SHOULD NEVER HAPPEN!!!!! *****************" << std::endl; return NULL; } \
static CLASS_NAME_A * ot_dynamic_cast( Storable *pObject) { return dynamic_cast<CLASS_NAME_A *>(pObject); }
// static const CLASS_NAME_A* ot_dynamic_cast(const Storable *pObject) { return dynamic_cast<const CLASS_NAME_A *>(pObject); }
#else
#endif // SWIG

#ifndef SWIG // normal version
#define DEFINE_OT_DYNAMIC_CAST(CLASS_NAME) \
virtual CLASS_NAME * clone () const { std::cout << "********* THIS SHOULD NEVER HAPPEN!!!!! *****************" << std::endl; OT_FAIL; } \
static CLASS_NAME * ot_dynamic_cast( Storable *pObject) { return dynamic_cast<CLASS_NAME *>(pObject); }
#endif
#endif // (not) SWIG

// static const CLASS_NAME * ot_dynamic_cast(const Storable *pObject) { return dynamic_cast<const T *>(pObject); }

Expand Down Expand Up @@ -447,7 +446,7 @@ namespace OTDB
DEFINE_OT_DYNAMIC_CAST(Storable)
};

#ifdef NOT_SWIG
#ifndef SWIG

// ********************************************************************

Expand Down Expand Up @@ -582,7 +581,7 @@ namespace OTDB



#endif // NOT_SWIG
#endif
// ********************************************************************
//
// STORAGE -- abstract base class
Expand Down Expand Up @@ -812,7 +811,10 @@ public: \
name * Get##name(size_t nIndex); \
bool Remove##name(size_t nIndex##name); \
bool Add##name(name & disownObject)
#else

#endif // SWIG
#ifndef SWIG

#define DECLARE_GET_ADD_REMOVE(name) \
protected: \
std::deque< stlplus::simple_ptr_clone<name> > list_##name##s; \
Expand All @@ -821,7 +823,7 @@ public: \
EXPORT name * Get##name(size_t nIndex); \
EXPORT bool Remove##name(size_t nIndex##name); \
EXPORT bool Add##name(name & disownObject)
#endif
#endif // (not) SWIG


// Serialized types...
Expand Down Expand Up @@ -1529,14 +1531,9 @@ public: \

// ********************************************************************

#ifdef NOT_SWIG







#ifndef SWIG

// *******************************************************************************************
//
Expand Down Expand Up @@ -2356,7 +2353,7 @@ namespace OTDB



#endif // NOT_SWIG
#endif // (not) SWIG


#if __clang__
Expand Down
16 changes: 8 additions & 8 deletions src/otapi/Makefile.am
Expand Up @@ -48,7 +48,7 @@ lib_LTLIBRARIES += libotapi-java.la
endif

libotapi_java_la_SOURCES = $(opentxs_swig_dir)/otapi/OTAPI-java.cxx \
$(opentxs_swig_dir)/otapi/OTAPI-java.h
$(opentxs_swig_dir)/otapi/OTAPI-java.hpp

libotapi_java_la_CXXFLAGS = $(common_includes) $(JNI_CPPFLAGS)

Expand Down Expand Up @@ -85,7 +85,7 @@ lib_LTLIBRARIES += libotapi-php.la
endif

libotapi_php_la_SOURCES = $(opentxs_swig_dir)/otapi/OTAPI-php.cpp \
$(opentxs_swig_dir)/otapi/OTAPI-php.h
$(opentxs_swig_dir)/otapi/OTAPI-php.hpp
libotapi_php_la_CXXFLAGS = $(common_includes) \
-I$(opentxs_swig_dir)/glue/php \
$(PHP_INCLUDES)
Expand All @@ -104,7 +104,7 @@ lib_LTLIBRARIES += _otapi.la
endif

_otapi_la_SOURCES = $(opentxs_swig_dir)/otapi/OTAPI-python.cxx \
$(opentxs_swig_dir)/otapi/OTAPI-python.h
$(opentxs_swig_dir)/otapi/OTAPI-python.hpp

_otapi_la_CXXFLAGS = $(common_includes) \
$(PYTHON_CPPFLAGS) \
Expand All @@ -127,7 +127,7 @@ lib_LTLIBRARIES += libotapi-ruby.la
endif

libotapi_ruby_la_SOURCES = $(opentxs_swig_dir)/otapi/OTAPI-ruby.cxx \
$(opentxs_swig_dir)/otapi/OTAPI-ruby.h
$(opentxs_swig_dir)/otapi/OTAPI-ruby.hpp
libotapi_ruby_la_CXXFLAGS = $(common_includes) \
$(RUBY_CPPFLAGS) \
$(RUBY_EXTRA_LIBS)
Expand Down Expand Up @@ -162,7 +162,7 @@ lib_LTLIBRARIES += libotapi-csharp.la
endif

libotapi_csharp_la_SOURCES = $(opentxs_swig_dir)/otapi/OTAPI-csharp.cxx \
$(opentxs_swig_dir)/otapi/OTAPI-csharp.h
$(opentxs_swig_dir)/otapi/OTAPI-csharp.hpp
libotapi_csharp_la_CXXFLAGS = $(common_includes)
libotapi_csharp_la_LIBADD = libotapi.la $(otlib_build_dir)/libot.la $(DEPS_LIBS)
libotapi_csharp_la_DEPENDENCIES = libotapi.la $(otlib_build_dir)/libot.la
Expand All @@ -179,7 +179,7 @@ lib_LTLIBRARIES += libotapi-d.la
endif

libotapi_d_la_SOURCES = $(opentxs_swig_dir)/otapi/OTAPI-d.cxx \
$(opentxs_swig_dir)/otapi/OTAPI-d.h
$(opentxs_swig_dir)/otapi/OTAPI-d.hpp
libotapi_d_la_CXXFLAGS = $(common_includes)
libotapi_d_la_LIBADD = libotapi.la $(otlib_build_dir)/libot.la $(DEPS_LIBS)
libotapi_d_la_DEPENDENCIES = libotapi.la $(otlib_build_dir)/libot.la
Expand All @@ -196,7 +196,7 @@ lib_LTLIBRARIES += libotapi-go.la
endif

libotapi_go_la_SOURCES = $(opentxs_swig_dir)/otapi/OTAPI-go.cxx \
$(opentxs_swig_dir)/otapi/OTAPI-go.h
$(opentxs_swig_dir)/otapi/OTAPI-go.hpp
libotapi_go_la_CXXFLAGS = $(common_includes)
libotapi_go_la_LIBADD = libotapi.la $(otlib_build_dir)/libot.la $(DEPS_LIBS)
libotapi_go_la_DEPENDENCIES = libotapi.la $(otlib_build_dir)/libot.la
Expand All @@ -213,7 +213,7 @@ endif
simpleini_headers_dir = $(opentxs_include_dir)/simpleini

simpleini_headers = $(simpleini_headers_dir)/ConvertUTF.h \
$(simpleini_headers_dir)/SimpleIni.h
$(simpleini_headers_dir)/SimpleIni.hpp

simpleini_sources_dir = $(opentxs_source_dir)/simpleini

Expand Down
8 changes: 5 additions & 3 deletions swig/buildwrappers.bat
Expand Up @@ -19,7 +19,7 @@ echo:
goto :define

:define
SET SWIG_VER=2.0.11
SET SWIG_VER=2.0.12
SET SWIG_EXE=swig.exe
SET SWIG_DIR=swigwin-%SWIG_VER%
SET SWIG_DIR_PATH=..\%SWIG_DIR%
Expand Down Expand Up @@ -122,11 +122,13 @@ FOR %%x IN (csharp java perl5 php python ruby tcl d go) DO (
)

for %%y IN (cpp cxx) DO (
IF EXIST "%OT_API_BASE%_wrap.%%y" SED -i s/"OTAPI_wrap.h"/"OTAPI-%%x.h"/g "%OT_API_BASE%_wrap.%%y"
IF EXIST "%OT_API_BASE%_wrap.%%y" SED -i s/"OTAPI_wrap.h"/"OTAPI-%%x.hpp"/g "%OT_API_BASE%_wrap.%%y"
)

for %%z IN (cpp cxx h) DO (
for %%z IN (cpp cxx hpp) DO (
IF EXIST "%OT_API_BASE%_wrap.h" MOVE /Y "%OT_API_BASE%_wrap.h" "%OT_API_BASE%-%%x.hpp"
IF EXIST "%OT_API_BASE%_wrap.%%z" MOVE /Y "%OT_API_BASE%_wrap.%%z" "%OT_API_BASE%-%%x.%%z"

)
)
goto :done
Expand Down
3 changes: 2 additions & 1 deletion swig/buildwrappers.sh
Expand Up @@ -41,9 +41,10 @@ do
fi

# Move and clean up wrapper files
for ext in cxx cpp h; do
for ext in cxx cpp hpp h; do
if [ -f otapi/OTAPI-$x.$ext ]; then rm otapi/OTAPI-$x.$ext; fi
if [ -f otapi/OTAPI_wrap.$ext ]; then mv otapi/OTAPI_wrap.$ext otapi/OTAPI-$x.$ext; fi
if [ -f otapi/OTAPI-$x.h ]; then mv otapi/OTAPI-$x.h otapi/OTAPI-$x.hpp; fi
done

for ext in cxx cpp; do
Expand Down
2 changes: 1 addition & 1 deletion swig/glue/csharp/Acct.cs
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.9
* Version 2.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
Expand Down
2 changes: 1 addition & 1 deletion swig/glue/csharp/AddressBook.cs
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.9
* Version 2.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
Expand Down
2 changes: 1 addition & 1 deletion swig/glue/csharp/AskData.cs
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.9
* Version 2.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
Expand Down
2 changes: 1 addition & 1 deletion swig/glue/csharp/BidData.cs
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.9
* Version 2.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
Expand Down
2 changes: 1 addition & 1 deletion swig/glue/csharp/BitcoinAcct.cs
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.9
* Version 2.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
Expand Down
2 changes: 1 addition & 1 deletion swig/glue/csharp/BitcoinServer.cs
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.9
* Version 2.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
Expand Down
2 changes: 1 addition & 1 deletion swig/glue/csharp/Blob.cs
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.9
* Version 2.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
Expand Down
2 changes: 1 addition & 1 deletion swig/glue/csharp/Contact.cs
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.9
* Version 2.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
Expand Down
2 changes: 1 addition & 1 deletion swig/glue/csharp/ContactAcct.cs
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.9
* Version 2.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
Expand Down

0 comments on commit c88ab7d

Please sign in to comment.