[libEMF] Fixes for non-x86 64bit architectures

Stanislav Ochotnicky sochotni at fedoraproject.org
Mon Nov 5 13:28:27 UTC 2012


commit 46cf0711493b739cdf2c8b514b2372a07307aabe
Author: Stanislav Ochotnicky <sochotnicky at redhat.com>
Date:   Mon Nov 5 14:27:08 2012 +0100

    Fixes for non-x86 64bit architectures

 libEMF-lp64.patch |  269 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 libEMF.spec       |    7 +-
 2 files changed, 275 insertions(+), 1 deletions(-)
---
diff --git a/libEMF-lp64.patch b/libEMF-lp64.patch
new file mode 100644
index 0000000..922a2d7
--- /dev/null
+++ b/libEMF-lp64.patch
@@ -0,0 +1,269 @@
+diff --git a/include/libEMF/wine/winnt.h b/include/libEMF/wine/winnt.h
+index 83109cb..f76c08a 100644
+--- a/include/libEMF/wine/winnt.h
++++ b/include/libEMF/wine/winnt.h
+@@ -250,7 +250,7 @@ typedef unsigned short  WORD,       *PWORD,    *LPWORD;
+ typedef int             INT,        *PINT,     *LPINT;
+ typedef unsigned int    UINT,       *PUINT,    *LPUINT;
+ /* Not sure this is correct. Probably should depend on the compiler, too. */
+-#if defined( __x86_64__) || defined(__alpha__)
++#if defined( __LP64__) || defined(__alpha__)
+ typedef unsigned int   DWORD,      *PDWORD,   *LPDWORD;
+ typedef unsigned int   ULONG,      *PULONG,   *LPULONG;
+ #else
+@@ -296,7 +296,7 @@ typedef VOID           *PVOID,      *LPVOID;
+ typedef BYTE            BOOLEAN,    *PBOOLEAN;
+ typedef char            CHAR,       *PCHAR;
+ typedef short           SHORT,      *PSHORT;
+-#if defined(__x86_64__) || defined(__alpha__)
++#if defined(__LP64__) || defined(__alpha__)
+ typedef int             LONG,       *PLONG,    *LPLONG;
+ #else
+ typedef long            LONG,       *PLONG,    *LPLONG;
+diff --git a/libemf/libemf.h b/libemf/libemf.h
+index a376150..9497b6d 100644
+--- a/libemf/libemf.h
++++ b/libemf/libemf.h
+@@ -340,7 +340,7 @@ namespace EMF {
+ 	fread( &dword, sizeof(DWORD), 1, fp_ );
+       return *this;
+     }
+-#if !defined( __x86_64__ )
++#if !defined( __LP64__ )
+     /*!
+      * Output a long int to the stream (swabbed).
+      * \param long long int to output.
+@@ -410,7 +410,7 @@ namespace EMF {
+ 	fread( &int_, sizeof(INT), 1, fp_ );
+       return *this;
+     }
+-#if !defined(__x86_64__)
++#if !defined(__LP64__)
+     /*!
+      * Output a (long) unsigned int to the stream (swabbed).
+      * \param uint (long) unsigned int to output.
+@@ -985,7 +985,7 @@ namespace EMF {
+   /* Miscellaneous editing routines */
+   inline void edit_rectl ( const char* tag, const RECTL& rectl )
+   {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT = "\t%s\t: (%d, %d) - (%d, %d)\n";
+ #else
+     const char* FMT = "\t%s\t: (%ld, %ld) - (%ld, %ld)\n";
+@@ -1005,7 +1005,7 @@ namespace EMF {
+ 
+   inline void edit_color ( const char* tag, const COLORREF& color )
+   {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT = "\t%s\t: R(0x%02x) G(0x%02x) B(0x%02x)\n";
+ #else
+     const char* FMT = "\t%s\t: R(0x%02lx) G(0x%02lx) B(0x%02lx)\n";
+@@ -1016,7 +1016,7 @@ namespace EMF {
+ 
+   inline void edit_sizel ( const char* tag, const SIZEL& size )
+   {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT = "\t%s\t: (%d, %d)\n";
+ #else
+     const char* FMT = "\t%s\t: (%ld, %ld)\n";
+@@ -1026,7 +1026,7 @@ namespace EMF {
+ 
+   inline void edit_pointl ( const char* tag, const POINTL& point )
+   {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT = "\t%s\t: (%d, %d)\n";
+ #else
+     const char* FMT = "\t%s\t: (%ld, %ld)\n";
+@@ -1037,7 +1037,7 @@ namespace EMF {
+   inline void edit_pointlarray ( const char* tag, const DWORD cptl,
+ 				  const POINTL* points )
+   {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT0 = "\tcptl%s\t: %d\n";
+     const char* FMT1 = "%d, %d\n";
+     const char* FMT2 = "\t\t%s  %d, %d\n";
+@@ -1102,7 +1102,7 @@ namespace EMF {
+ 
+   inline void edit_brush_style ( const char* tag, DWORD style )
+   {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT = "unknown(%d)";
+ #else
+     const char* FMT = "unknown(%ld)";
+@@ -1126,7 +1126,7 @@ namespace EMF {
+ 
+   inline void edit_brush_hatch ( const char* tag, DWORD hatch )
+   {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT = "unknown(%d)";
+ #else
+     const char* FMT = "unknown(%ld)";
+@@ -1473,7 +1473,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT0 = "\tiType\t\t\t: %d\n";
+       const char* FMT1 = "\tnSize\t\t\t: %d\n";
+       const char* FMT2 = "\tnBytes\t\t\t: %d\n";
+@@ -1855,7 +1855,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT0 = "\txNum\t: %d\n";
+       const char* FMT1 = "\txDenom\t: %d\n";
+       const char* FMT2 = "\tyNum\t: %d\n";
+@@ -1993,7 +1993,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT0 = "\txNum\t: %d\n";
+       const char* FMT1 = "\txDenom\t: %d\n";
+       const char* FMT2 = "\tyNum\t: %d\n";
+@@ -2069,7 +2069,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT = "unknown(%d)\n";
+ #else
+     const char* FMT = "unknown(%ld)\n";
+@@ -2196,7 +2196,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT = "| unknown bits(0x%x)";
+ #else
+     const char* FMT = "| unknown bits(0x%lx)";
+@@ -2394,7 +2394,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT = "unknown(%d)\n";
+ #else
+     const char* FMT = "unknown(%ld)\n";
+@@ -2460,7 +2460,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT = "unknown(%d)\n";
+ #else
+     const char* FMT = "unknown(%ld)\n";
+@@ -2527,7 +2527,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT = "unknown(%d)\n";
+ #else
+     const char* FMT = "unknown(%ld)\n";
+@@ -2596,7 +2596,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT = "\tihObject\t: 0x%x\n";
+ #else
+       const char* FMT = "\tihObject\t: 0x%lx\n";
+@@ -2654,7 +2654,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT = "\tihObject\t: 0x%x\n";
+ #else
+       const char* FMT = "\tihObject\t: 0x%lx\n";
+@@ -3580,7 +3580,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT0 = "\tnPolys\t\t: %d\n";
+       const char* FMT1 = "\tcptl\t\t: %d\n";
+       const char* FMT2 = "%d\n";
+@@ -3770,7 +3770,7 @@ namespace EMF {
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT0 = "\tnPolys\t\t: %d\n";
+       const char* FMT1 = "\tcptl\t\t: %d\n";
+       const char* FMT2 = "%d\n";
+@@ -4575,7 +4575,7 @@ For pstoedit - this is "fixed" now by estimating dx in pstoedit
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+     const char* FMT0 = "unknown(%d)\n";
+     const char* FMT1 = "\tptlReference\t: (%d,%d)\n";
+     const char* FMT2 = "\tnChars\t\t: %d\n";
+@@ -4759,7 +4759,7 @@ For pstoedit - this is "fixed" now by estimating dx in pstoedit
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT0 = "\tihPen\t\t: 0x%x\n";
+       const char* FMT1 = "\tlopn.lopnWidth\t: %d, %d\n";
+ #else
+@@ -4817,7 +4817,7 @@ For pstoedit - this is "fixed" now by estimating dx in pstoedit
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT0 = "\tihPen\t\t\t: 0x%x\n";
+       const char* FMT1 = "\toffBmi\t\t\t: %d\n";
+       const char* FMT2 = "\tcbBmi\t\t\t: %d\n";
+@@ -4891,7 +4891,7 @@ For pstoedit - this is "fixed" now by estimating dx in pstoedit
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT = "\tihBrush\t\t: 0x%x\n";
+ #else
+       const char* FMT = "\tihBrush\t\t: 0x%lx\n";
+@@ -4951,7 +4951,7 @@ For pstoedit - this is "fixed" now by estimating dx in pstoedit
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT0 = "\tihFont\t\t\t: %d\n";
+       const char* FMT1 = "\tlfHeight\t\t: %d\n";
+       const char* FMT2 = "\tlfWidth\t\t\t: %d\n";
+@@ -5520,7 +5520,7 @@ For pstoedit - this is "fixed" now by estimating dx in pstoedit
+      */
+     void edit ( void ) const
+     {
+-#if defined(__x86_64__)
++#if defined(__LP64__)
+       const char* FMT = "\tiRelative: %d\n";
+ #else
+       const char* FMT = "\tiRelative: %ld\n";
diff --git a/libEMF.spec b/libEMF.spec
index 82be3c8..7ac2d1d 100644
--- a/libEMF.spec
+++ b/libEMF.spec
@@ -2,7 +2,7 @@ Summary:	A library for generating Enhanced Metafiles
 Summary(pl):	Biblioteka do generowania plików w formacie Enhanced Metafile
 Name:		libEMF
 Version:	1.0.6
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	LGPLv2+ and GPLv2+
 Group:		System Environment/Libraries
 URL:		http://libemf.sourceforge.net/
@@ -13,6 +13,7 @@ Patch0:		%{name}-amd64.patch
 Patch1:		%{name}-axp.patch
 Patch2:		%{name}-s390.patch
 Patch3:		%{name}-arm.patch
+Patch4:         %{name}-lp64.patch
 BuildRequires:	libstdc++-devel
 BuildRequires:	libtool
 
@@ -49,6 +50,7 @@ Pliki nagłówkowe libEMF.
 %patch1 -p1 -b .axp
 %patch2 -p1 -b .s390
 %patch3 -p1 -b .arm
+%patch4 -p1 -b .lp64
 
 chmod 0644 libemf/libemf.h
 
@@ -90,6 +92,9 @@ make check
 %{_includedir}/libEMF
 
 %changelog
+* Mon Nov  5 2012 Stanislav Ochotnicky <sochotnicky at redhat.com> - 1.0.6-2
+- Fixes for non-x86 64bit architectures
+
 * Mon Sep 03 2012 Dominik 'Rathann' Mierzejewski <rpm at greysector.net> 1.0.6-1
 - updated to 1.0.6
 - updated source URL


More information about the scm-commits mailing list