]> git.mxchange.org Git - simgear.git/blobdiff - Math/MAT3mat.c
Added point3d.hxx to replace cheezy fgPoint3d struct.
[simgear.git] / Math / MAT3mat.c
index 42ba9814cfbf244d31da8e6db873f79ba667e953..6eb74cb1cab30d81348406a912378643f5f482d5 100644 (file)
@@ -5,13 +5,20 @@
  * This file contains routines that operate solely on matrices.
  * -------------------------------------------------------------------------*/
 
-#include <string.h>
-#include <Math/mat3defs.h>
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
 
 #ifdef WIN32
-#include <memory.h>      /* required for memset() and memcpy() */
+#  include <memory.h>      /* required for memset() and memcpy() */
 #endif
 
+#include <string.h>
+#include <Math/mat3defs.h>
+
+#define USE_MEM
+
 /* #include "macros.h" */
 
 /* --------------------------  Static Routines ---------------------------- */
@@ -21,6 +28,8 @@
 /* --------------------------  Public Routines ---------------------------- */
 
 
+#if !defined( USE_XTRA_MAT3_INLINES )
+
 /*
  * Sets a matrix to identity.
  */
@@ -30,8 +39,8 @@ MAT3identity (register MAT3mat mat)
 {
    register int i;
 
-#ifdef WIN32
-   memset(mat,0x00, sizeof(MAT3mat));
+#ifdef USE_MEM /* WIN32 */
+   memset(mat, 0x00, sizeof(MAT3mat));
 #else
    bzero (mat, sizeof(MAT3mat));
 #endif
@@ -47,7 +56,7 @@ MAT3identity (register MAT3mat mat)
 void
 MAT3zero (MAT3mat mat)
 {
-#ifdef WIN32
+#ifdef USE_MEM /* WIN32 */
    memset(mat,0x00, sizeof(MAT3mat));
 #else
    bzero (mat, sizeof(MAT3mat));
@@ -62,7 +71,7 @@ MAT3zero (MAT3mat mat)
 void
 MAT3copy(MAT3mat to, MAT3mat from)
 {
-#ifdef WIN32
+#ifdef USE_MEM /* WIN32 */
     memcpy(to, from, sizeof(MAT3mat));
 #else
     bcopy(from, to, sizeof(MAT3mat));
@@ -88,6 +97,7 @@ MAT3mult (double (*result_mat)[4], register double (*mat1)[4], register double (
                       mat1[i][3] * mat2[3][j]);
    MAT3copy (result_mat, tmp_mat);
 }
+#endif // !defined( USE_XTRA_MAT3_INLINES )
 
 /*
  * This returns the transpose of a matrix.  The result matrix may be