[quake3-bugzilla] [Bug 5155] New: [patch] doesn't build on non-x86 platforms

bugzilla-daemon at icculus.org bugzilla-daemon at icculus.org
Fri Aug 5 07:19:11 EDT 2011


https://bugzilla.icculus.org/show_bug.cgi?id=5155

           Summary: [patch] doesn't build on non-x86 platforms
           Product: ioquake3
           Version: SVN HEAD
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Platform
        AssignedTo: zakk at icculus.org
        ReportedBy: smcv-ioquake3 at pseudorandom.co.uk
         QAContact: quake3-bugzilla at icculus.org


Two portability bugs in recent svn, caught by Debian experimental's buildbots:

1. The pluggable renderer takes the address of Q_ftol as a function pointer.
This is OK on x86-64, where Q_ftol is an object-like macro (qftolsse), and on
i386, where Q_ftol is itself a function pointer, pointing to either qftolx87 or
qftolsse. However, it's not OK on non-x86 platforms, where Q_ftol(f) is
currently a function-like macro expanding to lrintf(f). The easy fix is to
change the definition of Q_ftol so it expands to lrintf as an object-like
macro.

(It occurs to me that the CPU cost of performing a call through a function
pointer could easily outweigh the performance benefit of using the optimal
opcode for ftol - has anyone benchmarked this? Perhaps the pluggable renderer
should just use lrintf, link to libm and trust that it's sufficiently
well-implemented?)

2. q_platform.h doesn't declare CopyShortSwap or CopyLongSwap, breaking the
build on platforms where CopyLittleShort and CopyLittleLong expand to those
(i.e. anything big-endian).

With these patches, ioquake3 compiles on a powerpc (which is big-endian, so
it'd suffer from both bugs). I haven't tried the resulting binaries yet.

-- 
Configure bugmail: https://bugzilla.icculus.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the quake3-bugzilla mailing list