mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1228947 - Replace mfbt/Constants.h with math.h. r=roc
This commit is contained in:
parent
94b02af319
commit
7f4c4d76a4
@ -552,6 +552,7 @@ case "$target" in
|
||||
|
||||
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
|
||||
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
|
||||
AC_DEFINE(_USE_MATH_DEFINES) # Otherwise MSVC's math.h doesn't #define M_PI.
|
||||
|
||||
if test "$_CC_MAJOR_VERSION" = "18" -a "$_CC_BUILD_VERSION" -ge "30723"; then
|
||||
_CC_SUITE=12
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
#include "../AudioPacketizer.h"
|
||||
|
||||
|
@ -26,16 +26,11 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// For M_PI
|
||||
// VS2015 requires <math.h> to be used; <cmath> doesn't seem to honor
|
||||
// _USE_MATH_DEFINES.
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
|
||||
#include "Biquad.h"
|
||||
|
||||
#include <float.h>
|
||||
#include <algorithm>
|
||||
#include <math.h>
|
||||
|
||||
namespace WebCore {
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
#ifndef DenormalDisabler_h
|
||||
#define DenormalDisabler_h
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <cmath>
|
||||
#include <float.h>
|
||||
|
||||
|
@ -30,9 +30,9 @@
|
||||
|
||||
#include "DenormalDisabler.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/Constants.h"
|
||||
#include "WebAudioUtils.h"
|
||||
|
||||
using namespace std;
|
||||
|
@ -8,7 +8,6 @@
|
||||
#define MOZILLA_SVGCONTENTUTILS_H
|
||||
|
||||
// include math.h to pick up definition of M_ maths defines e.g. M_PI
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
|
||||
#include "mozilla/gfx/2D.h" // for StrokeOptions
|
||||
|
@ -16,12 +16,12 @@
|
||||
|
||||
#include "GonkGPSGeolocationProvider.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <pthread.h>
|
||||
#include <hardware/gps.h>
|
||||
|
||||
#include "GeolocationUtil.h"
|
||||
#include "mozstumbler/MozStumbler.h"
|
||||
#include "mozilla/Constants.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "mozilla/CheckedInt.h"
|
||||
#include "mozilla/Constants.h"
|
||||
|
||||
#include "2D.h"
|
||||
#include "DataSurfaceHelpers.h"
|
||||
|
@ -6,8 +6,6 @@
|
||||
#ifndef MOZILLA_GFX_DRAWCOMMAND_H_
|
||||
#define MOZILLA_GFX_DRAWCOMMAND_H_
|
||||
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
|
||||
#include "2D.h"
|
||||
@ -592,5 +590,4 @@ public:
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
|
||||
#endif /* MOZILLA_GFX_DRAWCOMMAND_H_ */
|
||||
|
@ -16,12 +16,12 @@
|
||||
#include "Logging.h"
|
||||
#include "Tools.h"
|
||||
#include <algorithm>
|
||||
#include "mozilla/Constants.h"
|
||||
#include "FilterNodeSoftware.h"
|
||||
|
||||
#include "FilterNodeD2D1.h"
|
||||
#include "ExtendInputEffectD2D1.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <dwrite.h>
|
||||
|
||||
// decltype is not usable for overloaded functions.
|
||||
|
@ -3,8 +3,6 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include <cmath>
|
||||
#include "DataSurfaceHelpers.h"
|
||||
#include "FilterNodeSoftware.h"
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <math.h>
|
||||
#include "DrawTargetD2D.h"
|
||||
#include "Logging.h"
|
||||
#include "mozilla/Constants.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
@ -3,9 +3,6 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <cmath>
|
||||
|
||||
#include "PathHelpers.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -278,4 +275,3 @@ MaxStrokeExtents(const StrokeOptions& aStrokeOptions,
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mozilla
|
||||
|
||||
|
@ -7,9 +7,10 @@
|
||||
#define MOZILLA_GFX_PATHHELPERS_H_
|
||||
|
||||
#include "2D.h"
|
||||
#include "mozilla/Constants.h"
|
||||
#include "UserData.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
@ -146,6 +146,7 @@ UNIFIED_SOURCES += [
|
||||
'Matrix.cpp',
|
||||
'Path.cpp',
|
||||
'PathCairo.cpp',
|
||||
'PathHelpers.cpp',
|
||||
'PathRecording.cpp',
|
||||
'Quaternion.cpp',
|
||||
'RecordedEvent.cpp',
|
||||
@ -156,10 +157,6 @@ UNIFIED_SOURCES += [
|
||||
'SourceSurfaceRawData.cpp',
|
||||
]
|
||||
|
||||
SOURCES += [
|
||||
'PathHelpers.cpp', # Uses _USE_MATH_DEFINES
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
||||
EXPORTS.mozilla.gfx += [
|
||||
'QuartzSupport.h',
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
||||
#include "mozilla/BasicEvents.h" // for Modifiers, MODIFIER_*
|
||||
#include "mozilla/ClearOnShutdown.h" // for ClearOnShutdown
|
||||
#include "mozilla/Constants.h" // for M_PI
|
||||
#include "mozilla/EventForwards.h" // for nsEventStatus_*
|
||||
#include "mozilla/Preferences.h" // for Preferences
|
||||
#include "mozilla/ReentrantMonitor.h" // for ReentrantMonitorAutoEnter, etc
|
||||
|
@ -3,9 +3,6 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
#include <math.h>
|
||||
|
||||
#include "mozilla/Alignment.h"
|
||||
|
@ -6,9 +6,9 @@
|
||||
#ifndef GFX_PREFS_H
|
||||
#define GFX_PREFS_H
|
||||
|
||||
#include <cmath> // for M_PI
|
||||
#include <stdint.h>
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Constants.h" // for M_PI
|
||||
|
||||
// First time gfxPrefs::GetSingleton() needs to be called on the main thread,
|
||||
// before any of the methods accessing the values are used, but after
|
||||
|
@ -373,6 +373,7 @@ case "$target" in
|
||||
|
||||
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
|
||||
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
|
||||
AC_DEFINE(_USE_MATH_DEFINES) # Otherwise MSVC's math.h doesn't #define M_PI.
|
||||
|
||||
if test "$_CC_MAJOR_VERSION" = "18"; then
|
||||
_CC_SUITE=12
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include "jsmath.h"
|
||||
|
||||
#include "mozilla/Constants.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
@ -9,32 +9,9 @@
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "NamespaceImports.h"
|
||||
#include <cmath>
|
||||
|
||||
#ifndef M_PI
|
||||
# define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
#ifndef M_E
|
||||
# define M_E 2.7182818284590452354
|
||||
#endif
|
||||
#ifndef M_LOG2E
|
||||
# define M_LOG2E 1.4426950408889634074
|
||||
#endif
|
||||
#ifndef M_LOG10E
|
||||
# define M_LOG10E 0.43429448190325182765
|
||||
#endif
|
||||
#ifndef M_LN2
|
||||
# define M_LN2 0.69314718055994530942
|
||||
#endif
|
||||
#ifndef M_LN10
|
||||
# define M_LN10 2.30258509299404568402
|
||||
#endif
|
||||
#ifndef M_SQRT2
|
||||
# define M_SQRT2 1.41421356237309504880
|
||||
#endif
|
||||
#ifndef M_SQRT1_2
|
||||
# define M_SQRT1_2 0.70710678118654752440
|
||||
#endif
|
||||
#include "NamespaceImports.h"
|
||||
|
||||
namespace js {
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define NS_SVGUTILS_H
|
||||
|
||||
// include math.h to pick up definition of M_ maths defines e.g. M_PI
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
|
||||
#include "DrawMode.h"
|
||||
@ -25,7 +24,6 @@
|
||||
#include "nsISupportsBase.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "nsStyleStruct.h"
|
||||
#include "mozilla/Constants.h"
|
||||
#include <algorithm>
|
||||
|
||||
class gfxContext;
|
||||
|
@ -49,6 +49,7 @@ if CONFIG['OS_TARGET'] == 'WINNT':
|
||||
]
|
||||
DEFINES['USE_WINMM'] = True
|
||||
DEFINES['USE_WASAPI'] = True
|
||||
CXXFLAGS += ['-wd4005'] # C4005: '_USE_MATH_DEFINES' : macro redefinition
|
||||
|
||||
if CONFIG['OS_TARGET'] == 'Android':
|
||||
SOURCES += ['cubeb_opensl.c']
|
||||
|
@ -1,16 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* mfbt math constants. */
|
||||
|
||||
#ifndef mozilla_Constants_h
|
||||
#define mozilla_Constants_h
|
||||
|
||||
#ifndef M_PI
|
||||
# define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
#endif /* mozilla_Constants_h */
|
@ -30,7 +30,6 @@ EXPORTS.mozilla = [
|
||||
'CheckedInt.h',
|
||||
'Compiler.h',
|
||||
'Compression.h',
|
||||
'Constants.h',
|
||||
'DebugOnly.h',
|
||||
'decimal/Decimal.h',
|
||||
'double-conversion/double-conversion.h',
|
||||
|
@ -12,11 +12,12 @@
|
||||
#include "nsUXThemeData.h"
|
||||
#include "nsIDOMSimpleGestureEvent.h"
|
||||
#include "nsIDOMWheelEvent.h"
|
||||
#include "mozilla/Constants.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/TouchEvents.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::widget;
|
||||
|
||||
|
@ -7,8 +7,6 @@
|
||||
#ifndef nsMathUtils_h__
|
||||
#define nsMathUtils_h__
|
||||
|
||||
#define _USE_MATH_DEFINES /* needed for M_ constants on Win32 */
|
||||
|
||||
#include "nscore.h"
|
||||
#include <cmath>
|
||||
#include <float.h>
|
||||
|
Loading…
Reference in New Issue
Block a user