Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

now working linux

  • Loading branch information...
commit dc25b296570887ed71d364db8c0277379090930a 1 parent cccf743
@da2ce7 da2ce7 authored
View
1  include/otlib/OTAssert.hpp
@@ -131,6 +131,7 @@
#include <ExportWrapper.h>
#include <WinsockWrapper.h>
+#include <cstddef>
#include <exception>
#define OT_FAIL { OTAssert::Assert(__FILE__, __LINE__); std::terminate(); };
View
13 include/otlib/OTCrypto.hpp
@@ -139,6 +139,7 @@
#include <OTSettings.hpp>
#include <OTPayload.hpp>
+#include <OTAssert.hpp>
#include <set>
@@ -226,14 +227,12 @@ class OTCryptoConfig
return true;
}
- static inline const int32_t & GetValue(const int32_t *& pValue)
- {
- if(NULL == pValue)
- if(!GetSetAll())
- assert(false);
- if(NULL == pValue) assert(false);
+ static inline const int32_t & GetValue(const int32_t *& pValue)
+ {
+ if (NULL == pValue) { if (!GetSetAll()) OT_FAIL; }
+ if (NULL == pValue) { OT_FAIL; }
return *pValue;
- }
+ }
static const int32_t * sp_nIterationCount;
static const int32_t * sp_nSymmetricSaltSize;
View
1  include/otlib/OTData.hpp
@@ -131,6 +131,7 @@
#include <ExportWrapper.h>
#include <WinsockWrapper.h>
+#include <cstddef>
#include <cinttypes>
View
8 include/otlib/OTPaths.hpp
@@ -143,6 +143,7 @@
#include <WinsockWrapper.h>
#include <OTSettings.hpp>
+#include <OTAssert.hpp>
// All directories have a trailing "/" while files do not. <== remember to enforce this!!!
@@ -283,7 +284,7 @@ class OTDataFolder
if (NULL != pDataFolder)
if (pDataFolder->m_bInitialized) return true;
- assert(false);
+ OT_FAIL;
return false;
}
@@ -337,9 +338,8 @@ class OTFolders
static inline const OTString & GetFolder(const OTString & strFolder)
{
- if(!strFolder.Exists())
- if(!GetSetAll())
- assert(false);
+ if (!strFolder.Exists()) {
+ if (!GetSetAll()) { OT_FAIL; } }
return strFolder;
}
View
4 include/otlib/OTString.hpp
@@ -140,9 +140,7 @@
#include <list>
#include <map>
#include <sstream>
-#include <stdexcept> // via: win32_utf8conv.hpp
-#include <string> // via: win32_utf8conv.hpp
-#include <string> // via: win32_utf8conv.hpp
+#include <string.h>
#ifdef _WIN32
#include "win32_utf8conv.hpp" // support for changig between std::string and std::wstring
View
1  include/otlib/OTSymmetricKey.hpp
@@ -138,6 +138,7 @@
#include <WinsockWrapper.h>
#include <OTPayload.hpp>
+#include <OTIdentifier.hpp>
class OTString;
View
14 include/ots/OTClientConnection.hpp
@@ -137,9 +137,23 @@
#include <ExportWrapper.h>
#include <WinsockWrapper.h>
+#ifndef IMPORT
+#define IMPORT
+#ifndef IMPORT_SET
+#define IMPORT_SET
+#endif
+#endif
+
#include <OTData.hpp>
#include <OTMessageBuffer.hpp>
+#ifdef IMPORT_SET
+#undef IMPORT_SET
+#ifdef IMPORT
+#undef IMPORT
+#include <ExportWrapper.h>
+#endif
+#endif
#ifdef __cplusplus
View
14 include/ots/OTServer.hpp
@@ -137,12 +137,26 @@
#include <ExportWrapper.h>
#include <WinsockWrapper.h>
+#ifndef IMPORT
+#define IMPORT
+#ifndef IMPORT_SET
+#define IMPORT_SET
+#endif
+#endif
+
#include <OTAssetContract.hpp>
#include <OTPseudonym.hpp>
#include <OTAccount.hpp>
#include <OTCron.hpp>
#include <OTTransaction.hpp>
+#ifdef IMPORT_SET
+#undef IMPORT_SET
+#ifdef IMPORT
+#undef IMPORT
+#include <ExportWrapper.h>
+#endif
+#endif
class OTMessage;
class OTClientConnection;
View
4 include/simpleini/SimpleIni.hpp
@@ -225,7 +225,7 @@
#ifdef _DEBUG
# ifndef assert
-# include <cassert>
+# include <assert.h>
# endif
# define SI_ASSERT(x) assert(x)
#else
@@ -1763,7 +1763,7 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::LoadMultiLineText(
}
// end the line with a NULL
- assert(NULL != a_pData);
+ SI_ASSERT(NULL != a_pData);
cEndOfLineChar = *a_pData;
*a_pData = 0;
View
8 project/ot/ot.vcxproj
@@ -130,7 +130,7 @@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;OT_ZMQ_MODE;_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;OT_ZMQ_MODE;_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
</ClCompile>
@@ -143,7 +143,7 @@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;OT_ZMQ_MODE;_DEBUG;DEBUG;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;OT_ZMQ_MODE;_DEBUG;DEBUG;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
</ClCompile>
@@ -158,7 +158,7 @@
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;OT_ZMQ_MODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;OT_ZMQ_MODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
@@ -176,7 +176,7 @@
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;OT_ZMQ_MODE;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;OT_ZMQ_MODE;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
View
8 project/otmint/otmint.vcxproj
@@ -147,7 +147,7 @@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
</ClCompile>
@@ -161,7 +161,7 @@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;_DEBUG;DEBUG;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;_DEBUG;DEBUG;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
</ClCompile>
@@ -177,7 +177,7 @@
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
@@ -196,7 +196,7 @@
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
View
8 project/otserver/otserver.vcxproj
@@ -153,7 +153,7 @@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
</ClCompile>
@@ -167,7 +167,7 @@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;_DEBUG;DEBUG;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;_DEBUG;DEBUG;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
</ClCompile>
@@ -183,7 +183,7 @@
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
@@ -202,7 +202,7 @@
<Optimization>MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>_UNICODE;UNICODE;IMPORT;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;_WIN64;_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/bigobj /Zm480 /wd4512 /wd4100 /wd4267 </AdditionalOptions>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PrecompiledHeaderFile>stdafx.hpp</PrecompiledHeaderFile>
View
7 src/otapi/OTServerConnection.cpp
@@ -148,7 +148,12 @@
#include <OTPseudonym.hpp>
#include <OTWallet.hpp>
-
+extern "C"
+{
+#if defined (OPENTXS_HAVE_NETINET_IN_H)
+#include <netinet/in.h>
+#endif
+}
int allow_debug = 1;
View
8 src/otapi/OpenTransactions.cpp
@@ -171,14 +171,12 @@
#include "simpleini/SimpleIni.hpp"
#include "tinythread.hpp"
-extern "C"
+#if defined (OPENTXS_HAVE_NETINET_IN_H)
+extern "C"
{
-#ifdef _WIN32
-#else
#include <netinet/in.h>
-#endif
}
-
+#endif
#define CLIENT_CONFIG_KEY "client"
View
8 src/otapi/testclient.cpp
@@ -145,13 +145,17 @@ extern "C"
#ifdef _WIN32
//#include <WinSock.h>
#else
-#include <netinet/in.h>
#include <wordexp.h>
#endif
-#include "SSL-Example/SFSocket.h"
}
+extern "C"
+{
+#if defined (OPENTXS_HAVE_NETINET_IN_H)
+#include <netinet/in.h>
+#endif
+}
#ifdef _WIN32
void OT_Sleep(int nMS);
View
77 src/otlib/Makefile.am
@@ -61,60 +61,61 @@ endif
####################################################################
-otlib_sources = OTAccount.cpp \
- OTAgreement.cpp \
+otlib_sources = OTAccount.cpp \
+ OTAgreement.cpp \
OTASCIIArmor.cpp \
- OTAssert.cpp \
+ OTAssert.cpp \
OTAssetContract.cpp \
OTAsymmetricKey.cpp \
- OTBasket.cpp \
- OTBylaw.cpp \
- OTCachedKey.cpp \
- OTCheque.cpp \
- OTContract.cpp \
+ OTBasket.cpp \
+ OTBylaw.cpp \
+ OTCachedKey.cpp \
+ OTCheque.cpp \
+ OTContract.cpp \
OTCredential.cpp \
- OTCron.cpp \
- OTCronItem.cpp \
- OTCrypto.cpp \
- OTData.cpp \
- OTDataCheck.cpp \
+ OTCron.cpp \
+ OTCronItem.cpp \
+ OTCrypto.cpp \
+ OTData.cpp \
+ OTDataCheck.cpp \
OTDigitalCash.cpp \
- OTEnvelope.cpp \
- OTKeyring.cpp \
+ OTEnvelope.cpp \
OTIdentifier.cpp \
OTInstrument.cpp \
- OTItem.cpp \
- OTLedger.cpp \
- OTLog.cpp \
- OTMarket.cpp \
- OTMessage.cpp \
+ OTItem.cpp \
+ OTKeyring.cpp \
+ OTLedger.cpp \
+ OTLog.cpp \
+ OTMarket.cpp \
+ OTMessage.cpp \
OTMessageBuffer.cpp \
- OTMint.cpp \
- OTOffer.cpp \
- OTPassword.cpp \
- OTPaths.cpp \
- OTPayload.cpp \
- OTPayment.cpp \
+ OTMint.cpp \
+ OTOffer.cpp \
+ OTPassword.cpp \
+ OTPaths.cpp \
+ OTPayload.cpp \
+ OTPayment.cpp \
OTPaymentPlan.cpp \
- OTPseudonym.cpp \
- OTPurse.cpp \
- OTScript.cpp \
+ OTPseudonym.cpp \
+ OTPurse.cpp \
+ OTScript.cpp \
OTScriptable.cpp \
OTServerContract.cpp \
- OTSettings.cpp \
- OTSignature.cpp \
+ OTSettings.cpp \
+ OTSignature.cpp \
OTSignedFile.cpp \
OTSmartContract.cpp \
- OTStorage.cpp \
- OTString.cpp \
- OTStringXML.cpp \
+ OTStorage.cpp \
+ OTString.cpp \
+ OTStringXML.cpp \
OTSymmetricKey.cpp \
- OTToken.cpp \
- OTTrackable.cpp \
- OTTrade.cpp \
+ OTToken.cpp \
+ OTTrackable.cpp \
+ OTTrade.cpp \
OTTransaction.cpp \
OTTransactionType.cpp \
- OTWallet.cpp
+ OTWallet.cpp
+
otlib_headers_dir = $(opentxs_include_dir)/otlib
View
1  src/otlib/OTAssert.cpp
@@ -130,6 +130,7 @@
#include <iostream>
#include <fstream>
+#include <cstring>
#include <assert.h>
View
4 src/otlib/OTAsymmetricKey.cpp
@@ -143,6 +143,8 @@
#include <OTCrypto.hpp>
#include <OTSignature.hpp>
+#include <stacktrace.h>
+
// -------------------------------------------------------------------------------------------
@@ -482,9 +484,7 @@ const EVP_PKEY * OTAsymmetricKey_OpenSSL::GetKey(OTPasswordData * pPWData/*=NULL
if (NULL == m_p_ascKey)
{
OTLog::vError("%s: Unexpected NULL m_p_ascKey. Printing stack trace (and returning NULL):\n", __FUNCTION__);
-#ifndef _WIN32
print_stacktrace();
-#endif
return NULL;
}
// ----------------------------------------
View
7 src/otlib/OTEnvelope.cpp
@@ -142,6 +142,13 @@
#include <OTPseudonym.hpp>
+extern "C"
+{
+#if defined (OPENTXS_HAVE_NETINET_IN_H)
+#include <netinet/in.h>
+#endif
+}
+
// ------------------------------------------------------------------------
// Presumably this Envelope contains encrypted data (in binary form.)
View
28 src/otlib/OTLog.cpp
@@ -145,6 +145,7 @@
#include <exception>
#include <constants.h>
+#include <stacktrace.h>
#ifdef _WIN32
#include <Shlobj.h>
@@ -154,16 +155,6 @@
#include <unistd.h>
#endif
-
-#ifndef S_ISDIR
-#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
-#endif
-
-#ifndef S_ISREG
-#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
-#endif
-
-
#ifdef __APPLE__
#include "TargetConditionals.h"
#endif
@@ -381,7 +372,7 @@ bool OTLog::CheckLogger(OTLog * pLogger)
if (NULL != pLogger)
if (pLogger->m_bInitialized) return true;
- assert(false);
+ OT_FAIL;
return false;
}
@@ -656,9 +647,7 @@ int OTLog::Assert(const char * szFilename, int nLinenumber, const char * szMessa
__android_log_write(ANDROID_LOG_FATAL,"OT Assert (or Fail)", szMessage);
#endif
-#ifndef _WIN32
print_stacktrace();
-#endif
}
return OTLog::Assert(szFilename, nLinenumber);
@@ -683,9 +672,7 @@ int OTLog::Assert(const char * szFilename, int nLinenumber)
__android_log_write(ANDROID_LOG_FATAL,"OT Assert", (const char *)strAndroidAssertMsg.Get());
#endif
-#ifndef _WIN32
print_stacktrace();
-#endif
}
return 1; // normal
}
@@ -800,11 +787,10 @@ void OTLog::vOutput(int nVerbosity, const char *szOutput, ...)
va_end(args);
// -------------------
- if (bFormatted)
- OTLog::Output(nVerbosity, strOutput.c_str());
- else
- if (bHaveLogger) { OT_FAIL; }
- else assert(false); //error
+ if (bFormatted)
+ OTLog::Output(nVerbosity, strOutput.c_str());
+ else
+ OT_FAIL;
return;
}
@@ -1537,7 +1523,7 @@ void crit_err_hdlr(int sig_num, siginfo_t *info, void *v)
tthread::lock_guard<tthread::mutex> lock(the_Mutex);
- assert(NULL != v);
+ OT_ASSERT(NULL != v);
int read = 0;
View
3  src/otlib/OTString.cpp
@@ -145,6 +145,9 @@
#include <sstream>
+#if !(_WIN32 || __IPHONE_7_0 || ANDROID)
+#include <wordexp.h>
+#endif
/*
int vsnprintf(char *str, size_t size, const char *format, va_list ap);
View
18 src/otlib/OTSymmetricKey.cpp
@@ -141,10 +141,17 @@
#include <OTPassword.hpp>
#include <OTAsymmetricKey.hpp>
+extern "C"
+{
+#if defined (OPENTXS_HAVE_NETINET_IN_H)
+#include <netinet/in.h>
+#endif
+}
+
+
//// ------------------------------------------------------------------------
-//extern "C"
-//{
+
//#ifdef _WIN32
//#include <WinsockWrapper.h>
//#else
@@ -152,13 +159,6 @@
//#if defined (OPENTXS_HAVE_SYS_TYPES_H)
//#include <sys/types.h>
//#endif
-//
-//#if defined (OPENTXS_HAVE_NETINET_IN_H)
-//#include <netinet/in.h>
-//#endif
-//
-//#endif
-//}
// ------------------------------------------------------------------------
View
8 src/ots/OTClientConnection.cpp
@@ -146,6 +146,14 @@
#include <OTMessage.hpp>
+extern "C"
+{
+#if defined (OPENTXS_HAVE_NETINET_IN_H)
+#include <netinet/in.h>
+#endif
+}
+
+
void SetupHeader( union u_header * pCMD, int nTypeID, int nCmdID, OTPayload & thePayload)
{
View
10 src/ots/testserver.cpp
@@ -147,13 +147,19 @@ extern "C"
#ifdef _WIN32
//#include <WinSock.h>
#else
-#include <netinet/in.h>
+
#include <wordexp.h>
#endif
+}
-#include "SSL-Example/SFSocket.h"
+extern "C"
+{
+#if defined (OPENTXS_HAVE_NETINET_IN_H)
+#include <netinet/in.h>
+#endif
}
+
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.