math.h/PI integration

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2004-12-13 20:04:51 +00:00
parent 19edb09cd9
commit e0d3147139
10 changed files with 9 additions and 57 deletions

View File

@ -23,15 +23,6 @@
#include "wx/image.h"
#include "wx/numdlg.h"
/* GRG: This is not ANSI standard, define M_PI explicitly
#include <math.h> // M_PI
*/
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
#endif
class MyApp: public wxApp
{
public:

View File

@ -30,8 +30,6 @@
#include "wx/dc.h"
#include <math.h>
// bool wxDCBase::sm_cacheing = false;
// ============================================================================
@ -319,7 +317,7 @@ void wxDCBase::DoDrawSpline( wxList *points )
if (node == NULL)
// empty list
return;
p = (wxPoint *)node->GetData();
x1 = p->x;
@ -766,7 +764,7 @@ void wxDCBase::Rotate( wxList* points, double angle, wxPoint center )
{
if( angle != 0.0 )
{
double pi(3.1415926536);
double pi(M_PI);
double dSinA = -sin(angle*2.0*pi/360.0);
double dCosA = cos(angle*2.0*pi/360.0);
for ( wxNode* node = points->First(); node; node = node->Next() )
@ -794,7 +792,7 @@ void wxDCBase::CalculateEllipticPoints( wxList* points,
wxCoord w, wxCoord h,
double sa, double ea )
{
double pi = 3.1415926535;
double pi = M_PI;
double sar = 0;
double ear = 0;
int xsa = 0;

View File

@ -29,11 +29,6 @@
#include "wx/geometry.h"
#include "wx/datstrm.h"
// normally this is defined in <math.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
//
// wxPoint2D
//

View File

@ -25,12 +25,12 @@
#ifndef WX_PRECOMP
#include "wx/defs.h"
#include "wx/math.h"
#endif
#include "wx/matrix.h"
#include <math.h>
static const double pi = 3.1415926535;
static const double pi = M_PI;
wxTransformMatrix::wxTransformMatrix(void)
{

View File

@ -23,7 +23,6 @@
#include "wx/log.h"
#if __MSL__ >= 0x6000
#include "math.h"
namespace std {}
using namespace std ;
#endif
@ -47,11 +46,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
#define twips2mm 0.0176388888889
#define mm2pt 2.83464566929
#define pt2mm 0.352777777778
#if !defined( __DARWIN__ ) || defined(__MWERKS__)
#ifndef M_PI
const double M_PI = 3.14159265358979 ;
#endif
#endif
const double RAD2DEG = 180.0 / M_PI;
const short kEmulatedMode = -1 ;
const short kUnsupportedMode = -2 ;

View File

@ -23,7 +23,7 @@
#include "wx/log.h"
#if __MSL__ >= 0x6000
#include "math.h"
namespace std {}
using namespace std ;
#endif
@ -46,11 +46,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
#define twips2mm 0.0176388888889
#define mm2pt 2.83464566929
#define pt2mm 0.352777777778
#if !defined( __DARWIN__ ) || defined(__MWERKS__)
#ifndef M_PI
const double M_PI = 3.14159265358979 ;
#endif
#endif
const double RAD2DEG = 180.0 / M_PI;
const short kEmulatedMode = -1 ;
const short kUnsupportedMode = -2 ;

View File

@ -39,7 +39,6 @@
#include "wx/log.h"
#include <string.h>
#include <math.h>
#include <mgraph.hpp>
@ -48,10 +47,6 @@
// constants
//-----------------------------------------------------------------------------
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
const double mm2inches = 0.0393700787402;
const double inches2mm = 25.4;
const double mm2twips = 56.6929133859;

View File

@ -54,7 +54,6 @@
#endif
#include <string.h>
#include <math.h>
#if wxUSE_COMMON_DIALOGS && !defined(__WXMICROWIN__)
#include <commdlg.h>
@ -94,11 +93,6 @@ static const int VIEWPORT_EXTENT = 1000;
static const int MM_POINTS = 9;
static const int MM_METRIC = 10;
// usually this is defined in math.h
#ifndef M_PI
static const double M_PI = 3.14159265358979323846;
#endif // M_PI
// ROPs which don't have standard names (see "Ternary Raster Operations" in the
// MSDN docs for how this and other numbers in wxDC::Blit() are obtained)
#define DSTCOPY 0x00AA0029 // a.k.a. NOP operation

View File

@ -32,7 +32,6 @@
#include "wx/dcprint.h"
#include <string.h>
#include <math.h>
#include "wx/os2/private.h"
@ -68,11 +67,6 @@ static const int VIEWPORT_EXTENT = 1000;
static const int MM_POINTS = 9;
static const int MM_METRIC = 10;
// usually this is defined in math.h
#ifndef M_PI
static const double M_PI = 3.14159265358979323846;
#endif // M_PI
// ---------------------------------------------------------------------------
// private functions
// ---------------------------------------------------------------------------

View File

@ -4,7 +4,7 @@
// Author: William Osborne
// Modified by:
// Created: 10/13/04
// RCS-ID: $Id:
// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -50,7 +50,6 @@
#endif
#include <string.h>
#include <math.h>
#ifndef AC_SRC_ALPHA
#define AC_SRC_ALPHA 1
@ -72,11 +71,6 @@ static const int VIEWPORT_EXTENT = 1000;
static const int MM_POINTS = 9;
static const int MM_METRIC = 10;
// usually this is defined in math.h
#ifndef M_PI
static const double M_PI = 3.14159265358979323846;
#endif // M_PI
#define DSTCOPY 0x00AA0029
// ---------------------------------------------------------------------------