Skip to content

Commit

Permalink
Added #define to make MSVC see M_PI
Browse files Browse the repository at this point in the history
Discussed here: #12
  • Loading branch information
dkogan committed Dec 8, 2023
1 parent 11377bc commit 244ef97
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions autodiff.hh
Expand Up @@ -13,6 +13,8 @@
that file for usage examples
*/

// Apparently I need this in MSVC to get constants
#define _USE_MATH_DEFINES
#include <math.h>
#include <string.h>
#include "strides.h"
Expand Down
4 changes: 4 additions & 0 deletions cameramodel-parser.re
Expand Up @@ -8,6 +8,10 @@
//
// http://www.apache.org/licenses/LICENSE-2.0


// Apparently I need this in MSVC to get constants
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
Expand Down
3 changes: 3 additions & 0 deletions mrcal.c
Expand Up @@ -6,6 +6,9 @@
//
// http://www.apache.org/licenses/LICENSE-2.0

// Apparently I need this in MSVC to get constants
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
Expand Down
3 changes: 3 additions & 0 deletions poseutils-opencv.c
Expand Up @@ -30,6 +30,9 @@
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of

// Apparently I need this in MSVC to get constants
#define _USE_MATH_DEFINES

#include <math.h>
#include <float.h>

Expand Down
3 changes: 3 additions & 0 deletions poseutils.c
Expand Up @@ -6,6 +6,9 @@
//
// http://www.apache.org/licenses/LICENSE-2.0

// Apparently I need this in MSVC to get constants
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <string.h>
#include <math.h>
Expand Down
3 changes: 3 additions & 0 deletions stereo.c
Expand Up @@ -6,6 +6,9 @@
//
// http://www.apache.org/licenses/LICENSE-2.0

// Apparently I need this in MSVC to get constants
#define _USE_MATH_DEFINES

#include <math.h>

#include "mrcal.h"
Expand Down
3 changes: 3 additions & 0 deletions test/test-cahvor.c
@@ -1,3 +1,6 @@
// Apparently I need this in MSVC to get constants
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
Expand Down
3 changes: 3 additions & 0 deletions test/test-harness.h
@@ -1,5 +1,8 @@
#pragma once

// Apparently I need this in MSVC to get constants
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <stdbool.h>
#include <math.h>
Expand Down

0 comments on commit 244ef97

Please sign in to comment.