more windows related changes, check what I was thinking with that BOOST1_51 when not in a hurry, maybe it should just be removed now

This commit is contained in:
dnotestein 2013-08-10 22:11:59 -04:00
parent d9b5769c13
commit 94ce5cd9f2
9 changed files with 28 additions and 16 deletions

View file

@ -10,35 +10,40 @@ INCLUDE( SetupTargetMacros )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include )
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/cyoencode-1.0.2/src )
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost_1.51/include )
SET( DEFAULT_HEADER_INSTALL_DIR include/\${target} )
SET( DEFAULT_LIBRARY_INSTALL_DIR lib/ )
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )
SET( CMAKE_DEBUG_POSTFIX _debug )
SET( BUILD_SHARED_LIBS NO )
SET(Boost_USE_STATIC_LIBS ON)
FIND_PACKAGE(Boost 1.51 COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context )
if( WIN32 )
set( RPCRT4 Rpcrt4 )
#boost
SET( Boost_INCLUDE_DIR $ENV{BOOST_ROOT} )
else(WIN32)
SET(Boost_USE_STATIC_LIBS ON)
FIND_PACKAGE(Boost 1.51 COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context )
endif( WIN32 )
LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
IF( WIN32 )
ADD_DEFINITIONS( -DWIN32 )
ADD_DEFINITIONS( -DBOOST_CONTEXT_NO_LIB )
#ADD_DEFINITIONS( -DBOOST_CONTEXT_NO_LIB )
ADD_DEFINITIONS( -DNOMINMAX )
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
ADD_DEFINITIONS( -D_WIN32_WINNT=0x0501 )
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
ADD_DEFINITIONS( -DBOOST_ALL_NO_LIB -DBOOST_THREAD_BUILD_LIB)
#USE SHARED LIBS FOR BOOST ON WINDOWS
#ADD_DEFINITIONS( -DBOOST_ALL_NO_LIB -DBOOST_THREAD_BUILD_LIB)
ADD_DEFINITIONS( -DWIN32)
# Activate C++ exception handling
IF (NOT CMAKE_CXX_FLAGS MATCHES "/EHsc")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
ENDIF()
ELSE(WIN32)
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost_1.51/include )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wno-unused-local-typedefs -fmax-errors=3" )
ENDIF(WIN32)
@ -162,7 +167,7 @@ IF( UNIX )
ENDIF()
ENDIF( UNIX )
IF( WIN32 )
IF( BOOST_1_51 )
ENABLE_LANGUAGE(ASM_MASM)
# SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa" )
@ -188,7 +193,7 @@ IF( WIN32 )
message(STATUS " item type from 'Does not participate in build' to 'Microsoft Macro Assembler'")
ENDIF()
ENDIF(WIN32)
ENDIF(BOOST_1_51)
set( sources
${fc_sources}

View file

@ -191,10 +191,12 @@ namespace fc
* @brief Checks a condition and throws an assert_exception if the test is FALSE
*/
#define FC_ASSERT( TEST, ... ) \
if( !(TEST) ) { FC_THROW_EXCEPTION( assert_exception, #TEST __VA_ARGS__ ); }
do { if( !(TEST) ) { FC_THROW_EXCEPTION( assert_exception, #TEST ": " __VA_ARGS__ ); } } while(0);
#define FC_THROW( FORMAT, ... ) \
throw fc::exception( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) )
do { \
throw fc::exception( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) ); \
} while(0)
#define FC_EXCEPTION( EXCEPTION_TYPE, FORMAT, ... ) \
fc::EXCEPTION_TYPE( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) )
@ -204,7 +206,9 @@ if( !(TEST) ) { FC_THROW_EXCEPTION( assert_exception, #TEST __VA_ARGS__ ); }
* @param format - a const char* string with "${keys}"
*/
#define FC_THROW_EXCEPTION( EXCEPTION, FORMAT, ... ) \
throw fc::EXCEPTION( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) )
do { \
throw fc::EXCEPTION( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) ); \
} while(0)
/**

View file

@ -1,5 +1,5 @@
#pragma once
#include <fc/future.hpp>
//#include <fc/future.hpp>
#include <functional>
#include <boost/config.hpp>
#include <boost/preprocessor/repeat.hpp>

View file

@ -40,7 +40,7 @@ namespace fc { namespace rpc {
*/
///@{
void add_method( const fc::string& name, method );
void add_method( const fc::string& name, named_param_method );
void add_named_param_method( const fc::string& name, named_param_method );
void remove_method( const fc::string& name );
//@}

View file

@ -40,7 +40,7 @@ namespace fc { namespace rpc {
*/
///@{
void add_method( const fc::string& name, method );
void add_method( const fc::string& name, named_param_method );
void add_named_param_method( const fc::string& name, named_param_method );
void remove_method( const fc::string& name );
//@}

View file

@ -67,7 +67,7 @@ namespace fc
friend bool operator >= ( const uint128& l, const uint128& r ) { return l == r || l > r; }
friend bool operator <= ( const uint128& l, const uint128& r ) { return l == r || l < r; }
uint32_t to_integer()const { return lo; }
uint32_t to_integer()const { return (uint32_t)lo; }
uint64_t to_uint64()const { return lo; }
uint64_t low_bits()const { return lo; }
uint64_t high_bits()const { return hi; }

View file

@ -1,5 +1,5 @@
#include <stdint.h>
#include <zlib.h>
//#include <zlib.h>
/* Tables generated with code like the following:
#define CRCPOLY 0x82f63b78 // reversed 0x1EDC6F41

View file

@ -272,7 +272,7 @@ namespace fc { namespace rpc {
{
my->_methods.emplace(std::pair<std::string,method>(name,fc::move(m)));
}
void json_connection::add_method( const fc::string& name, named_param_method m )
void json_connection::add_named_param_method( const fc::string& name, named_param_method m )
{
my->_named_param_methods.emplace(std::pair<std::string,named_param_method>(name,fc::move(m)));
}

View file

@ -1,6 +1,9 @@
#include <fc/uint128.hpp>
#include <fc/variant.hpp>
#include <fc/crypto/bigint.hpp>
#ifdef WIN32
#include <WinSock2.h>
#endif
namespace fc
{