Skip to content

Commit

Permalink
Fix Windows compilation in image_publisher.cpp (backport #1061) (#1062)
Browse files Browse the repository at this point in the history
PR #985 added some
code that used `M_PI`, but `M_PI` is not defined in any standard, and
before including `cmath` or `math.h` in Windows it is necessary to
define `_USE_MATH_DEFINES` to ensure that `M_PI` is defined.<hr>This is
an automatic backport of pull request #1061 done by
[Mergify](https://mergify.com).

Co-authored-by: Silvio Traversaro <[email protected]>
  • Loading branch information
mergify[bot] and traversaro authored Jan 6, 2025
1 parent 426af55 commit c3baf0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions image_publisher/src/image_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

// This define is added to support M_PI on Windows
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include <cmath>
#include <chrono>
#include <limits>
Expand Down

0 comments on commit c3baf0d

Please sign in to comment.