Browse Source

Fix MSVC 2010 and older not finding round()

Actually we don't know about some newer MSVC versions, but current
version MSVC 2019 works fine w/o defining round(). If other MSVC
versions need this as well we can change the version test or add
a compiler feature test to CMake (configure not required).
pull/264/head
Albrecht Schlosser 4 years ago
parent
commit
374232e2f4
  1. 10
      src/Fl_win32.cxx

10
src/Fl_win32.cxx

@ -94,6 +94,16 @@ extern void fl_trigger_clipboard_notify(int source);
extern HBRUSH fl_brush_action(int action); extern HBRUSH fl_brush_action(int action);
extern void fl_cleanup_pens(void); extern void fl_cleanup_pens(void);
// MSVC 2010 can't find round() although <math.h> is included above,
// which is surprising because ceil() works fine.
// We could (should?) probably add configure/CMake feature tests for
// round() and ceil() rather than depending on MSVC version numbers.
// AlbrechtS, 02/2010 - Note: we don't know about MSVC 2012 - 2015, see
// https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
#if defined(_MSC_VER) && _MSC_VER <= 1600
#define round(A) int((A) + 0.5)
#endif // _MSC_VER <= 1600
// //
// USE_ASYNC_SELECT - define it if you have WSAAsyncSelect()... // USE_ASYNC_SELECT - define it if you have WSAAsyncSelect()...

Loading…
Cancel
Save