-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [mathgl] Update to v2.5 and apply fixes * Update CI baseline
- Loading branch information
Showing
10 changed files
with
97 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff --git "a/include/mgl2/define.h" "b/include/mgl2/define.h" | ||
index e23ec04..8e79086 100644 | ||
--- "a/include/mgl2/define.h" | ||
+++ "b/include/mgl2/define.h" | ||
@@ -141,7 +140,9 @@ typedef long msize; | ||
#define getcwd _getcwd | ||
#define chdir _chdir // BORLAND has chdir | ||
#endif | ||
+#if (_MSC_VER<1500) | ||
#define snprintf _snprintf | ||
+#endif | ||
#if (_MSC_VER<1600) // based on https://hg.python.org/cpython/rev/9aedb876c2d7 | ||
#define hypot _hypot | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/include/mgl2/define.h 2021-12-08 13:59:55.000000000 +0800 | ||
+++ a/include/mgl2/define.h 2021-12-15 10:39:09.701079400 +0800 | ||
@@ -66,6 +66,8 @@ | ||
#else | ||
#define MGL_FUNC_CONST | ||
#define MGL_FUNC_PURE | ||
+#define MGL_FUNC_INIT | ||
+#define MGL_FUNC_FINI | ||
#endif | ||
#define MGL_EXPORT_CONST MGL_EXPORT MGL_FUNC_CONST | ||
#define MGL_EXPORT_PURE MGL_EXPORT MGL_FUNC_PURE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git "a/src/canvas_cf.cpp" "b/src/canvas_cf.cpp" | ||
index 5e1443a..26a0a8e 100644 | ||
--- "a/src/canvas_cf.cpp" | ||
+++ "b/src/canvas_cf.cpp" | ||
@@ -50,7 +50,6 @@ void MGL_EXPORT MGL_FUNC_INIT mgl_init() // TODO try to add ld option: "-init mg | ||
#endif | ||
for(long i=0;i<360;i++) mgl_cos[i] = cos(i*M_PI/180.); | ||
if(!mglDefFont) mglDefFont = new mglFont(MGL_DEF_FONT_NAME); | ||
- if(!mglDefaultGr) mglDefaultGr = new mglCanvas(600,400); | ||
} | ||
} | ||
void MGL_EXPORT MGL_FUNC_FINI mgl_fini() // TODO try to add ld option: "-fini mgl_fini" | ||
@@ -434,7 +433,7 @@ void MGL_EXPORT mgl_set_legend_marks(HMGL gr, int num) | ||
uintptr_t MGL_EXPORT mgl_create_graph_(int *width, int *height) | ||
{ return uintptr_t(new mglCanvas(*width,*height)); } | ||
void MGL_EXPORT mgl_delete_graph_(uintptr_t *gr) { delete _GR_; } | ||
-uintptr_t MGL_EXPORT mgl_default_graph_() { return uintptr_t(&mglDefaultGr); } | ||
+uintptr_t MGL_EXPORT mgl_default_graph_() { return uintptr_t(mgl_default_graph()); } | ||
void MGL_EXPORT mgl_set_size_scl_(double *scl) { mgl_set_size_scl(*scl); } | ||
void MGL_EXPORT mgl_set_size_(uintptr_t *gr, int *width, int *height) | ||
{ mgl_set_size(_GR_,*width,*height); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/include/mgl2/abstract.h b/include/mgl2/abstract.h | ||
index c8c53b8..245333b 100644 | ||
--- a/include/mgl2/abstract.h | ||
+++ b/include/mgl2/abstract.h | ||
@@ -235,7 +235,11 @@ struct MGL_EXPORT mglNum | ||
}; | ||
//----------------------------------------------------------------------------- | ||
/// List of user-defined data arrays | ||
+#ifndef MGL_WIDGETS_DLL | ||
MGL_EXPORT extern std::vector<mglDataA*> mglDataList; | ||
+#else | ||
+__declspec(dllimport) extern std::vector<mglDataA*> mglDataList; | ||
+#endif | ||
//----------------------------------------------------------------------------- | ||
/// Abstract class for data array | ||
class MGL_EXPORT mglDataA | ||
diff --git a/widgets/CMakeLists.txt b/widgets/CMakeLists.txt | ||
index a9e1269..4c1d0d4 100644 | ||
--- a/widgets/CMakeLists.txt | ||
+++ b/widgets/CMakeLists.txt | ||
@@ -2,6 +2,7 @@ include(GenerateExportHeader) | ||
|
||
if(MSVC) | ||
add_definitions(-DMGL_LIB_MSVC) | ||
+ add_definitions(-DMGL_WIDGETS_DLL) | ||
endif(MSVC) | ||
|
||
if(MGL_HAVE_FLTK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters