File: fix-922619.patch

package info (click to toggle)
mame 0.282%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 916,020 kB
  • sloc: cpp: 5,308,593; xml: 2,233,738; ansic: 752,116; sh: 34,431; lisp: 19,643; python: 16,330; makefile: 13,256; java: 8,492; yacc: 8,152; javascript: 7,147; cs: 6,013; asm: 4,786; ada: 1,681; pascal: 1,191; lex: 1,174; perl: 585; ruby: 373
file content (26 lines) | stat: -rw-r--r-- 1,518 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Fix FTBFS on power "not a constant expression"
There are some explanation upstream :
https://github.com/mamedev/mame/issues/3157
and this probably due to the fact that IBM 128bit long double format
is not constant folded.
I slighlty rewrote ""_kHz_XTAL(long double clock) and ""_MHz_XTAL(long double clock)
the way ""_kHz_XTAL(unsigned long long clock) and ""_MHz_XTAL(unsigned long long clock)
which makes the compiler happy.
Also including an upstream change about rounding to get same results as on x86
: https://github.com/mamedev/mame/pull/5164
Author: Frédéric Bonnard <frediz@debian.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/emu/xtal.h
+++ b/src/emu/xtal.h
@@ -81,8 +81,8 @@
 constexpr XTAL operator *(double       mult, const XTAL &xtal) { return XTAL(xtal.base(), mult * xtal.dvalue()); }
 
 constexpr XTAL operator ""_Hz_XTAL(long double clock) { return XTAL(double(clock)); }
-constexpr XTAL operator ""_kHz_XTAL(long double clock) { return XTAL(double(clock * 1e3)); }
-constexpr XTAL operator ""_MHz_XTAL(long double clock) { return XTAL(double(clock * 1e6)); }
+constexpr XTAL operator ""_kHz_XTAL(long double clock) { return XTAL(double(clock) * 1e3); }
+constexpr XTAL operator ""_MHz_XTAL(long double clock) { return XTAL(double(clock) * 1e6); }
 
 constexpr XTAL operator ""_Hz_XTAL(unsigned long long clock) { return XTAL(double(clock)); }
 constexpr XTAL operator ""_kHz_XTAL(unsigned long long clock) { return XTAL(double(clock) * 1e3); }