From 4efed2351710e1d726aa869bc5e7a41c0a1cac8b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 26 Jan 2010 11:25:39 +0000 Subject: Use #include "BLI_math.h" instead of _USE_MATH_DEFINES to get M_PI defined. --- source/blender/blenkernel/intern/depsgraph.c | 5 +---- source/blender/blenkernel/intern/unit.c | 8 ++------ source/blender/blenlib/BLI_winstuff.h | 4 ++++ source/blender/editors/animation/anim_draw.c | 1 - source/blender/editors/mesh/loopcut.c | 3 +-- source/blender/makesrna/intern/rna_brush.c | 5 +++-- source/blender/makesrna/intern/rna_camera.c | 4 ++-- source/blender/makesrna/intern/rna_fcurve.c | 5 ++--- source/blender/windowmanager/intern/wm_gesture.c | 4 +--- source/blender/windowmanager/intern/wm_operators.c | 3 +-- 10 files changed, 17 insertions(+), 25 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index d584b18aa84..b6ba07ada4a 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -29,12 +29,9 @@ #include #include -#ifdef _WIN32 -#include "BLI_winstuff.h" -#endif - #include "BLI_blenlib.h" #include "BLI_math.h" +#include "BLI_winstuff.h" #include "DNA_anim_types.h" #include "DNA_action_types.h" diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index c2994e1134c..1e8896042d6 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -20,17 +20,13 @@ * * ***** END GPL LICENSE BLOCK ***** */ -#define _USE_MATH_DEFINES - #include #include #include #include -#include -#if defined(WIN32) && (!(defined snprintf)) -#define snprintf _snprintf -#endif +#include "BLI_math.h" +#include "BLI_winstuff.h" #define TEMP_STR_SIZE 256 diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index 77d41e2b96a..677974928a4 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -32,6 +32,8 @@ #ifndef __WINSTUFF_H__ #define __WINSTUFF_H__ +#ifdef _WIN32 + #ifndef FREE_WINDOWS #pragma warning(once: 4761 4305 4244 4018) #endif @@ -139,5 +141,7 @@ int BLI_getInstallationDir(char *str); } #endif +#endif + #endif /* __WINSTUFF_H__ */ diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 93beb819a2b..decf507ae1f 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -28,7 +28,6 @@ #include #include -#include #include "DNA_anim_types.h" #include "DNA_action_types.h" diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index 089ac1a300c..906d966245f 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -27,8 +27,6 @@ */ #include -#define _USE_MATH_DEFINES -#include #include #include #include @@ -47,6 +45,7 @@ #include "BLI_blenlib.h" #include "BLI_dynstr.h" /*for WM_operator_pystring */ #include "BLI_editVert.h" +#include "BLI_math.h" #include "BKE_blender.h" #include "BKE_context.h" diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 06b08d677d4..f9f6f9e5020 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -21,10 +21,8 @@ * * ***** END GPL LICENSE BLOCK ***** */ - #define _USE_MATH_DEFINES #include -#include #include "RNA_define.h" #include "RNA_types.h" @@ -34,7 +32,10 @@ #include "DNA_brush_types.h" #include "DNA_texture_types.h" +#include "BLI_math.h" + #include "IMB_imbuf.h" + #include "WM_types.h" #ifdef RNA_RUNTIME diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index be7feb92d31..12dc790a1e8 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -22,9 +22,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -#define _USE_MATH_DEFINES #include -#include #include "RNA_define.h" #include "RNA_types.h" @@ -33,6 +31,8 @@ #include "DNA_camera_types.h" +#include "BLI_math.h" + #include "WM_types.h" #ifdef RNA_RUNTIME diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 4ff89b84877..d571f5038ee 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -22,10 +22,7 @@ * ***** END GPL LICENSE BLOCK ***** */ - #define _USE_MATH_DEFINES - #include -#include #include "RNA_access.h" #include "RNA_define.h" @@ -40,6 +37,8 @@ #include "MEM_guardedalloc.h" +#include "BLI_math.h" + #include "WM_types.h" EnumPropertyItem fmodifier_type_items[] = { diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 958832ce314..e94aab7ab89 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -26,9 +26,6 @@ * ***** END GPL LICENSE BLOCK ***** */ -#define _USE_MATH_DEFINES -#include - #include "DNA_screen_types.h" #include "DNA_vec_types.h" #include "DNA_userdef_types.h" @@ -38,6 +35,7 @@ #include "BLI_blenlib.h" #include "BLI_editVert.h" /* lasso tessellation */ +#include "BLI_math.h" #include "BLI_scanfill.h" /* lasso tessellation */ #include "BKE_context.h" diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 04d6a5b2325..2f2aebbc525 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -27,8 +27,6 @@ */ #include -#define _USE_MATH_DEFINES -#include #include #include #include @@ -48,6 +46,7 @@ #include "BLI_blenlib.h" #include "BLI_dynstr.h" /*for WM_operator_pystring */ +#include "BLI_math.h" #include "BLO_readfile.h" -- cgit v1.2.3