shithub: qk1

ref: 3ed81805500b6497537fcab2dffe2b92e52cbed7
dir: /plan9/platform.h/

View raw version
#include <u.h>
#include <libc.h>
#include <stdio.h>
#include <ctype.h>

#define RAND_MAX ((2<<15)-1)

#define acosf acos
#define asinf asin
#define atan2f atan2
#define atanf atan
#define ceilf ceil
#define cosf cos
#define floorf floor
#define sinf sin
#define sqrtf sqrt
#define tanf tan

#define __inline__ inline

#ifdef __mips__
#define QUAKE_BIG_ENDIAN
#else
# ifdef __power__
# define QUAKE_BIG_ENDIAN
# else
#  ifdef __power64__
#  define QUAKE_BIG_ENDIAN
#  else
#   ifdef __sparc__
#   define QUAKE_BIG_ENDIAN
#   else
#    ifdef __sparc64__
#    else
#    define QUAKE_LITTLE_ENDIAN
#    endif
#   endif
#  endif
# endif
#endif

typedef enum {false, true} bool;

static double ln2c;
#define exp2f(x) (exp((x) * (ln2c ? ln2c : (ln2c = log(2.0)))))

#define sys_dup(d) dup((d), -1)

int qctz(unsigned);

float DotProduct(const float v1[3], const float v2[3]);