pkgsrc/emulators/gcube/patches/patch-ad
rillig 8221d32214 Added four patches that replace reserved identifiers with allowed ones.
Fixes the build on NetBSD, which also defines the same identifiers, but
is allowed to.
2006-06-26 10:56:57 +00:00

102 lines
3.1 KiB
Text

$NetBSD: patch-ad,v 1.1 2006/06/26 10:56:57 rillig Exp $
Thou shalt not use reserved identifiers.
--- cpu.h.orig 2005-01-12 01:19:11.000000000 +0100
+++ cpu.h 2006-06-26 12:51:48.000000000 +0200
@@ -284,8 +284,8 @@ extern __u64 ps1[32];
#define SET_FIELD(X,n,Y)\
({\
- __u32 _n = (n);\
- (X = (X &~ (0x0f << ((7-(_n)) << 2))) | ((Y) << ((7-(_n)) << 2)));\
+ __u32 m_n = (n);\
+ (X = (X &~ (0x0f << ((7-(m_n)) << 2))) | ((Y) << ((7-(m_n)) << 2)));\
})
#define CLEAR_FIELD(X,n) (X = (X &~ (0x0f << ((7-(n)) << 2))))
#define GET_FIELD(X,n) ((X >> (32 - (((n) + 1) << 2))) & 0x0f)
@@ -293,16 +293,16 @@ extern __u64 ps1[32];
// signed
#define CALC_CR(n,X,Y)\
({\
- __s32 _X = (X);\
- __s32 _Y = (Y);\
- SET_FIELD (CR, n, ((IS_XER_SO) ? CR_SO : 0) | ((_X < _Y) ? CR_LT : 0) | ((_X > _Y) ? CR_GT : 0) | ((_X == _Y) ? CR_EQ : 0));\
+ __s32 m_X = (X);\
+ __s32 m_Y = (Y);\
+ SET_FIELD (CR, n, ((IS_XER_SO) ? CR_SO : 0) | ((m_X < m_Y) ? CR_LT : 0) | ((m_X > m_Y) ? CR_GT : 0) | ((m_X == m_Y) ? CR_EQ : 0));\
})
// unsigned
#define CALC_CRL(n,X,Y)\
({\
- __u32 _X = (X);\
- __u32 _Y = (Y);\
- SET_FIELD (CR, n, ((IS_XER_SO) ? CR_SO : 0) | ((_X < _Y) ? CR_LT : 0) | ((_X > _Y) ? CR_GT : 0) | ((_X == _Y) ? CR_EQ : 0));\
+ __u32 m_X = (X);\
+ __u32 m_Y = (Y);\
+ SET_FIELD (CR, n, ((IS_XER_SO) ? CR_SO : 0) | ((m_X < m_Y) ? CR_LT : 0) | ((m_X > m_Y) ? CR_GT : 0) | ((m_X == m_Y) ? CR_EQ : 0));\
})
// rewrite in asm
@@ -315,14 +315,14 @@ extern __u64 ps1[32];
#define IS_SNAN(X) ((((X) & 0x000fffffffffffffULL) != 0) && (((X) & 0x7ff8000000000000ULL) == 0x7ff0000000000000ULL))
#define CALC_CRF(n,X,Y)\
({\
- double _X = (X);\
- double _Y = (Y);\
- if (_X < _Y)\
+ double m_X = (X);\
+ double m_Y = (Y);\
+ if (m_X < m_Y)\
{\
SET_FIELD (CR, n, 8);\
FPSCR |= 8 << FPSCR_FPCC;\
}\
- else if (_X > _Y)\
+ else if (m_X > m_Y)\
{\
SET_FIELD (CR, n, 4);\
FPSCR |= 4 << FPSCR_FPCC;\
@@ -337,8 +337,8 @@ extern __u64 ps1[32];
#define IS_NANS IS_NAN
#define CALC_CRFS(n,Xf,Xb,Yf,Yb)\
({\
- double _X = (Xf);\
- double _Y = (Yf);\
+ double m_X = (Xf);\
+ double m_Y = (Yf);\
FPSCR &= ~(0x1f << FPSCR_FPCC);\
if (IS_NAN (Xb) || IS_NAN (Yb))\
{\
@@ -346,12 +346,12 @@ extern __u64 ps1[32];
FPSCR |= 1 << FPSCR_FPCC;\
FPSCR |= FPSCR_VXSNAN;\
}\
- else if (_X < _Y)\
+ else if (m_X < m_Y)\
{\
SET_FIELD (CR, n, 8);\
FPSCR |= 8 << FPSCR_FPCC;\
}\
- else if (_X > _Y)\
+ else if (m_X > m_Y)\
{\
SET_FIELD (CR, n, 4);\
FPSCR |= 4 << FPSCR_FPCC;\
@@ -406,11 +406,11 @@ extern __u64 ps1[32];
#define GENMASK(X,Y)\
({\
- __u32 _X = (X);\
- __u32 _Y = (Y);\
- ((_X <= _Y) ? \
- ((0xffffffff >> (_X)) ^ (((_Y) < 31)? (0xffffffff >> ((_Y) + 1)) : 0)) :\
- (~((0xffffffff >> (_X)) ^ (((_Y) < 31)? (0xffffffff >> ((_Y) + 1)) : 0)))) ;\
+ __u32 m_X = (X);\
+ __u32 m_Y = (Y);\
+ ((m_X <= m_Y) ? \
+ ((0xffffffff >> (m_X)) ^ (((m_Y) < 31)? (0xffffffff >> ((m_Y) + 1)) : 0)) :\
+ (~((0xffffffff >> (m_X)) ^ (((m_Y) < 31)? (0xffffffff >> ((m_Y) + 1)) : 0)))) ;\
})
#define MASK(X,Y) (mask[X][Y])