From 28bc58df4826e3e13ee4e8ffdd960b6f4ceedce4 Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 18 Oct 2005 18:47:10 +0000 Subject: [PATCH] move sincos definition to arith.h --- lib/common/arith.h | 12 +++++++++++- lib/common/render.h | 1 - lib/common/shapes.c | 9 --------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/common/arith.h b/lib/common/arith.h index 727da454f..96feb577a 100644 --- a/lib/common/arith.h +++ b/lib/common/arith.h @@ -20,12 +20,16 @@ #ifndef GV_ARITH_H #define GV_ARITH_H +/* for sincos */ +#define _GNU_SOURCE 1 +#include + #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 diff --git a/lib/common/render.h b/lib/common/render.h index a2a3af302..c075bdfcd 100644 --- a/lib/common/render.h +++ b/lib/common/render.h @@ -35,7 +35,6 @@ extern "C" { #include #include -#include #include #ifdef HAVE_SYS_TYPES_H #include diff --git a/lib/common/shapes.c b/lib/common/shapes.c index 21eb51de6..e58f9da57 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -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')) -- 2.50.1