Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ad291f5

Browse files
author
Antonio Juarez
committed
Bytecoin RPC Wallet
1 parent 89271f5 commit ad291f5

File tree

757 files changed

+144576
-19417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

757 files changed

+144576
-19417
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
/build
33
/tags
4+
.idea

CMakeLists.txt

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ set(VERSION "0.1")
44
# $Format:Packaged from commit %H%nset(COMMIT %h)%nset(REFS "%d")$
55

66
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
7-
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
8-
enable_testing()
7+
set(CMAKE_CONFIGURATION_TYPES Debug RelWithDebInfo Release CACHE TYPE INTERNAL)
8+
set(CMAKE_SKIP_INSTALL_RULES ON)
9+
set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY ON)
10+
set(CMAKE_SUPPRESS_REGENERATION ON)
11+
#enable_testing()
12+
13+
project(Bytecoin)
914

1015
include_directories(include src contrib/epee/include external "${CMAKE_BINARY_DIR}/version")
1116
if(APPLE)
1217
include_directories(SYSTEM /usr/include/malloc)
18+
enable_language(ASM)
1319
endif()
1420

1521
if(MSVC)
@@ -20,26 +26,30 @@ else()
2026
include_directories(src/Platform/Linux)
2127
endif()
2228

23-
2429
set(STATIC ${MSVC} CACHE BOOL "Link libraries statically")
2530

2631
if(MSVC)
2732
add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /D_VARIADIC_MAX=8 /D__SSE4_1__")
2833
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10485760")
2934
if(STATIC)
30-
foreach(VAR CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO)
35+
foreach(VAR CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE)
3136
string(REPLACE "/MD" "/MT" ${VAR} "${${VAR}}")
3237
endforeach()
3338
endif()
3439
include_directories(SYSTEM src/platform/msc)
3540
else()
41+
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
42+
# This option has no effect in glibc version less than 2.20.
43+
# Since glibc 2.20 _BSD_SOURCE is deprecated, this macro is recomended instead
44+
add_definitions("-D_DEFAULT_SOURCE -D_GNU_SOURCE")
45+
endif()
3646
set(ARCH native CACHE STRING "CPU to build for: -march value or default")
3747
if("${ARCH}" STREQUAL "default")
3848
set(ARCH_FLAG "")
3949
else()
4050
set(ARCH_FLAG "-march=${ARCH}")
4151
endif()
42-
set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Werror -Wno-error=extra -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized -Wno-error=unused-result")
52+
set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Werror -Wno-error=extra -Wno-error=unused-function -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized -Wno-error=unused-result")
4353
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
4454
set(WARNINGS "${WARNINGS} -Wno-error=mismatched-tags -Wno-error=null-conversion -Wno-overloaded-shift-op-parentheses -Wno-error=shift-count-overflow -Wno-error=tautological-constant-out-of-range-compare -Wno-error=unused-private-field -Wno-error=unneeded-internal-declaration -Wno-error=unused-function")
4555
else()
@@ -54,8 +64,11 @@ else()
5464
endif()
5565
set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes")
5666
set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers")
57-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} -maes")
58-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} -maes")
67+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${MINGW_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} -maes")
68+
if(NOT APPLE)
69+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
70+
endif()
71+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} -maes")
5972
if(APPLE)
6073
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_HAS_TR1_TUPLE=0")
6174
endif()
@@ -67,6 +80,12 @@ else()
6780
set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable")
6881
if(NOT APPLE)
6982
# There is a clang bug that does not allow to compile code that uses AES-NI intrinsics if -flto is enabled
83+
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux"
84+
AND ${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ((CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.9) OR (CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.9)))
85+
# On linux, to build in lto mode, check that ld.gold linker is used: 'update-alternatives --install /usr/bin/ld ld /usr/bin/ld.gold HIGHEST_PRIORITY'
86+
set(CMAKE_AR gcc-ar)
87+
set(CMAKE_RANLIB gcc-ranlib)
88+
endif()
7089
set(RELEASE_FLAGS "${RELEASE_FLAGS} -flto")
7190
endif()
7291
#if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT MINGW)
@@ -85,10 +104,7 @@ if(STATIC)
85104
set(Boost_USE_STATIC_LIBS ON)
86105
set(Boost_USE_STATIC_RUNTIME ON)
87106
endif()
88-
find_package(Boost 1.53 REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options coroutine context)
89-
if((${Boost_MAJOR_VERSION} EQUAL 1) AND (${Boost_MINOR_VERSION} EQUAL 54))
90-
message(SEND_ERROR "Boost version 1.54 is unsupported, more details are available here http://goo.gl/RrCFmA")
91-
endif()
107+
find_package(Boost 1.55 REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options)
92108
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
93109
if(MINGW)
94110
set(Boost_LIBRARIES "${Boost_LIBRARIES};ws2_32;mswsock")

