Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python-ppmd
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian Python Team
packages
python-ppmd
Commits
3f18f3e3
Commit
3f18f3e3
authored
2 months ago
by
Colin Watson
Browse files
Options
Downloads
Patches
Plain Diff
Simplify 64-bit platform detection
It should be much more robust across all architectures now.
parent
1307100e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/changelog
+7
-0
7 additions, 0 deletions
debian/changelog
debian/patches/fix-64bit-platform-detection.patch
+56
-17
56 additions, 17 deletions
debian/patches/fix-64bit-platform-detection.patch
with
63 additions
and
17 deletions
debian/changelog
+
7
−
0
View file @
3f18f3e3
python-ppmd (0.5.0-4) UNRELEASED; urgency=medium
* Simplify 64-bit platform detection; it should be much more robust across
all architectures now.
-- Colin Watson <cjwatson@debian.org> Tue, 25 Mar 2025 10:03:37 +0000
python-ppmd (0.5.0-3) unstable; urgency=medium
python-ppmd (0.5.0-3) unstable; urgency=medium
* Team upload.
* Team upload.
...
...
This diff is collapsed.
Click to expand it.
debian/patches/fix-64bit-platform-detection.patch
+
56
−
17
View file @
3f18f3e3
From:
Zixing Liu <liushuyu011@gmail.com
>
From:
Colin Watson <cjwatson@debian.org
>
Date:
Mon
, 2
4
Mar 2025
12:36
:0
6
+0000
Date:
Tue
, 2
5
Mar 2025
09:57
:0
1
+0000
Subject: Fix 64-bit platform detection
Subject: Fix 64-bit platform detection
MIPS and PowerPC 64-bit platform detection is not adequate.
The typedefs in `src/ffi_build.py` need to be in sync with whether
`PPMD_32BIT` is defined, so it's simpler to just control both using the
same condition.
Forwarded: not-needed
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-ppmd/+bug/2100831
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-ppmd/+bug/2100831
Last-Update: 2025-03-2
4
Last-Update: 2025-03-2
5
---
---
src/ext/PpmdArch.h | 5 ++---
src/ext/PpmdArch.h | 18 ------------------
1 file changed, 2 insertions(+), 3 deletions(-)
src/ffi_build.py | 6 +++++-
2 files changed, 5 insertions(+), 19 deletions(-)
diff --git a/src/ext/PpmdArch.h b/src/ext/PpmdArch.h
diff --git a/src/ext/PpmdArch.h b/src/ext/PpmdArch.h
index 678fc68..
ae79c39
100644
index 678fc68..
8e991ec
100644
--- a/src/ext/PpmdArch.h
--- a/src/ext/PpmdArch.h
+++ b/src/ext/PpmdArch.h
+++ b/src/ext/PpmdArch.h
@@ -83,9 +83,8 @@
struct ISzAlloc
@@ -72,24 +72,6 @@
struct ISzAlloc
|| defined(__ARMEB__) \
#define ISzAlloc_Alloc(p, size) (p)->Alloc(size)
|| defined(__THUMBEL__) \
#define ISzAlloc_Free(p, a) (p)->Free(a)
|| defined(__THUMBEB__) \
-#if defined(_M_IX86) \
- || defined(__i386__) \
- || defined(_M_ARM) \
- || defined(_M_ARM_NT) \
- || defined(_M_ARMT) \
- || defined(__arm__) \
- || defined(__thumb__) \
- || defined(__ARMEL__) \
- || defined(__ARMEB__) \
- || defined(__THUMBEL__) \
- || defined(__THUMBEB__) \
- || defined(__mips__) \
- || defined(__mips__) \
- || defined(__ppc__) \
- || defined(__ppc__) \
- || defined(__powerpc__) \
- || defined(__powerpc__) \
+ || (defined(__mips__) && !defined(__mips64__)) \
- || defined(__sparc__)
+ || ((defined(__ppc__) || defined(__powerpc__)) && !defined(__powerpc64__)) \
- #define PPMD_32BIT
|| defined(__sparc__)
-#endif
#define PPMD_32BIT
-
#endif
EXTERN_C_END
#endif //PPMD_CFFI_PPMDARCH_H
diff --git a/src/ffi_build.py b/src/ffi_build.py
index 35cd198..ad5fd48 100644
--- a/src/ffi_build.py
+++ b/src/ffi_build.py
@@ -221,6 +221,10 @@
int Ppmd8_DecodeSymbol(CPpmd8 *p);
''')
# ---------------------------------------------------------------------------
+define_macros = []
+if not is_64bit():
+ define_macros.append(('PPMD_32BIT', None))
+
ffibuilder.set_source('_ppmd', r'''
#include "PpmdPy.h"
@@ -315,7 +319,7 @@
int ppmd_decompress(CPpmd7 *p, CPpmd7z_RangeDec *rc, char *buf, int size) {
}
return size;
}
-''', sources=sources, include_dirs=[src_root])
+''', sources=sources, include_dirs=[src_root], define_macros=define_macros)
if __name__ == "__main__": # not when running with setuptools
ffibuilder.compile(verbose=True)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment