Skip to content

Commit b929926

Browse files
rddunlapRich Felker
authored andcommitted
sh: define __BIG_ENDIAN for math-emu
Fix this by defining both ENDIAN macros in <asm/sfp-machine.h> so that they can be utilized in <math-emu/soft-fp.h> according to the latter's comment: /* Allow sfp-machine to have its own byte order definitions. */ (This is what is done in arch/nds32/include/asm/sfp-machine.h.) This placates these build warnings: In file included from ../arch/sh/math-emu/math.c:23: .../include/math-emu/single.h:50:21: warning: "__BIG_ENDIAN" is not defined, evaluates to 0 [-Wundef] 50 | #if __BYTE_ORDER == __BIG_ENDIAN In file included from ../arch/sh/math-emu/math.c:24: .../include/math-emu/double.h:59:21: warning: "__BIG_ENDIAN" is not defined, evaluates to 0 [-Wundef] 59 | #if __BYTE_ORDER == __BIG_ENDIAN Fixes: 4b56568 ("sh: math-emu support") Signed-off-by: Randy Dunlap <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: John Paul Adrian Glaubitz <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Tested-by: John Paul Adrian Glaubitz <[email protected]> Signed-off-by: Rich Felker <[email protected]>
1 parent e25c252 commit b929926

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/sh/include/asm/sfp-machine.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
#ifndef _SFP_MACHINE_H
1414
#define _SFP_MACHINE_H
1515

16+
#ifdef __BIG_ENDIAN__
17+
#define __BYTE_ORDER __BIG_ENDIAN
18+
#define __LITTLE_ENDIAN 0
19+
#else
20+
#define __BYTE_ORDER __LITTLE_ENDIAN
21+
#define __BIG_ENDIAN 0
22+
#endif
23+
1624
#define _FP_W_TYPE_SIZE 32
1725
#define _FP_W_TYPE unsigned long
1826
#define _FP_WS_TYPE signed long

0 commit comments

Comments
 (0)