MSVC compile fixes.
1 Various compilation fixes for MSVC.
3 diff -r 7683fa6c06a2 ChangeLog
4 --- a/ChangeLog Mon Feb 11 10:11:56 2008 +0100
5 +++ b/ChangeLog Fri Jun 20 12:40:26 2008 +0200
7 +2008-06-20 Michael Goffioul <michael.goffioul@gmail.com>
9 + * Makeconf.in: Add GRAPHICS_CFLAGS substitution.
10 + * configure.in: Add checks for hypotf and _hypotf.
12 2008-06-12 Jaroslav Hajek <highegg@gmail.com>
14 * configure.in: Move LIBS and CXXFLAGS restoration into
15 diff -r 7683fa6c06a2 Makeconf.in
16 --- a/Makeconf.in Mon Feb 11 10:11:56 2008 +0100
17 +++ b/Makeconf.in Fri Jun 20 12:40:26 2008 +0200
19 ifeq ($(INCLUDE_DEPS),false)
23 +GRAPHICS_CFLAGS = @GRAPHICS_CFLAGS@
26 CXX_VERSION = @CXX_VERSION@
27 diff -r 7683fa6c06a2 configure.in
28 --- a/configure.in Mon Feb 11 10:11:56 2008 +0100
29 +++ b/configure.in Fri Jun 20 12:40:26 2008 +0200
31 ### Check for nonstandard but common math functions that we need.
33 AC_CHECK_FUNCS(acosh acoshf asinh asinhf atanh atanhf erf erff erfc erfcf exp2 exp2f log2 log2f)
34 +AC_CHECK_FUNCS(hypotf _hypotf)
36 ### Checks for OS specific cruft.
38 diff -r 7683fa6c06a2 liboctave/ChangeLog
39 --- a/liboctave/ChangeLog Mon Feb 11 10:11:56 2008 +0100
40 +++ b/liboctave/ChangeLog Fri Jun 20 12:40:27 2008 +0200
42 +2008-06-20 Michael Goffioul <michael.goffioul@gmail.com>
44 + * lo-specfun.h: Fix typo in erff/erfcf declaration.
45 + * lo-specfun.cc: Ditto. Add atanhf implementation.
47 2008-06-13 Michael Goffioul <michael.goffioul@gmail.com>
49 * lo-mappers.cc (arg): Remove ambiguity about atan2(float,float) usage.
50 diff -r 7683fa6c06a2 liboctave/lo-specfun.cc
51 --- a/liboctave/lo-specfun.cc Mon Feb 11 10:11:56 2008 +0100
52 +++ b/liboctave/lo-specfun.cc Fri Jun 20 12:40:27 2008 +0200
57 +#if !defined (HAVE_ATANHF)
62 + F77_XFCN (xatanh, XATANH, (x, retval));
67 #if !defined (HAVE_ERF)
72 #if !defined (HAVE_ERFF)
78 F77_XFCN (xerf, XERF, (x, retval));
81 #if !defined (HAVE_ERFCF)
87 F77_XFCN (xerfc, XERFC, (x, retval));
88 diff -r 7683fa6c06a2 liboctave/lo-specfun.h
89 --- a/liboctave/lo-specfun.h Mon Feb 11 10:11:56 2008 +0100
90 +++ b/liboctave/lo-specfun.h Fri Jun 20 12:40:27 2008 +0200
94 #if !defined (HAVE_ERFF)
95 -extern OCTAVE_API float erf (float);
96 +extern OCTAVE_API float erff (float);
99 #if !defined (HAVE_ERFCF)
100 -extern OCTAVE_API float erfc (float);
101 +extern OCTAVE_API float erfcf (float);
104 #if !defined (HAVE_EXPM1)
105 diff -r 7683fa6c06a2 src/ChangeLog
106 --- a/src/ChangeLog Mon Feb 11 10:11:56 2008 +0100
107 +++ b/src/ChangeLog Fri Jun 20 12:40:27 2008 +0200
109 +2008-06-20 Michael Goffioul <michael.goffioul@gmail.com>
111 + * Makefile.in: Add OPENGL_LIBS to liboctinterp link command. Add
112 + GRAPHICS_CFLAGS to fltk_backend.cc compilation command.
113 + * data.cc: Define hypotf to _hypotf when not present.
114 + * gl-render.h: Replace OCTGRAPHICS_API with OCTINTERP_API.
115 + * gl-render.cc: Get rid of Array2<vertex_data>.
116 + * OPERATORS/op-int.h: Force the use of "pow" on double when invoked
117 + with float arguments.
119 2008-06-17 John W. Eaton <jwe@octave.org>
121 * toplev.h, toplev.cc (class octave_call_stack):
122 diff -r 7683fa6c06a2 src/Makefile.in
123 --- a/src/Makefile.in Mon Feb 11 10:11:56 2008 +0100
124 +++ b/src/Makefile.in Fri Jun 20 12:40:27 2008 +0200
128 OCTINTERP_LINK_DEPS = \
129 - -L../liboctave $(LIBOCTAVE) -L../libcruft $(LIBCRUFT) $(LIBS) $(FLIBS)
130 + -L../liboctave $(LIBOCTAVE) -L../libcruft $(LIBCRUFT) $(LIBS) $(FLIBS) \
134 -L../libcruft $(LIBCRUFT) -L../liboctave $(LIBOCTAVE) \
138 ALL_CXXFLAGS := $(filter-out $(DLL_CXXDEFS), $(ALL_CXXFLAGS))
140 +fltk_backend.o pic/fltk_backend.o: \
141 + ALL_CXXFLAGS := $(filter-out $(DLL_CXXDEFS), $(ALL_CXXFLAGS) $(GRAPHICS_CFLAGS))
143 XERBLA = ../libcruft/blas-xtra/xerbla.o
145 diff -r 7683fa6c06a2 src/OPERATORS/op-int.h
146 --- a/src/OPERATORS/op-int.h Mon Feb 11 10:11:56 2008 +0100
147 +++ b/src/OPERATORS/op-int.h Fri Jun 20 12:40:27 2008 +0200
148 @@ -227,13 +227,13 @@
150 xpow (const octave_ ## T1& a, float b) \
152 - return pow (a, b); \
153 + return pow (a, static_cast<double> (b)); \
157 xpow (float a, const octave_ ## T1& b) \
159 - return pow (a, b); \
160 + return pow (static_cast<double> (a), b); \
163 #define OCTAVE_SS_INT_OPS(TYPE) \
165 for (int i = 0; i < b.length (); i++) \
168 - result (i) = pow (a, b(i)); \
169 + result (i) = pow (a, static_cast<double> (b(i))); \
171 return octave_value (result); \
174 for (int i = 0; i < b.length (); i++) \
177 - result (i) = pow (a, b(i)); \
178 + result (i) = pow (static_cast<double> (a), b(i)); \
180 return octave_value (result); \
183 for (int i = 0; i < a.length (); i++) \
186 - result (i) = pow (a(i), b); \
187 + result (i) = pow (a(i), static_cast<double> (b)); \
189 return octave_value (result); \
192 for (int i = 0; i < a.length (); i++) \
195 - result (i) = pow (a(i), b); \
196 + result (i) = pow (static_cast<double> (a(i)), b); \
198 return octave_value (result); \
201 for (int i = 0; i < a.length (); i++) \
204 - result (i) = pow (a(i), b(i)); \
205 + result (i) = pow (a(i), static_cast<double> (b(i))); \
207 return octave_value (result); \
210 for (int i = 0; i < a.length (); i++) \
213 - result (i) = pow (a(i), b(i)); \
214 + result (i) = pow (static_cast<double> (a(i)), b(i)); \
216 return octave_value (result); \
218 diff -r 7683fa6c06a2 src/data.cc
219 --- a/src/data.cc Mon Feb 11 10:11:56 2008 +0100
220 +++ b/src/data.cc Fri Jun 20 12:40:27 2008 +0200
223 #include "variables.h"
226 +#if ! defined (HAVE_HYPOTF) && defined (HAVE__HYPOTF)
227 +#define hypotf _hypotf
228 +#define HAVE_HYPOTF 1
231 #define ANY_ALL(FCN) \
233 diff -r 7683fa6c06a2 src/gl-render.cc
234 --- a/src/gl-render.cc Mon Feb 11 10:11:56 2008 +0100
235 +++ b/src/gl-render.cc Fri Jun 20 12:40:27 2008 +0200
238 vertex_data_rep *get_rep (void) const { return rep; }
244 opengl_renderer::patch_tesselator : public opengl_tesselator
245 @@ -2283,7 +2281,8 @@
246 has_facealpha = ((a.numel () > 0) && (a.rows () == f.rows ()));
249 - Array2<vertex_data> vdata (f.dims ());
250 + octave_idx_type fr = f.rows (), fc = f.columns ();
251 + std::vector<vertex_data> vdata (f.numel ());
253 for (int i = 0; i < nf; i++)
254 for (int j = 0; j < count_f(i); j++)
255 @@ -2316,7 +2315,7 @@
261 vertex_data (vv, cc, nn, aa, as, ds, ss, se);
264 @@ -2366,7 +2365,7 @@
266 for (int j = 0; j < count_f(i); j++)
268 - vertex_data::vertex_data_rep *vv = vdata(i,j).get_rep ();
269 + vertex_data::vertex_data_rep *vv = vdata[i+j*fr].get_rep ();
271 tess.add_vertex (vv->coords.fortran_vec (), vv);
273 @@ -2426,7 +2425,7 @@
275 for (int j = 0; j < count_f(i); j++)
277 - vertex_data::vertex_data_rep *vv = vdata(i,j).get_rep ();
278 + vertex_data::vertex_data_rep *vv = vdata[i+j*fr].get_rep ();
280 tess.add_vertex (vv->coords.fortran_vec (), vv);
282 @@ -2481,10 +2480,10 @@
285 Matrix lc = (do_edge ? (mecolor.numel () == 0 ?
286 - vdata(i,j).get_rep ()->color : mecolor)
287 + vdata[i+j*fr].get_rep ()->color : mecolor)
289 Matrix fc = (do_face ? (mfcolor.numel () == 0 ?
290 - vdata(i,j).get_rep ()->color : mfcolor)
291 + vdata[i+j*fr].get_rep ()->color : mfcolor)
294 draw_marker (v(idx,0), v(idx,1), (has_z ? v(idx,2) : 0), lc, fc);
295 diff -r 7683fa6c06a2 src/gl-render.h
296 --- a/src/gl-render.h Mon Feb 11 10:11:56 2008 +0100
297 +++ b/src/gl-render.h Fri Jun 20 12:40:27 2008 +0200
299 #include "graphics.h"