On Thu, 25 Dec 2003, Robert Alan Byer wrote:

> While trying to build XMAME v0.77.1 on Solaris with the MAME debugger I got
> the following error...
>
> ===========================================================================
>
> Undefined                       first referenced
>  symbol                             in file
> floorf                              xmamed.obj/midway.a(voodoo.o)
> ld: fatal: Symbol referencing errors. No output written to xmamed.x11
> collect2: ld returned 1 exit status
> make: *** [xmamed.x11] Error 1
> garrison%
>

I encountered the same problem and made a patch for it (which I submitted
to this list). Hopefully, it will be included in the next version of
xmame. Anyway, I'm including the patch for you. Please note that I have
not tested this extensively (xmame compiles and runs), but I see no reason
why this patch would not work.

The problem has to do with floorf (single precision version of floor) not
being included in the standard Solaris math lib, so I just changed all
occurences of it (and some other single precision math functions) to use
the double precision versions instead.

/ Anders

-- 
"Computers are useless. They can only give you answers"
- Pablo Picasso
--- ../voodoo.c Wed Nov 26 13:19:45 2003
+++ voodoo.c    Wed Nov 26 13:21:14 2003
@@ -16,7 +16,7 @@
 #ifndef _WIN32
 #define SETUP_FPU()
 #define RESTORE_FPU()
-#define TRUNC_TO_INT(f) (floorf(f))
+#define TRUNC_TO_INT(f) (float) (floor(f))
 #else
 #include <float.h>
 #define SETUP_FPU() { int oldfpu = _controlfp(_RC_CHOP/*_RC_DOWN*/ | _PC_24, _MCW_RC 
| _MCW_PC)
--- ../voodblit.c       Wed Nov 26 13:19:56 2003
+++ voodblit.c  Wed Nov 26 13:20:44 2003
@@ -28,14 +28,14 @@
 #if (PER_PIXEL_LOD)
        float sscale0 = (float)(trex_width[0] * trex_width[0]) * (1. / 65536.);
        float tscale0 = (float)(trex_height[0] * trex_height[0]) * (1. / 65536.);
-       float tex0x = sqrtf(tri_ds0dx * tri_ds0dx * sscale0 + tri_dt0dx * tri_dt0dx * 
tscale0);
-       float tex0y = sqrtf(tri_ds0dy * tri_ds0dy * sscale0 + tri_dt0dy * tri_dt0dy * 
tscale0);
+       float tex0x = (float) sqrt(tri_ds0dx * tri_ds0dx * sscale0 + tri_dt0dx * 
tri_dt0dx * tscale0);
+       float tex0y = (float) sqrt(tri_ds0dy * tri_ds0dy * sscale0 + tri_dt0dy * 
tri_dt0dy * tscale0);
        float lodbase0 = ((tex0x > tex0y) ? tex0x : tex0y) * 256.0f;
 #if (NUM_TMUS > 1)
        float sscale1 = (float)(trex_width[1] * trex_width[1]) * (1. / 65536.);
        float tscale1 = (float)(trex_height[1] * trex_height[1]) * (1. / 65536.);
-       float tex1x = sqrtf(tri_ds1dx * tri_ds1dx * sscale1 + tri_dt1dx * tri_dt1dx * 
tscale1);
-       float tex1y = sqrtf(tri_ds1dy * tri_ds1dy * sscale1 + tri_dt1dy * tri_dt1dy * 
tscale1);
+       float tex1x = (float) sqrt(tri_ds1dx * tri_ds1dx * sscale1 + tri_dt1dx * 
tri_dt1dx * tscale1);
+       float tex1y = (float) sqrt(tri_ds1dy * tri_ds1dy * sscale1 + tri_dt1dy * 
tri_dt1dy * tscale1);
        float lodbase1 = ((tex1x > tex1y) ? tex1x : tex1y) * 256.0f;
 #endif
 #endif

Reply via email to