Skip to content

Commit

Permalink
Make sure C math constants are set before using them
Browse files Browse the repository at this point in the history
  - cmath/math.h constants are sometimes not set if _USE_MATH_DEFINES is
    not set before including cmath/math.h.

  - Make sure the define comes at the top of the file so that the header
    is not included indirectly (by other headers) without the define.
  • Loading branch information
mahge committed Jan 13, 2022
1 parent fe2593e commit 80cce20
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions OMEdit/OMEditLIB/Animation/ExtraShapes.cpp
Expand Up @@ -32,6 +32,11 @@
* @author Volker Waurich <volker.waurich@tu-dresden.de>
*/

#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include <cmath>

#include "ExtraShapes.h"
#include <iostream>

Expand Down

0 comments on commit 80cce20

Please sign in to comment.