Skip to content
Snippets Groups Projects
Commit 034e51e1 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

replace the ugly MSVC test with a simple definition for M_PI, so that this...

replace the ugly MSVC test with a simple definition for M_PI, so that this also works on Mingw/Msys when in strict c++11 mode
parent f48e666c
No related branches found
No related tags found
No related merge requests found
...@@ -767,10 +767,6 @@ cpp_header = """// {0} ...@@ -767,10 +767,6 @@ cpp_header = """// {0}
// types from the C++ standard library. See `tutorial/c++' and `demos/api' for // types from the C++ standard library. See `tutorial/c++' and `demos/api' for
// examples. // examples.
#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
#define _USE_MATH_DEFINES
#endif
#include <cmath> #include <cmath>
#include <vector> #include <vector>
#include <string> #include <string>
...@@ -790,6 +786,10 @@ cpp_header = """// {0} ...@@ -790,6 +786,10 @@ cpp_header = """// {0}
#define {2}_API #define {2}_API
#endif #endif
#ifndef M_PI
#define M_PI (3.14159265358979323846)
#endif
namespace {6} {{ namespace {6} {{
// A geometrical entity in the {3} API is represented by two integers: its // A geometrical entity in the {3} API is represented by two integers: its
...@@ -907,16 +907,16 @@ cwrap_header = """// {0} ...@@ -907,16 +907,16 @@ cwrap_header = """// {0}
// //
// Do not edit this file directly: it is automatically generated by `api/gen.py'. // Do not edit this file directly: it is automatically generated by `api/gen.py'.
#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
#define _USE_MATH_DEFINES
#endif
#include <cmath> #include <cmath>
#include <vector> #include <vector>
#include <string> #include <string>
#include <utility> #include <utility>
#include <string.h> #include <string.h>
#ifndef M_PI
#define M_PI (3.14159265358979323846)
#endif
extern \"C\" {{ extern \"C\" {{
#include "{6}c.h" #include "{6}c.h"
}} }}
......
...@@ -14,10 +14,6 @@ ...@@ -14,10 +14,6 @@
// types from the C++ standard library. See `tutorial/c++' and `demos/api' for // types from the C++ standard library. See `tutorial/c++' and `demos/api' for
// examples. // examples.
#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
#define _USE_MATH_DEFINES
#endif
#include <cmath> #include <cmath>
#include <vector> #include <vector>
#include <string> #include <string>
...@@ -37,6 +33,10 @@ ...@@ -37,6 +33,10 @@
#define GMSH_API #define GMSH_API
#endif #endif
#ifndef M_PI
#define M_PI (3.14159265358979323846)
#endif
namespace gmsh { namespace gmsh {
// A geometrical entity in the Gmsh API is represented by two integers: its // A geometrical entity in the Gmsh API is represented by two integers: its
......
...@@ -21,16 +21,16 @@ ...@@ -21,16 +21,16 @@
// //
// Do not edit this file directly: it is automatically generated by `api/gen.py'. // Do not edit this file directly: it is automatically generated by `api/gen.py'.
#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
#define _USE_MATH_DEFINES
#endif
#include <cmath> #include <cmath>
#include <vector> #include <vector>
#include <string> #include <string>
#include <utility> #include <utility>
#include <string.h> #include <string.h>
#ifndef M_PI
#define M_PI (3.14159265358979323846)
#endif
extern "C" { extern "C" {
#include "gmshc.h" #include "gmshc.h"
} }
......
...@@ -288,6 +288,8 @@ the same name, select the one that was added first. ...@@ -288,6 +288,8 @@ the same name, select the one that was added first.
- -
@item Return: @item Return:
- -
@item Examples:
Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L123,x3.py})
@end table @end table
@item gmsh/model/getEntities @item gmsh/model/getEntities
...@@ -505,7 +507,7 @@ overall model. ...@@ -505,7 +507,7 @@ overall model.
@item Return: @item Return:
integer value integer value
@item Examples: @item Examples:
C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L77,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L11,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L63,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L63,faces.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L11,plugin.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L74,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L10,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L11,mesh_from_discrete_curve.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L9,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/reparamOnFace.py#L23,reparamOnFace.py}, ...) C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L77,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L11,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L63,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L63,faces.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L11,plugin.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L74,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L72,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L10,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L11,mesh_from_discrete_curve.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L9,plugin.py}, ...)
@end table @end table
@item gmsh/model/removeEntities @item gmsh/model/removeEntities
...@@ -1136,7 +1138,7 @@ automatically assigned to the nodes. ...@@ -1136,7 +1138,7 @@ automatically assigned to the nodes.
@item Return: @item Return:
- -
@item Examples: @item Examples:
C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L91,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L14,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L12,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L11,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L88,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L13,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/flatten.py#L37,flatten.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L16,mesh_from_discrete_curve.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L10,plugin.py}, ...) C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L91,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L14,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L12,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L11,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L88,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L73,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L13,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/flatten.py#L37,flatten.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L16,mesh_from_discrete_curve.py}, ...)
@end table @end table
@item gmsh/model/mesh/reclassifyNodes @item gmsh/model/mesh/reclassifyNodes
...@@ -1390,7 +1392,7 @@ are automatically assigned to the elements. ...@@ -1390,7 +1392,7 @@ are automatically assigned to the elements.
@item Return: @item Return:
- -
@item Examples: @item Examples:
C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L97,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L67,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L67,faces.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L94,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/terrain.py#L59,terrain.py}) C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L97,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L67,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L67,faces.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L94,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L78,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/terrain.py#L59,terrain.py})
@end table @end table
@item gmsh/model/mesh/getIntegrationPoints @item gmsh/model/mesh/getIntegrationPoints
...@@ -3914,7 +3916,7 @@ associate a new tag. Return the view tag. ...@@ -3914,7 +3916,7 @@ associate a new tag. Return the view tag.
@item Return: @item Return:
integer value integer value
@item Examples: @item Examples:
C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L111,t4.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L246,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L18,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L17,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L20,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L119,t4.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L90,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L41,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L16,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/poisson.py#L228,poisson.py}, ...) C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L111,t4.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L246,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L18,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L17,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L20,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L119,t4.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L27,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L90,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L41,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L16,plugin.py}, ...)
@end table @end table
@item gmsh/view/remove @item gmsh/view/remove
...@@ -3983,7 +3985,7 @@ data. @code{partition} allows to specify data in several sub-sets. ...@@ -3983,7 +3985,7 @@ data. @code{partition} allows to specify data in several sub-sets.
@item Return: @item Return:
- -
@item Examples: @item Examples:
C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L248,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L19,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L21,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L91,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L17,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/poisson.py#L229,poisson.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L20,view.py}) C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L248,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L19,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L21,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L86,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L91,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L17,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/poisson.py#L229,poisson.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L20,view.py})
@end table @end table
@item gmsh/view/addHomogeneousModelData @item gmsh/view/addHomogeneousModelData
...@@ -4001,6 +4003,8 @@ but only if data is associated to elements of the same type for ...@@ -4001,6 +4003,8 @@ but only if data is associated to elements of the same type for
- -
@item Return: @item Return:
- -
@item Examples:
Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L96,x3.py})
@end table @end table
@item gmsh/view/getModelData @item gmsh/view/getModelData
...@@ -4034,7 +4038,7 @@ contains the data for the @code{numEle} elements. ...@@ -4034,7 +4038,7 @@ contains the data for the @code{numEle} elements.
@item Return: @item Return:
- -
@item Examples: @item Examples:
C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L25,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L42,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view_combine.py#L19,view_combine.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.py#L20,viewlist.py}) C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L25,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L44,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L42,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view_combine.py#L19,view_combine.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.py#L20,viewlist.py})
@end table @end table
@item gmsh/view/getListData @item gmsh/view/getListData
...@@ -4068,7 +4072,7 @@ views) strings. @code{style} contains pairs of styling parameters, concatenated. ...@@ -4068,7 +4072,7 @@ views) strings. @code{style} contains pairs of styling parameters, concatenated.
@item Return: @item Return:
- -
@item Examples: @item Examples:
C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L115,t4.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L123,t4.py}) C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L115,t4.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L123,t4.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L50,x3.py})
@end table @end table
@item gmsh/view/getListDataStrings @item gmsh/view/getListDataStrings
...@@ -4164,7 +4168,7 @@ file extension. Append to the file if @code{append} is set. ...@@ -4164,7 +4168,7 @@ file extension. Append to the file if @code{append} is set.
@item Return: @item Return:
- -
@item Examples: @item Examples:
C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L249,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L44,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L25,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L27,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L93,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L43,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L34,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L28,view.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view_combine.py#L26,view_combine.py}, ...) C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L249,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L44,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L25,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L27,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L121,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L93,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L43,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L34,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L28,view.py}, ...)
@end table @end table
@end ftable @end ftable
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment