]> git.mxchange.org Git - simgear.git/blobdiff - Math/MAT3mat.c
Added point3d.hxx to replace cheezy fgPoint3d struct.
[simgear.git] / Math / MAT3mat.c
index f25310f0553708b1f3fc7b4127d7f0be3cf00ef8..6eb74cb1cab30d81348406a912378643f5f482d5 100644 (file)
@@ -5,15 +5,19 @@
  * 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() */
-#elif __MWERKS__
-#  include <string.h>      /* MetroWerks CodeWarrior: memset() & memcpy() */
 #endif
 
+#include <string.h>
+#include <Math/mat3defs.h>
+
+#define USE_MEM
 
 /* #include "macros.h" */
 
@@ -24,6 +28,8 @@
 /* --------------------------  Public Routines ---------------------------- */
 
 
+#if !defined( USE_XTRA_MAT3_INLINES )
+
 /*
  * Sets a matrix to identity.
  */
@@ -33,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
@@ -50,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));
@@ -65,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));
@@ -91,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