Linux ARM compile fixes (#4399)

This fixes errors when compiling in ARM
This commit is contained in:
Marco Trevisan 2018-03-09 21:48:47 +01:00 committed by John Preston
parent def21367a3
commit 9dc03c4f0f
16 changed files with 40 additions and 15 deletions

View File

@ -23,7 +23,7 @@ struct SendingAlbum;
enum class SendMediaType;
namespace Storage {
enum class SharedMediaType : char;
enum class SharedMediaType : signed char;
struct PreparedList;
} // namespace Storage

View File

@ -47,6 +47,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86 1
#define ARCH_CPU_32_BITS 1
#elif defined(__aarch64__)
#define ARCH_CPU_64_BITS 1
#elif defined(_M_ARM) || defined(__arm__)
#define ARCH_CPU_32_BITS 1
#else
#error Please add support for your architecture in base/build_config.h
#endif

View File

@ -545,7 +545,11 @@ const dump &operator<<(const dump &stream, const wchar_t *str) {
if (!ReportFile) return stream;
for (int i = 0, l = wcslen(str); i < l; ++i) {
if (str[i] >= 0 && str[i] < 128) {
if (
#if !defined(__WCHAR_UNSIGNED__)
str[i] >= 0 &&
#endif
str[i] < 128) {
SafeWriteChar(char(str[i]));
} else {
SafeWriteChar('?');

View File

@ -16,7 +16,7 @@ class enum_mask;
} // namespace base
namespace Storage {
enum class SharedMediaType : char;
enum class SharedMediaType : signed char;
using SharedMediaTypesMask = base::enum_mask<SharedMediaType>;
} // namespace Storage

View File

@ -268,7 +268,7 @@ constexpr auto CancelledWebPageId = WebPageId(0xFFFFFFFFFFFFFFFFULL);
using PreparedPhotoThumbs = QMap<char, QPixmap>;
// [0] == -1 -- counting, [0] == -2 -- could not count
using VoiceWaveform = QVector<char>;
using VoiceWaveform = QVector<signed char>;
enum ActionOnLoad {
ActionOnLoadNone,

View File

@ -23,7 +23,7 @@ class enum_mask;
} // namespace base
namespace Storage {
enum class SharedMediaType : char;
enum class SharedMediaType : signed char;
using SharedMediaTypesMask = base::enum_mask<SharedMediaType>;
} // namespace Storage

View File

@ -18,7 +18,7 @@ class enum_mask;
} // namespace base
namespace Storage {
enum class SharedMediaType : char;
enum class SharedMediaType : signed char;
using SharedMediaTypesMask = base::enum_mask<SharedMediaType>;
} // namespace Storage

View File

@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/info_wrap_widget.h"
namespace Storage {
enum class SharedMediaType : char;
enum class SharedMediaType : signed char;
} // namespace Storage
namespace Ui {

View File

@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/section_memento.h"
namespace Storage {
enum class SharedMediaType : char;
enum class SharedMediaType : signed char;
} // namespace Storage
namespace Data {

View File

@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/section_widget.h"
namespace Storage {
enum class SharedMediaType : char;
enum class SharedMediaType : signed char;
} // namespace Storage
namespace Data {

View File

@ -18,7 +18,7 @@ class SlideWrap;
} // namespace Ui
namespace Storage {
enum class SharedMediaType : char;
enum class SharedMediaType : signed char;
} // namespace Storage
namespace Info {

View File

@ -8,8 +8,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <time.h>
#include <stdint.h>
#if defined(_M_IX86) || defined(__i386__)
#define GETTIME_GLIBC_VERSION "2.2"
#elif defined(_M_ARM) || defined(__arm__)
#define GETTIME_GLIBC_VERSION "2.4"
#else
#error Please add glibc wraps for your architecture
#endif
int __clock_gettime_glibc_old(clockid_t clk_id, struct timespec *tp);
__asm__(".symver __clock_gettime_glibc_old,clock_gettime@GLIBC_2.2");
__asm__(".symver __clock_gettime_glibc_old,clock_gettime@GLIBC_" GETTIME_GLIBC_VERSION);
int __wrap_clock_gettime(clockid_t clk_id, struct timespec *tp) {
return __clock_gettime_glibc_old(clk_id, tp);

View File

@ -7,8 +7,17 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include <time.h>
#if defined(_M_X64) || defined(__x86_64__)
#define GETTIME_GLIBC_VERSION "2.2.5"
#elif defined(__aarch64__)
#define GETTIME_GLIBC_VERSION "2.17"
#else
#error Please add glibc wraps for your architecture
#endif
int __clock_gettime_glibc_old(clockid_t clk_id, struct timespec *tp);
__asm__(".symver __clock_gettime_glibc_old,clock_gettime@GLIBC_2.2.5");
__asm__(".symver __clock_gettime_glibc_old,clock_gettime@GLIBC_" GETTIME_GLIBC_VERSION);
int __wrap_clock_gettime(clockid_t clk_id, struct timespec *tp) {
return __clock_gettime_glibc_old(clk_id, tp);

View File

@ -14,7 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Storage {
// Allow forward declarations.
enum class SharedMediaType : char {
enum class SharedMediaType : signed char {
Photo,
Video,
PhotoVideo,

View File

@ -14,7 +14,7 @@
'sources': [
'../SourceFiles/platform/linux/linux_glibc_wraps.c',
],
'conditions': [[ '"<!(uname -p)" == "x86_64"', {
'conditions': [[ '"<!(uname -p)" == "x86_64" or "<!(uname -p)" == "aarch64"', {
'sources': [
'../SourceFiles/platform/linux/linux_glibc_wraps_64.c',
],

View File

@ -25,7 +25,7 @@
],
},
'conditions': [
[ '"<!(uname -p)" == "x86_64"', {
[ '"<!(uname -p)" == "x86_64" or "<!(uname -p)" == "aarch64"', {
'defines': [
'Q_OS_LINUX64',
],