Skip to content

Commit

Permalink
Build fixes for Mac OS and Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
aivve committed Jan 14, 2018
1 parent 582dbc4 commit 9ebc54a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ else()
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
# maybe remove
set(WARNINGS "${WARNINGS} -Wno-unused-lambda-capture -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")
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")
if(NOT APPLE)
set(WARNINGS "${WARNINGS} -Wno-unused-lambda-capture")
endif()
# this ^
if(ARM)
set(WARNINGS "${WARNINGS} -Wno-error=inline-asm")
Expand Down Expand Up @@ -464,6 +467,10 @@ else()
endif()
endif()

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(CMAKE_EXE_LINKER_FLAGS "-pthread")
endif()

if (${BOOST_IGNORE_SYSTEM_PATHS} STREQUAL "ON")
set(Boost_NO_SYSTEM_PATHS TRUE)
endif()
Expand Down
4 changes: 1 addition & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ target_link_libraries(SimpleWallet Wallet NodeRpcProxy Transfers Rpc Http Crypto
target_link_libraries(PaymentGateService PaymentGate JsonRpcServer Wallet NodeRpcProxy Transfers CryptoNoteCore Crypto P2P Rpc Http System Logging Common InProcessNode upnpc-static BlockchainExplorer ${Boost_LIBRARIES} Serialization ${EXTRA_LIBRARIES})
target_link_libraries(Miner CryptoNoteCore Rpc System Http Logging Common Crypto ${Boost_LIBRARIES} Serialization ${EXTRA_LIBRARIES})

if (LINUX)

if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR APPLE)
target_link_libraries(SimpleWallet -lresolv)

endif ()

add_dependencies(Rpc version)
Expand Down
4 changes: 2 additions & 2 deletions src/SimpleWallet/SimpleWallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1838,10 +1838,10 @@ bool simple_wallet::fetch_dns_txt(const std::string domain, std::string &record)
ns_type type = ns_t_txt;

const char * c_domain = (domain).c_str();
response = res_query(c_domain, C_IN, type, query_buffer, sizeof(query_buffer));
response = res_query(c_domain, 1, type, query_buffer, sizeof(query_buffer));

if (response < 0)
return false;
return 1;
}

ns_initparse(query_buffer, response, &nsMsg);
Expand Down
8 changes: 4 additions & 4 deletions src/crypto/aesb.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ extern "C"
#define RC_LENGTH (5 * (AES_BLOCK_SIZE / 4 - 2))

#if defined(_MSC_VER)
#define ALIGN __declspec(align(TABLE_ALIGN))
#define ALIGN2 __declspec(align(TABLE_ALIGN))
#elif defined(__GNUC__)
#define ALIGN __attribute__ ((aligned(16)))
#define ALIGN2 __attribute__ ((aligned(16)))
#else
#define ALIGN
#define ALIGN2
#endif

#define rf1(r,c) (r)
Expand Down Expand Up @@ -130,7 +130,7 @@ extern "C"
#define t_set(m,n) t_##m##n
#define t_use(m,n) t_##m##n

#define d_4(t,n,b,e,f,g,h) ALIGN const t n[4][256] = { b(e), b(f), b(g), b(h) }
#define d_4(t,n,b,e,f,g,h) ALIGN2 const t n[4][256] = { b(e), b(f), b(g), b(h) }

#define four_tables(x,tab,vf,rf,c) \
(tab[0][bval(vf(x,0,c),rf(0,c))] \
Expand Down

0 comments on commit 9ebc54a

Please sign in to comment.