README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ Test suite: run `make test-release' to run tests in addition to building. Runnin
1818
Building with Clang: it may be possible to use Clang instead of GCC, but this may not work everywhere. To build, run `export CC=clang CXX=clang++' before running `make'.
1919

2020
On Windows:
21-
Dependencies: MSVC 2012 or later, CMake 2.8.6 or later, and Boost 1.55. You may download them from:
21+
Dependencies: MSVC 2013 or later, CMake 2.8.6 or later, and Boost 1.55. You may download them from:
2222
http://www.microsoft.com/
2323
http://www.cmake.org/
2424
http://www.boost.org/
2525

2626
To build, change to a directory where this file is located, and run this commands:
2727
mkdir build
2828
cd build
29-
cmake -G "Visual Studio 11 Win64" ..
29+
cmake -G "Visual Studio 12 Win64" ..
3030

3131
And then do Build.
3232
Good luck!

ReleaseNotes.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Release notes 1.0.4
2+
3+
- Bytecoin RPC Wallet
4+
- New multithreading library
5+
- Improved console logging
6+
- Further optimizations
7+
18
Release notes 1.0.3
29

310
- Multisignature API

contrib/epee/include/console_handler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <boost/algorithm/string/classification.hpp>
3636
#include <boost/algorithm/string/split.hpp>
3737

38+
#include "include_base_utils.h"
3839
#include "string_tools.h"
3940

4041
namespace epee

contrib/epee/include/net/abstract_tcp_server2.inl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,7 @@ POP_WARNINGS
757757
boost::asio::ip::tcp::endpoint remote_endpoint(*iterator);
758758

