Skip to content

Commit

Permalink
Fix 32-bit Linux builds with XDelta enabled (#15980)
Browse files Browse the repository at this point in the history
* First crack at a GitHub Actions pipeline for 32-bit Linux

* Simplify the integer typedefs in xdelta3.h

* Add XDelta to Linux.yml
  • Loading branch information
JesseTG authored Dec 6, 2023
1 parent 6ac1fb7 commit 750b64d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 40 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
@@ -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
43 changes: 3 additions & 40 deletions deps/xdelta3/xdelta3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit 750b64d

Please sign in to comment.