diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b5bd1de2..df625fd70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -566,6 +566,10 @@ if(TARGET_ARCH MATCHES "x86|x64") endif() endif() +if (TARGET_ARCH MATCHES "sparc") + set(HAVE_ALIGNED_REQUIRED 1) +endif() + # Path to put FreeRDP data set(FREERDP_DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/freerdp") diff --git a/cmake/ConfigOptions.cmake b/cmake/ConfigOptions.cmake index b3556cd65..bb20759f1 100644 --- a/cmake/ConfigOptions.cmake +++ b/cmake/ConfigOptions.cmake @@ -8,6 +8,8 @@ elseif((CMAKE_SYSTEM_PROCESSOR MATCHES "i386") AND (CMAKE_SIZEOF_VOID_P EQUAL 8) set(TARGET_ARCH "x64") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm*") set(TARGET_ARCH "ARM") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "sparc") + set(TARGET_ARCH "sparc") endif() option(WITH_MANPAGES "Generate manpages." ON) diff --git a/config.h.in b/config.h.in index d54ce1bfd..0c52491e9 100644 --- a/config.h.in +++ b/config.h.in @@ -32,6 +32,9 @@ #cmakedefine HAVE_VALGRIND_MEMCHECK_H #cmakedefine HAVE_EXECINFO_H +/* Features */ +#cmakedefine HAVE_ALIGNED_REQUIRED + /* Options */ #cmakedefine WITH_PROFILER #cmakedefine WITH_GPROF diff --git a/libfreerdp/codec/interleaved.c b/libfreerdp/codec/interleaved.c index 499386771..e6ecab8bd 100644 --- a/libfreerdp/codec/interleaved.c +++ b/libfreerdp/codec/interleaved.c @@ -206,7 +206,11 @@ static INLINE UINT32 ExtractRunLength(UINT32 code, BYTE* pbOrderHdr, UINT32* adv #undef RLEEXTRA #define DESTWRITEPIXEL(_buf, _pix) ((UINT16*)(_buf))[0] = (UINT16)(_pix) #define DESTREADPIXEL(_pix, _buf) _pix = ((UINT16*)(_buf))[0] +#ifdef HAVE_ALIGNED_REQUIRED +#define SRCREADPIXEL(_pix, _buf) _pix = (_buf)[0] | ((_buf)[1] << 8) +#else #define SRCREADPIXEL(_pix, _buf) _pix = ((UINT16*)(_buf))[0] +#endif #define DESTNEXTPIXEL(_buf) _buf += 2 #define SRCNEXTPIXEL(_buf) _buf += 2 #define WRITEFGBGIMAGE WriteFgBgImage16to16