Skip to content

Commit

Permalink
Merge pull request #3119 from steemit/2018-10-22-ubuntu-18-04-build-fix
Browse files Browse the repository at this point in the history
Fix Ubuntu 18.04 LTS Build
  • Loading branch information
Michael Vandeberg committed Oct 30, 2018
2 parents a267222 + 071f6a9 commit 75300af
Show file tree
Hide file tree
Showing 96 changed files with 2,225 additions and 1,466 deletions.
2 changes: 1 addition & 1 deletion libraries/fc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ set( fc_sources
src/crypto/sha256.cpp
src/crypto/sha224.cpp
src/crypto/sha512.cpp
src/crypto/dh.cpp
src/crypto/blowfish.cpp
src/crypto/elliptic_common.cpp
src/crypto/equihash.cpp
Expand Down Expand Up @@ -369,6 +368,7 @@ target_include_directories(fc
${CMAKE_CURRENT_SOURCE_DIR}/vendor/cyoencode-1.0.2/src
${CMAKE_CURRENT_SOURCE_DIR}/vendor/secp256k1-zkp
${CMAKE_CURRENT_SOURCE_DIR}/vendor/equihash
${CMAKE_CURRENT_SOURCE_DIR}/vendor/bitcoin/src
)

#target_link_libraries( fc PUBLIC ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${ECC_LIB} )
Expand Down
2 changes: 1 addition & 1 deletion libraries/fc/include/fc/crypto/base58.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <fc/string.hpp>
#include <string>
#include <vector>

namespace fc {
Expand Down
26 changes: 0 additions & 26 deletions libraries/fc/include/fc/crypto/dh.hpp

This file was deleted.

3 changes: 1 addition & 2 deletions libraries/fc/include/fc/crypto/rand.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ namespace fc {

/* provides access to the OpenSSL random number generator */
void rand_bytes(char* buf, int count);
void rand_pseudo_bytes(char* buf, int count);
} // namespace fc
} // namespace fc
17 changes: 12 additions & 5 deletions libraries/fc/src/compress/miniz.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void

// Compresses an image to a compressed PNG file in memory.
// On entry:
// pImage, w, h, and num_chans describe the image to compress. num_chans may be 1, 2, 3, or 4.
// pImage, w, h, and num_chans describe the image to compress. num_chans may be 1, 2, 3, or 4.
// The image pitch in bytes per scanline will be w*num_chans. The leftmost pixel on the top scanline is stored first in memory.
// level may range from [0,10], use MZ_NO_COMPRESSION, MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc. or a decent default is MZ_DEFAULT_LEVEL
// If flip is true, the image will be flipped on the Y axis (useful for OpenGL apps).
Expand Down Expand Up @@ -1497,7 +1497,10 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex
{
mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i;
r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32);
for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
for ( i = 0; i <= 143; ++i) *p++ = 8;
for ( ; i <= 255; ++i) *p++ = 9;
for ( ; i <= 279; ++i) *p++ = 7;
for ( ; i <= 287; ++i) *p++ = 8;
}
else
{
Expand Down Expand Up @@ -2281,7 +2284,11 @@ static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahe
if (TDEFL_READ_UNALIGNED_WORD(&d->m_dict[probe_pos + match_len - 1]) == c01) break;
TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE;
}
if (!dist) break; q = (const mz_uint16*)(d->m_dict + probe_pos); if (TDEFL_READ_UNALIGNED_WORD(q) != s01) continue; p = s; probe_len = 32;
if (!dist) break;
q = (const mz_uint16*)(d->m_dict + probe_pos);
if (TDEFL_READ_UNALIGNED_WORD(q) != s01) continue;
p = s;
probe_len = 32;
do { } while ( (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) &&
(TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (--probe_len > 0) );
if (!probe_len)
Expand Down Expand Up @@ -2848,7 +2855,7 @@ void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h,
#include <stdio.h>
#include <sys/stat.h>

#if defined(_MSC_VER)
#if defined(_MSC_VER)
static FILE *mz_fopen(const char *pFilename, const char *pMode)
{
FILE* pFile = NULL;
Expand Down Expand Up @@ -4441,7 +4448,7 @@ mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name,

if (!mz_zip_get_file_modified_time(pSrc_filename, &dos_time, &dos_date))
return MZ_FALSE;

pSrc_file = MZ_FOPEN(pSrc_filename, "rb");
if (!pSrc_file)
return MZ_FALSE;
Expand Down
4 changes: 3 additions & 1 deletion libraries/fc/src/crypto/aes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@ openssl_thread_config::openssl_thread_config()
}
openssl_thread_config::~openssl_thread_config()
{
if (CRYPTO_get_id_callback() == &get_thread_id)
if ( CRYPTO_get_id_callback() != NULL &&
&get_thread_id != NULL &&
CRYPTO_get_id_callback() == &get_thread_id)
{
CRYPTO_set_id_callback(NULL);
CRYPTO_set_locking_callback(NULL);
Expand Down

0 comments on commit 75300af

Please sign in to comment.