759759
sock_.open(remote_endpoint.protocol());
760+
760761
if(bind_ip != "0.0.0.0" && bind_ip != "0" && bind_ip != "" )
761762
{
762763
boost::asio::ip::tcp::endpoint local_endpoint(boost::asio::ip::address::from_string(adr.c_str()), 0);

external/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
set(UPNPC_BUILD_STATIC ON CACHE BOOL "Build static library")
22
set(UPNPC_BUILD_SHARED OFF CACHE BOOL "Build shared library")
33
set(UPNPC_BUILD_TESTS OFF CACHE BOOL "Build test executables")
4+
45
add_subdirectory(miniupnpc)
6+
add_subdirectory(gtest)
7+
8+
set_property(TARGET upnpc-static gtest gtest_main PROPERTY FOLDER "external")
59

6-
set_property(TARGET upnpc-static PROPERTY FOLDER "external")
710
if(MSVC)
811
set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
912
elseif(NOT MSVC)

external/gtest/CHANGES

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
Changes for 1.7.0:
2+
3+
* New feature: death tests are supported on OpenBSD and in iOS
4+
simulator now.
5+
* New feature: Google Test now implements a protocol to allow
6+
a test runner to detect that a test program has exited
7+
prematurely and report it as a failure (before it would be
8+
falsely reported as a success if the exit code is 0).
9+
* New feature: Test::RecordProperty() can now be used outside of the
10+
lifespan of a test method, in which case it will be attributed to
11+
the current test case or the test program in the XML report.
12+
* New feature (potentially breaking): --gtest_list_tests now prints
13+
the type parameters and value parameters for each test.
14+
* Improvement: char pointers and char arrays are now escaped properly
15+
in failure messages.
16+
* Improvement: failure summary in XML reports now includes file and
17+
line information.
18+
* Improvement: the <testsuites> XML element now has a timestamp attribute.
19+
* Improvement: When --gtest_filter is specified, XML report now doesn't
20+
contain information about tests that are filtered out.
21+
* Fixed the bug where long --gtest_filter flag values are truncated in
22+
death tests.
23+
* Potentially breaking change: RUN_ALL_TESTS() is now implemented as a
24+
function instead of a macro in order to work better with Clang.
25+
* Compatibility fixes with C++ 11 and various platforms.
26+
* Bug/warning fixes.
27+
28+
Changes for 1.6.0:
29+
30+
* New feature: ADD_FAILURE_AT() for reporting a test failure at the
31+
given source location -- useful for writing testing utilities.
32+
* New feature: the universal value printer is moved from Google Mock
33+
to Google Test.
34+
* New feature: type parameters and value parameters are reported in
35+
the XML report now.
36+
* A gtest_disable_pthreads CMake option.
37+
* Colored output works in GNU Screen sessions now.
38+
* Parameters of value-parameterized tests are now printed in the
39+
textual output.
40+
* Failures from ad hoc test assertions run before RUN_ALL_TESTS() are
41+
now correctly reported.
42+
* Arguments of ASSERT_XY and EXPECT_XY no longer need to support << to
43+
ostream.
44+
* More complete handling of exceptions.
45+
* GTEST_ASSERT_XY can be used instead of ASSERT_XY in case the latter
46+
name is already used by another library.
47+
* --gtest_catch_exceptions is now true by default, allowing a test
48+
program to continue after an exception is thrown.
49+
* Value-parameterized test fixtures can now derive from Test and
50+
WithParamInterface<T> separately, easing conversion of legacy tests.
51+
* Death test messages are clearly marked to make them more
52+
distinguishable from other messages.
53+
* Compatibility fixes for Android, Google Native Client, MinGW, HP UX,
54+
PowerPC, Lucid autotools, libCStd, Sun C++, Borland C++ Builder (Code Gear),
55+
IBM XL C++ (Visual Age C++), and C++0x.
56+
* Bug fixes and implementation clean-ups.
57+
* Potentially incompatible changes: disables the harmful 'make install'
58+
command in autotools.
59+
60+
Changes for 1.5.0:
61+
62+
* New feature: assertions can be safely called in multiple threads
63+
where the pthreads library is available.
64+
* New feature: predicates used inside EXPECT_TRUE() and friends
65+
can now generate custom failure messages.
66+
* New feature: Google Test can now be compiled as a DLL.
67+
* New feature: fused source files are included.
68+
* New feature: prints help when encountering unrecognized Google Test flags.
69+
* Experimental feature: CMake build script (requires CMake 2.6.4+).
70+
* Experimental feature: the Pump script for meta programming.
71+
* double values streamed to an assertion are printed with enough precision
72+
to differentiate any two different values.
73+
* Google Test now works on Solaris and AIX.
74+
* Build and test script improvements.
75+
* Bug fixes and implementation clean-ups.
76+
77+
Potentially breaking changes:
78+
79+
* Stopped supporting VC++ 7.1 with exceptions disabled.
80+
* Dropped support for 'make install'.
81+
82+
Changes for 1.4.0:
83+
84+
* New feature: the event listener API
85+
* New feature: test shuffling
86+
* New feature: the XML report format is closer to junitreport and can
87+
be parsed by Hudson now.
88+
* New feature: when a test runs under Visual Studio, its failures are
89+
integrated in the IDE.
90+
* New feature: /MD(d) versions of VC++ projects.
91+
* New feature: elapsed time for the tests is printed by default.
92+
* New feature: comes with a TR1 tuple implementation such that Boost
93+
is no longer needed for Combine().
94+
* New feature: EXPECT_DEATH_IF_SUPPORTED macro and friends.
95+
* New feature: the Xcode project can now produce static gtest
96+
libraries in addition to a framework.
97+
* Compatibility fixes for Solaris, Cygwin, minGW, Windows Mobile,
98+
Symbian, gcc, and C++Builder.
99+
* Bug fixes and implementation clean-ups.
100+
101+
Changes for 1.3.0:
102+
103+
* New feature: death tests on Windows, Cygwin, and Mac.
104+
* New feature: ability to use Google Test assertions in other testing
105+
frameworks.
106+
* New feature: ability to run disabled test via
107+
--gtest_also_run_disabled_tests.
108+
* New feature: the --help flag for printing the usage.
109+
* New feature: access to Google Test flag values in user code.
110+
* New feature: a script that packs Google Test into one .h and one
111+
.cc file for easy deployment.
112+
* New feature: support for distributing test functions to multiple
113+
machines (requires support from the test runner).
114+
* Bug fixes and implementation clean-ups.
115+
116+
Changes for 1.2.1:
117+
118+
* Compatibility fixes for Linux IA-64 and IBM z/OS.
119+
* Added support for using Boost and other TR1 implementations.
120+
* Changes to the build scripts to support upcoming release of Google C++
121+
Mocking Framework.
122+
* Added Makefile to the distribution package.
123+
* Improved build instructions in README.
124+
125+
Changes for 1.2.0:
126+
127+
* New feature: value-parameterized tests.
128+
* New feature: the ASSERT/EXPECT_(NON)FATAL_FAILURE(_ON_ALL_THREADS)
129+
macros.
130+
* Changed the XML report format to match JUnit/Ant's.
131+
* Added tests to the Xcode project.
132+
* Added scons/SConscript for building with SCons.
133+
* Added src/gtest-all.cc for building Google Test from a single file.
134+
* Fixed compatibility with Solaris and z/OS.
135+
* Enabled running Python tests on systems with python 2.3 installed,
136+
e.g. Mac OS X 10.4.
137+
* Bug fixes.
138+
139+
Changes for 1.1.0:
140+
141+
* New feature: type-parameterized tests.
142+
* New feature: exception assertions.
143+
* New feature: printing elapsed time of tests.
144+
* Improved the robustness of death tests.
145+
* Added an Xcode project and samples.
146+
* Adjusted the output format on Windows to be understandable by Visual Studio.
147+
* Minor bug fixes.
148+
149+
Changes for 1.0.1:
150+
151+
* Added project files for Visual Studio 7.1.
152+
* Fixed issues with compiling on Mac OS X.
153+
* Fixed issues with compiling on Cygwin.
154+
155+
Changes for 1.0.0:
156+
157+
* Initial Open Source release of Google Test

tests/gtest/CMakeLists.txt renamed to external/gtest/CMakeLists.txt

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ target_link_libraries(gtest_main gtest)
7777
#
7878
# They are not built by default. To build them, set the
7979
# gtest_build_samples option to ON. You can do it by running ccmake
80-
# or specifying the -Dbuild_gtest_samples=ON flag when running cmake.
80+
# or specifying the -Dgtest_build_samples=ON flag when running cmake.
8181

8282
if (gtest_build_samples)
8383
cxx_executable(sample1_unittest samples gtest_main samples/sample1.cc)
@@ -124,6 +124,8 @@ if (gtest_build_tests)
124124
test/gtest-param-test2_test.cc)
125125
cxx_test(gtest-port_test gtest_main)
126126
cxx_test(gtest_pred_impl_unittest gtest_main)
127+
cxx_test(gtest_premature_exit_test gtest
128+
test/gtest_premature_exit_test.cc)
127129
cxx_test(gtest-printers_test gtest_main)
128130
cxx_test(gtest_prod_test gtest_main
129131
test/production.cc)
@@ -140,10 +142,13 @@ if (gtest_build_tests)
140142
############################################################
141143
# C++ tests built with non-standard compiler flags.
142144

