Steward
分享是一種喜悅、更是一種幸福
手機 - Zinwa Q25 - Debian - 解決classpath #error Endianess not declared問題
問題如下:
In file included from fdlibm.h:36,
from e_atan2.c:42:
ieeefp.h:164:2: error: #error Endianess not declared!!
164 | #error Endianess not declared!!
| ^~~~~
In file included from fdlibm.h:40:
mprec.h:78:1: error: unknown type name 'Exactly'
78 | Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
| ^~~~~~~
mprec.h:78:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'of'
78 | Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
| ^~
mprec.h:78:13: error: unknown type name 'of'
In file included from mprec.h:34,
from dtoa.c:31:
ieeefp.h:164:2: error: #error Endianess not declared!!
164 | #error Endianess not declared!!
| ^~~~~
fdlibm.h:283:2: error: #error Must define endianness
283 | #error Must define endianness
| ^~~~~
mprec.h:78:1: error: unknown type name 'Exactly'
78 | Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
| ^~~~~~~
mprec.h:78:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'of'
78 | Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
| ^~
mprec.h:78:13: error: unknown type name 'of'
e_atan2.c: In function 'ClasspathMath___ieee754_atan2':
fdlibm.h:322:5: error: unknown type name 'ieee_double_shape_type'; did you mean 'ieee_float_shape_type'?
322 | ieee_double_shape_type ew_u; \
| ^~~~~~~~~~~~~~~~~~~~~~
e_atan2.c:69:9: note: in expansion of macro 'EXTRACT_WORDS'
69 | EXTRACT_WORDS(hx,lx,x);
| ^~~~~~~~~~~~~
fdlibm.h:323:9: error: request for member 'value' in something not a structure or union
323 | ew_u.value = (d); \
| ^
e_atan2.c:69:9: note: in expansion of macro 'EXTRACT_WORDS'
69 | EXTRACT_WORDS(hx,lx,x);
| ^~~~~~~~~~~~~
fdlibm.h:324:17: error: request for member 'parts' in something not a structure or union
324 | (ix0) = ew_u.parts.msw; \
| ^
e_atan2.c:69:9: note: in expansion of macro 'EXTRACT_WORDS'
69 | EXTRACT_WORDS(hx,lx,x);
| ^~~~~~~~~~~~~
fdlibm.h:325:17: error: request for member 'parts' in something not a structure or union
325 | (ix1) = ew_u.parts.lsw; \
| ^
e_atan2.c:69:9: note: in expansion of macro 'EXTRACT_WORDS'
69 | EXTRACT_WORDS(hx,lx,x);
| ^~~~~~~~~~~~~
dtoa.c: In function '_Jv_dtoa_r':
fdlibm.h:322:5: error: unknown type name 'ieee_double_shape_type'; did you mean 'ieee_float_shape_type'?
322 | ieee_double_shape_type ew_u; \
| ^~~~~~~~~~~~~~~~~~~~~~
e_atan2.c:71:9: note: in expansion of macro 'EXTRACT_WORDS'
71 | EXTRACT_WORDS(hy,ly,y);
| ^~~~~~~~~~~~~
dtoa.c:252:22: error: storage size of 'd' isn't known
252 | union double_union d, d2, eps;
| ^
fdlibm.h:323:9: error: request for member 'value' in something not a structure or union
323 | ew_u.value = (d); \
| ^
解法如下:
$ vim native/fdlibm/ieeefp.h +11
#if defined(__arm__) || defined(__aarch64__) || defined(__thumb__)