move sincos definition to arith.h
authorellson <devnull@localhost>
Tue, 18 Oct 2005 18:47:10 +0000 (18:47 +0000)
committerellson <devnull@localhost>
Tue, 18 Oct 2005 18:47:10 +0000 (18:47 +0000)
lib/common/arith.h
lib/common/render.h
lib/common/shapes.c

index 727da454f3538bd84a11f0820c2b937189444829..96feb577a954662bf14bdd5d634db45b6909576e 100644 (file)
 #ifndef GV_ARITH_H
 #define GV_ARITH_H
 
+/* for sincos */
+#define _GNU_SOURCE 1
+#include <math.h>
+
 #include "logic.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
-    
+
 #ifdef MIN
 #undef MIN
 #endif
@@ -72,6 +76,12 @@ extern "C" {
 
 #define SQR(a) ((a) * (a))
 
+#ifdef HAVE_SINCOS
+    extern void sincos(double x, double *s, double *c);
+#else
+# define sincos(x,s,c) *s = sin(x); *c = cos(x)
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index a2a3af3026a513e157c70fe0827b5118989806e2..c075bdfcd40ddc799172c9b53ce686c49e73b3b8 100644 (file)
@@ -35,7 +35,6 @@ extern "C" {
 
 #include <signal.h>
 #include <assert.h>
-#include <math.h>
 #include <stdio.h>
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
index 21eb51de6a68a80462d63cfe86c13bbf27fe3cd2..e58f9da57677309187533ca78f837b308912cab6 100644 (file)
@@ -14,9 +14,6 @@
 *              AT&T Research, Florham Park NJ             *
 **********************************************************/
 
-/* for sincos */
-#define _GNU_SOURCE 1
-
 #include "render.h"
 #include "gvplugin.h"
 #include "gvcint.h"
@@ -36,12 +33,6 @@ extern codegen_t VRML_CodeGen;
 #define RBCONST 12
 #define RBCURVE .5
 
-#ifdef HAVE_SINCOS
-extern void sincos(double x, double *s, double *c);
-#else
-# define sincos(x,s,c) *s = sin(x); *c = cos(x)
-#endif
-
 static port Center = { {0, 0}, -1, 0, 0, 0, 1, 0, 0 };
 
 #define ATTR_SET(a,n) ((a) && (*(agxget(n,a->index)) != '\0'))