Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
80da61dc
Commit
80da61dc
authored
Mar 11, 2014
by
Mark Morschhäuser
Browse files
Fix MSVC++ compile error caused by missing round() in math.h
parent
6e9f8146
Changes
8
Hide whitespace changes
Inline
Side-by-side
cockatrice/CMakeLists.txt
View file @
80da61dc
...
@@ -82,6 +82,7 @@ SET(cockatrice_SOURCES
...
@@ -82,6 +82,7 @@ SET(cockatrice_SOURCES
${
CMAKE_CURRENT_BINARY_DIR
}
/version_string.cpp
${
CMAKE_CURRENT_BINARY_DIR
}
/version_string.cpp
)
)
SET
(
cockatrice_HEADERS
SET
(
cockatrice_HEADERS
src/round.h
src/abstractcounter.h
src/abstractcounter.h
src/counter_general.h
src/counter_general.h
src/dlg_creategame.h
src/dlg_creategame.h
...
...
cockatrice/src/abstractcarditem.cpp
View file @
80da61dc
...
@@ -2,7 +2,10 @@
...
@@ -2,7 +2,10 @@
#include
<QGraphicsScene>
#include
<QGraphicsScene>
#include
<QCursor>
#include
<QCursor>
#include
<QGraphicsSceneMouseEvent>
#include
<QGraphicsSceneMouseEvent>
#include
<math.h>
#include
<cmath>
#ifdef _WIN32
#include
"round.h"
#endif
/* _WIN32 */
#include
"carddatabase.h"
#include
"carddatabase.h"
#include
"cardinfowidget.h"
#include
"cardinfowidget.h"
#include
"abstractcarditem.h"
#include
"abstractcarditem.h"
...
...
cockatrice/src/phasestoolbar.cpp
View file @
80da61dc
...
@@ -3,7 +3,10 @@
...
@@ -3,7 +3,10 @@
#include
<QPen>
#include
<QPen>
#include
<QTimer>
#include
<QTimer>
#include
<QDebug>
#include
<QDebug>
#include
<math.h>
#include
<cmath>
#ifdef _WIN32
#include
"round.h"
#endif
/* _WIN32 */
#include
"phasestoolbar.h"
#include
"phasestoolbar.h"
#include
"pixmapgenerator.h"
#include
"pixmapgenerator.h"
...
...
cockatrice/src/pixmapgenerator.cpp
View file @
80da61dc
...
@@ -2,7 +2,10 @@
...
@@ -2,7 +2,10 @@
#include
"pb/serverinfo_user.pb.h"
#include
"pb/serverinfo_user.pb.h"
#include
<QPainter>
#include
<QPainter>
#include
<QSvgRenderer>
#include
<QSvgRenderer>
#include
<math.h>
#include
<cmath>
#ifdef _WIN32
#include
"round.h"
#endif
/* _WIN32 */
#include
<QDebug>
#include
<QDebug>
QMap
<
QString
,
QPixmap
>
PhasePixmapGenerator
::
pmCache
;
QMap
<
QString
,
QPixmap
>
PhasePixmapGenerator
::
pmCache
;
...
...
cockatrice/src/playertarget.cpp
View file @
80da61dc
...
@@ -5,7 +5,10 @@
...
@@ -5,7 +5,10 @@
#include
<QPainter>
#include
<QPainter>
#include
<QPixmapCache>
#include
<QPixmapCache>
#include
<QDebug>
#include
<QDebug>
#include
<math.h>
#include
<cmath>
#ifdef _WIN32
#include
"round.h"
#endif
/* _WIN32 */
PlayerCounter
::
PlayerCounter
(
Player
*
_player
,
int
_id
,
const
QString
&
_name
,
int
_value
,
QGraphicsItem
*
parent
)
PlayerCounter
::
PlayerCounter
(
Player
*
_player
,
int
_id
,
const
QString
&
_name
,
int
_value
,
QGraphicsItem
*
parent
)
:
AbstractCounter
(
_player
,
_id
,
_name
,
false
,
_value
,
parent
)
:
AbstractCounter
(
_player
,
_id
,
_name
,
false
,
_value
,
parent
)
...
...
cockatrice/src/replay_timeline_widget.cpp
View file @
80da61dc
...
@@ -2,7 +2,10 @@
...
@@ -2,7 +2,10 @@
#include
<QPainter>
#include
<QPainter>
#include
<QPalette>
#include
<QPalette>
#include
<QTimer>
#include
<QTimer>
#include
<math.h>
#include
<cmath>
#ifdef _WIN32
#include
"round.h"
#endif
/* _WIN32 */
ReplayTimelineWidget
::
ReplayTimelineWidget
(
QWidget
*
parent
)
ReplayTimelineWidget
::
ReplayTimelineWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
),
maxBinValue
(
1
),
maxTime
(
1
),
timeScaleFactor
(
1.0
),
currentTime
(
0
),
currentEvent
(
0
)
:
QWidget
(
parent
),
maxBinValue
(
1
),
maxTime
(
1
),
timeScaleFactor
(
1.0
),
currentTime
(
0
),
currentEvent
(
0
)
...
...
cockatrice/src/round.h
0 → 100644
View file @
80da61dc
#ifndef MSVC_ROUND_FIX
#define MSVC_ROUND_FIX
/**
* This helper function exists only because MS VC++ 2010 does not support round() in
* <cmath>. round() works with g++ and clang++ but is formally a C++11 extension.
* So this file exists for MS VC++ only.
*/
inline
double
round
(
double
val
)
{
return
floor
(
val
+
0
.
5
);
}
#endif
/* MSVC_ROUND_FIX */
cockatrice/src/tablezone.cpp
View file @
80da61dc
#include
<QPainter>
#include
<QPainter>
#include
<QSet>
#include
<QSet>
#include
<QGraphicsScene>
#include
<QGraphicsScene>
#include
<math.h>
#include
<cmath>
#ifdef _WIN32
#include
"round.h"
#endif
/* _WIN32 */
#include
"tablezone.h"
#include
"tablezone.h"
#include
"player.h"
#include
"player.h"
#include
"settingscache.h"
#include
"settingscache.h"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment