From 750b64d89eb66f19248af4ae64dd85506d632a9d Mon Sep 17 00:00:00 2001 From: Jesse Talavera Date: Wed, 6 Dec 2023 08:07:46 -0500 Subject: [PATCH] Fix 32-bit Linux builds with XDelta enabled (#15980) * First crack at a GitHub Actions pipeline for 32-bit Linux * Simplify the integer typedefs in xdelta3.h * Add XDelta to Linux.yml --- .github/workflows/Linux.yml | 40 ++++++++++++++++++++++++++++++++++ deps/xdelta3/xdelta3.h | 43 +++---------------------------------- 2 files changed, 43 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/Linux.yml diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml new file mode 100644 index 000000000000..b8e9c6413be7 --- /dev/null +++ b/.github/workflows/Linux.yml @@ -0,0 +1,40 @@ +name: CI Linux (i686) + +on: + push: + pull_request: + repository_dispatch: + types: [run_build] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + container: + image: git.libretro.com:5050/libretro-infrastructure/libretro-build-i386-ubuntu:xenial-gcc9 + options: --user root + + steps: + - name: Check Out Repo + uses: actions/checkout@v3 + + - name: Configure Build + run: | + ./configure --disable-qt --enable-xdelta + + - name: Compile RA + run: | + make -j$(getconf _NPROCESSORS_ONLN) clean + make -j$(getconf _NPROCESSORS_ONLN) + + - name: Get short SHA + id: slug + run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" + + - uses: actions/upload-artifact@v3 + with: + name: retroarch_linux_i686${{ steps.slug.outputs.sha8 }} + path: | + retroarch diff --git a/deps/xdelta3/xdelta3.h b/deps/xdelta3/xdelta3.h index c858996512bb..cddd9712d349 100644 --- a/deps/xdelta3/xdelta3.h +++ b/deps/xdelta3/xdelta3.h @@ -191,68 +191,31 @@ _Static_assert(SIZEOF_UNSIGNED_LONG_LONG == sizeof(unsigned long long), "SIZEOF_ #endif /* Set a xoff_t typedef and the "Q" printf insert. */ -#if defined(_WIN32) typedef uint64_t xoff_t; -#define Q "I64" -#elif SIZEOF_UNSIGNED_LONG == 8 -typedef unsigned long xoff_t; -#define Q "l" -#elif SIZEOF_SIZE_T == 8 -typedef size_t xoff_t; -#define Q "z" -#elif SIZEOF_UNSIGNED_LONG_LONG == 8 -typedef unsigned long long xoff_t; #define Q "ll" -#endif /* typedef and #define Q */ - #define SIZEOF_XOFF_T 8 #else /* XD3_USE_LARGEFILE64 == 0 */ -#if SIZEOF_UNSIGNED_INT == 4 -typedef unsigned int xoff_t; -#elif SIZEOF_UNSIGNED_LONG == 4 -typedef unsigned long xoff_t; -#else typedef uint32_t xoff_t; -#endif /* xoff_t is 32 bits */ - -#define SIZEOF_XOFF_T 4 #define Q +#define SIZEOF_XOFF_T 4 + #endif /* 64 vs 32 bit xoff_t */ /* Settings based on the size of usize_t (32 and 64 bit window size) */ #if XD3_USE_LARGESIZET /* Set a usize_ttypedef and the "W" printf insert. */ -#if defined(_WIN32) typedef uint64_t usize_t; -#define W "I64" -#elif SIZEOF_UNSIGNED_LONG == 8 -typedef unsigned long usize_t; -#define W "l" -#elif SIZEOF_SIZE_T == 8 -typedef size_t usize_t; -#define W "z" -#elif SIZEOF_UNSIGNED_LONG_LONG == 8 -typedef unsigned long long usize_t; #define W "ll" -#endif /* typedef and #define W */ - #define SIZEOF_USIZE_T 8 #else /* XD3_USE_LARGESIZET == 0 */ -#if SIZEOF_UNSIGNED_INT == 4 -typedef unsigned int usize_t; -#elif SIZEOF_UNSIGNED_LONG == 4 -typedef unsigned long usize_t; -#else typedef uint32_t usize_t; -#endif /* usize_t is 32 bits */ - -#define SIZEOF_USIZE_T 4 #define W +#define SIZEOF_USIZE_T 4 #endif /* 64 vs 32 bit usize_t */