]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/mathgl/fix_cmakelists_and_cpp.patch
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / mathgl / fix_cmakelists_and_cpp.patch
1 diff --git a/mgllab/CMakeLists.txt b/mgllab/CMakeLists.txt
2 index 1649104..eeec1c1 100644
3 --- a/mgllab/CMakeLists.txt
4 +++ b/mgllab/CMakeLists.txt
5 @@ -38,7 +38,11 @@ if(MGL_HAVE_FLTK)
6 set(mgllab_src ${mgllab_src} mgllab.rc)
7 endif(WIN32)
8 add_executable(mgllab ${mgllab_src} ${mgllab_hdr})
9 - target_link_libraries(mgllab mgl mgl-fltk ${FLTK_LIBRARIES})
10 + if(WIN32)
11 + target_link_libraries(mgllab mgl mgl-fltk mgl-fltk-static mgl-static getopt-static ${FLTK_LIBRARIES})
12 + else(WIN32)
13 + target_link_libraries(mgllab mgl mgl-fltk ${FLTK_LIBRARIES})
14 + endif(WIN32)
15 install(
16 TARGETS mgllab
17 RUNTIME DESTINATION bin )
18 diff --git a/mgllab/table.cpp b/mgllab/table.cpp
19 index 5243549..23eebe5 100644
20 --- a/mgllab/table.cpp
21 +++ b/mgllab/table.cpp
22 @@ -559,8 +559,13 @@ public:
23 o->tooltip(_("Change data values and close this window"));
24 w->set_modal(); w->end();
25 }
26 - double min() { return wmin->value(); }
27 - double max() { return wmax->value(); }
28 + #if WIN32
29 + double _min() { return wmin->value(); }
30 + double _max() { return wmax->value(); }
31 + #else
32 + double min() { return wmin->value(); }
33 + double max() { return wmax->value(); }
34 + #endif
35 int sym() { return wsym->value(); }
36 bool ok() { return !result.empty(); }
37 void cb_ok()
38 @@ -581,8 +586,14 @@ void fill_cb(Fl_Widget*, void*v)
39 HMDT d = dynamic_cast<HMDT>(e->var);
40 HADT c = dynamic_cast<HADT>(e->var);
41 char ch = nrm_dlg.result[0];
42 - if(d) { d->Fill(nrm_dlg.min(),nrm_dlg.max(),ch); e->refresh(); }
43 - if(c) { c->Fill(nrm_dlg.min(),nrm_dlg.max(),ch); e->refresh(); }
44 + #if WIN32
45 + if(d) { d->Fill(nrm_dlg._min(),nrm_dlg._max(),ch); e->refresh(); }
46 + if(c) { c->Fill(nrm_dlg._min(),nrm_dlg._max(),ch); e->refresh(); }
47 + #else
48 + if(d) { d->Fill(nrm_dlg.min(),nrm_dlg.max(),ch); e->refresh(); }
49 + if(c) { c->Fill(nrm_dlg.min(),nrm_dlg.max(),ch); e->refresh(); }
50 + #endif
51 +
52 }
53 }
54 //-----------------------------------------------------------------------------
55 @@ -594,8 +605,13 @@ void normal_cb(Fl_Widget*, void*v)
56 {
57 HMDT d = dynamic_cast<HMDT>(e->var);
58 HADT c = dynamic_cast<HADT>(e->var);
59 - if(d) { d->Norm(nrm_dlg.min(),nrm_dlg.max(),nrm_dlg.sym()); e->refresh(); }
60 - if(c) { c->Fill(nrm_dlg.min(),nrm_dlg.max(),nrm_dlg.sym()); e->refresh(); }
61 + #if WIN32
62 + if(d) { d->Norm(nrm_dlg._min(),nrm_dlg._max(),nrm_dlg.sym()); e->refresh(); }
63 + if(c) { c->Fill(nrm_dlg._min(),nrm_dlg._max(),nrm_dlg.sym()); e->refresh(); }
64 + #else
65 + if(d) { d->Norm(nrm_dlg.min(),nrm_dlg.max(),nrm_dlg.sym()); e->refresh(); }
66 + if(c) { c->Fill(nrm_dlg.min(),nrm_dlg.max(),nrm_dlg.sym()); e->refresh(); }
67 + #endif
68 }
69 }
70 //-----------------------------------------------------------------------------
71 diff --git a/src/parser.cpp b/src/parser.cpp
72 index 577191d..e6909a1 100644
73 --- a/src/parser.cpp
74 +++ b/src/parser.cpp
75 @@ -58,7 +58,10 @@ void mglParser::FillBaseCmd()
76 HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring string, mglParser *arg, const std::vector<mglDataA*> &head);
77 HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring string, mglParser *arg, const std::vector<mglDataA*> &head);
78 //-----------------------------------------------------------------------------
79 +#ifndef MGL_ASK_FUNC
80 +#define MGL_ASK_FUNC
81 MGL_EXPORT void (*mgl_ask_func)(const wchar_t *, wchar_t *)=0;
82 +#endif
83 void MGL_EXPORT mgl_ask_gets(const wchar_t *quest, wchar_t *res)
84 { printf("%ls\n",quest); if(!fgetws(res,1024,stdin)) *res=0; }
85 //-----------------------------------------------------------------------------
86 @@ -69,7 +72,10 @@ void MGL_EXPORT mgl_progress_txt(int value, int maximal, HMGL)
87 else for(int i=prev;i<value;i++) printf("#");
88 prev = value; fflush(stdout);
89 }
90 +#ifndef MGL_PROGRESS_FUNC
91 +#define MGL_PROGRESS_FUNC
92 MGL_EXPORT void (*mgl_progress_func)(int value, int maximal, HMGL)=mgl_progress_txt;
93 +#endif
94 void MGL_EXPORT mgl_progress(int value, int maximal, HMGL gr)
95 { mgl_progress_func(value, maximal, gr); }
96 //-----------------------------------------------------------------------------
97 diff --git a/utils/mglview.cpp b/utils/mglview.cpp
98 index d360df3..7e2634b 100644
99 --- a/utils/mglview.cpp
100 +++ b/utils/mglview.cpp
101 @@ -29,6 +29,18 @@
102 #include "mgl2/qt.h"
103 #endif
104 //-----------------------------------------------------------------------------
105 +#ifdef WIN32
106 +#ifndef MGL_ASK_FUNC
107 +#define MGL_ASK_FUNC
108 +MGL_EXPORT void (*mgl_ask_func)(const wchar_t *, wchar_t *)=0;
109 +#endif
110 +#ifndef MGL_PROGRESS_FUNC
111 +#define MGL_PROGRESS_FUNC
112 +MGL_EXPORT void (*mgl_progress_func)(int value, int maximal, HMGL)=0;
113 +#endif
114 +MGL_EXPORT std::string mglGlobalMess; ///< Buffer for receiving global messages
115 +#endif
116 +//-----------------------------------------------------------------------------
117 std::wstring str, opt;
118 std::vector<std::string> anim;
119 mglParse p(true);
120 diff --git a/include/mgl2/datac.h b/include/mgl2/datac.h
121 index f2c0251..0e69de7 100644
122 --- a/include/mgl2/datac.h
123 +++ b/include/mgl2/datac.h
124 @@ -474,7 +474,7 @@ using mglDataA::Momentum;
125 void set_v(mreal val, long i,long j=0,long k=0) { a[i+nx*(j+ny*k)]=val; }
126 #else
127 /// Get the value in given cell of the data with border checking
128 - mreal v(long i,long j=0,long k=0) const { return mgl_abs(mgl_datac_get_value(this,i,j,k)); }
129 + mreal v(long i,long j=0,long k=0) const { return abs(a[i+nx*(j+ny*k)]); }
130 /// Set the value in given cell of the data
131 void set_v(mreal val, long i,long j=0,long k=0) { mgl_datac_set_value(this,val,i,j,k); }
132 #endif
133 diff --git a/CMakeLists.txt b/CMakeLists.txt
134 index d0c779d..acd9d7f 100644
135 --- a/CMakeLists.txt
136 +++ b/CMakeLists.txt
137 @@ -579,10 +579,15 @@ if(enable-glut)
138 if(NOT MGL_HAVE_OPENGL)
139 message(SEND_ERROR "You have to enable OpenGL if you plan to use GLUT.")
140 endif(NOT MGL_HAVE_OPENGL)
141 - include(FindGLUT)
142 + find_path(GLUT_INCLUDE_DIR freeglut.h PATH_SUFFIXES GL)
143 + include(SelectLibraryConfigurations)
144 + find_library(GLUT_LIBRARY_RELEASE NAMES freeglut)
145 + find_library(GLUT_LIBRARY_DEBUG NAMES freeglutd)
146 + select_library_configurations(GLUT)
147 if(NOT GLUT_FOUND)
148 message(SEND_ERROR "Couldn't find GLUT library.")
149 endif(NOT GLUT_FOUND)
150 + include_directories(${GLUT_INCLUDE_DIR}/GL)
151 else(enable-glut)
152 set(MGL_HAVE_GLUT 0)
153 endif(enable-glut)