Re: [AD] AL_RAND(), final round

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Actually it is a simple shift... Since we're going for a platform specific
> version of the AL_RAND() macro, the simplest solution that gives good
> result under OSX is ((rand() >> 16) & 0x7fff).

Ok.

> Here it is.

Index: include/allegro/internal/alconfig.h
===================================================================
RCS file: /cvsroot/alleg/allegro/include/allegro/internal/alconfig.h,v
retrieving revision 1.13
diff -u -r1.13 alconfig.h
--- include/allegro/internal/alconfig.h	27 May 2003 13:29:47 -0000	1.13
+++ include/allegro/internal/alconfig.h	12 Jun 2003 19:28:20 -0000
@@ -334,6 +334,12 @@
 
 #endif
 
+
+/* default random function definition */
+#ifndef AL_RAND
+   #define AL_RAND()       (rand())
+#endif
+
 #ifdef __cplusplus
    }
 #endif


Writing

	#define AL_RAND    rand

is better, in case someone wants to take the address of AL_RAND :-)

Ok with this change.

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/