143-
cxx_library(gtest_no_exception "${cxx_no_exception}"
144-
src/gtest-all.cc)
145-
cxx_library(gtest_main_no_exception "${cxx_no_exception}"
146-
src/gtest-all.cc src/gtest_main.cc)
145+
# MSVC 7.1 does not support STL with exceptions disabled.
146+
if (NOT MSVC OR MSVC_VERSION GREATER 1310)
147+
cxx_library(gtest_no_exception "${cxx_no_exception}"
148+
src/gtest-all.cc)
149+
cxx_library(gtest_main_no_exception "${cxx_no_exception}"
150+
src/gtest-all.cc src/gtest_main.cc)
151+
endif()
147152
cxx_library(gtest_main_no_rtti "${cxx_no_rtti}"
148153
src/gtest-all.cc src/gtest_main.cc)
149154

@@ -189,11 +194,15 @@ if (gtest_build_tests)
189194
cxx_executable(gtest_break_on_failure_unittest_ test gtest)
190195
py_test(gtest_break_on_failure_unittest)
191196

192-
cxx_executable_with_flags(
193-
gtest_catch_exceptions_no_ex_test_
194-
"${cxx_no_exception}"
195-
gtest_main_no_exception
196-
test/gtest_catch_exceptions_test_.cc)
197+
# MSVC 7.1 does not support STL with exceptions disabled.
198+
if (NOT MSVC OR MSVC_VERSION GREATER 1310)
199+
cxx_executable_with_flags(
200+
gtest_catch_exceptions_no_ex_test_
201+
"${cxx_no_exception}"
202+
gtest_main_no_exception
203+
test/gtest_catch_exceptions_test_.cc)
204+
endif()
205+
197206
cxx_executable_with_flags(
198207
gtest_catch_exceptions_ex_test_
199208
"${cxx_exception}"
@@ -222,11 +231,14 @@ if (gtest_build_tests)
222231
cxx_executable(gtest_shuffle_test_ test gtest)
223232
py_test(gtest_shuffle_test)
224233

225-
cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception)
226-
set_target_properties(gtest_throw_on_failure_test_
227-
PROPERTIES
228-
COMPILE_FLAGS "${cxx_no_exception}")
229-
py_test(gtest_throw_on_failure_test)
234+
# MSVC 7.1 does not support STL with exceptions disabled.
235+
if (NOT MSVC OR MSVC_VERSION GREATER 1310)
236+
cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception)
237+
set_target_properties(gtest_throw_on_failure_test_
238+
PROPERTIES
239+
COMPILE_FLAGS "${cxx_no_exception}")
240+
py_test(gtest_throw_on_failure_test)
241+
endif()
230242

231243
cxx_executable(gtest_uninitialized_test_ test gtest)
232244
py_test(gtest_uninitialized_test)

0 commit comments

Comments
 (0)