# HG changeset patch # User John W. Eaton # Date 1215694758 14400 # Node ID e998e81224b5cae39aef84372d45f91cb1841c50 # Parent f46e73bcb85b9d9f2ccf355eab5ded747875ea53 Various compilation fixes for MSVC. diff -r f46e73bcb85b -r e998e81224b5 ChangeLog --- a/ChangeLog Wed Jul 09 18:03:10 2008 -0400 +++ b/ChangeLog Thu Jul 10 08:59:18 2008 -0400 @@ -1,8 +1,13 @@ -2008-07-09 Michael Goffioul +2008-07-10 Michael Goffioul * configure.in: new substituted variables GL_RENDER_SRC and FLTK_BACKEND_SRC. +2008-06-20 Michael Goffioul + + * Makeconf.in: Add GRAPHICS_CFLAGS substitution. + * configure.in: Add checks for hypotf and _hypotf. + 2008-06-12 Jaroslav Hajek * configure.in: Move LIBS and CXXFLAGS restoration into diff -r f46e73bcb85b -r e998e81224b5 Makeconf.in --- a/Makeconf.in Wed Jul 09 18:03:10 2008 -0400 +++ b/Makeconf.in Thu Jul 10 08:59:18 2008 -0400 @@ -171,6 +171,8 @@ omit_deps = true; endif +GRAPHICS_CFLAGS = @GRAPHICS_CFLAGS@ + CXX = @CXX@ CXX_VERSION = @CXX_VERSION@ CXXCPP = @CXXCPP@ diff -r f46e73bcb85b -r e998e81224b5 configure.in --- a/configure.in Wed Jul 09 18:03:10 2008 -0400 +++ b/configure.in Thu Jul 10 08:59:18 2008 -0400 @@ -1647,6 +1647,7 @@ ### Check for nonstandard but common math functions that we need. AC_CHECK_FUNCS(acosh acoshf asinh asinhf atanh atanhf erf erff erfc erfcf exp2 exp2f log2 log2f) +AC_CHECK_FUNCS(hypotf _hypotf) ### Checks for OS specific cruft. diff -r f46e73bcb85b -r e998e81224b5 liboctave/ChangeLog --- a/liboctave/ChangeLog Wed Jul 09 18:03:10 2008 -0400 +++ b/liboctave/ChangeLog Thu Jul 10 08:59:18 2008 -0400 @@ -1,3 +1,8 @@ +2008-07-10 Michael Goffioul + + * lo-specfun.h: Fix typo in erff/erfcf declaration. + * lo-specfun.cc: Ditto. Add atanhf implementation. + 2008-06-20 Jaroslav Hajek * MatrixType.h: Add missing include statement. diff -r f46e73bcb85b -r e998e81224b5 liboctave/lo-specfun.cc --- a/liboctave/lo-specfun.cc Wed Jul 09 18:03:10 2008 -0400 +++ b/liboctave/lo-specfun.cc Thu Jul 10 08:59:18 2008 -0400 @@ -224,6 +224,16 @@ } #endif +#if !defined (HAVE_ATANHF) +float +atanhf (float x) +{ + float retval; + F77_XFCN (xatanh, XATANH, (x, retval)); + return retval; +} +#endif + #if !defined (HAVE_ERF) double erf (double x) @@ -236,7 +246,7 @@ #if !defined (HAVE_ERFF) float -erf (float x) +erff (float x) { float retval; F77_XFCN (xerf, XERF, (x, retval)); @@ -256,7 +266,7 @@ #if !defined (HAVE_ERFCF) float -erfc (float x) +erfcf (float x) { float retval; F77_XFCN (xerfc, XERFC, (x, retval)); diff -r f46e73bcb85b -r e998e81224b5 liboctave/lo-specfun.h --- a/liboctave/lo-specfun.h Wed Jul 09 18:03:10 2008 -0400 +++ b/liboctave/lo-specfun.h Thu Jul 10 08:59:18 2008 -0400 @@ -76,11 +76,11 @@ #endif #if !defined (HAVE_ERFF) -extern OCTAVE_API float erf (float); +extern OCTAVE_API float erff (float); #endif #if !defined (HAVE_ERFCF) -extern OCTAVE_API float erfc (float); +extern OCTAVE_API float erfcf (float); #endif #if !defined (HAVE_EXPM1) diff -r f46e73bcb85b -r e998e81224b5 src/ChangeLog --- a/src/ChangeLog Wed Jul 09 18:03:10 2008 -0400 +++ b/src/ChangeLog Thu Jul 10 08:59:18 2008 -0400 @@ -1,3 +1,13 @@ +2008-07-10 Michael Goffioul + + * Makefile.in: Add OPENGL_LIBS to liboctinterp link command. Add + GRAPHICS_CFLAGS to fltk_backend.cc compilation command. + * data.cc: Define hypotf to _hypotf when not present. + * gl-render.h: Replace OCTGRAPHICS_API with OCTINTERP_API. + * gl-render.cc: Get rid of Array2. + * OPERATORS/op-int.h: Use powf instead of pow when invoked + with float arguments. + 2008-07-09 John W. Eaton * input.cc (get_debug_input): Don't delete global_command here. diff -r f46e73bcb85b -r e998e81224b5 src/Makefile.in --- a/src/Makefile.in Wed Jul 09 18:03:10 2008 -0400 +++ b/src/Makefile.in Thu Jul 10 08:59:18 2008 -0400 @@ -278,7 +278,8 @@ endif OCTINTERP_LINK_DEPS = \ - -L../liboctave $(LIBOCTAVE) -L../libcruft $(LIBCRUFT) $(LIBS) $(FLIBS) + -L../liboctave $(LIBOCTAVE) -L../libcruft $(LIBCRUFT) $(LIBS) $(FLIBS) \ + $(OPENGL_LIBS) OCT_LINK_DEPS = \ -L../libcruft $(LIBCRUFT) -L../liboctave $(LIBOCTAVE) \ @@ -306,6 +307,9 @@ $(DLD_PICOBJ): \ ALL_CXXFLAGS := $(filter-out $(DLL_CXXDEFS), $(ALL_CXXFLAGS)) +fltk_backend.o pic/fltk_backend.o: \ + ALL_CXXFLAGS := $(filter-out $(DLL_CXXDEFS), $(ALL_CXXFLAGS) $(GRAPHICS_CFLAGS)) + XERBLA = ../libcruft/blas-xtra/xerbla.o ifdef FPICFLAG PIC_XERBLA = ../libcruft/blas-xtra/pic/xerbla.o diff -r f46e73bcb85b -r e998e81224b5 src/OPERATORS/op-int.h --- a/src/OPERATORS/op-int.h Wed Jul 09 18:03:10 2008 -0400 +++ b/src/OPERATORS/op-int.h Thu Jul 10 08:59:18 2008 -0400 @@ -227,13 +227,13 @@ octave_value \ xpow (const octave_ ## T1& a, float b) \ { \ - return pow (a, b); \ + return powf (a, b); \ } \ \ octave_value \ xpow (float a, const octave_ ## T1& b) \ { \ - return pow (a, b); \ + return powf (a, b); \ } #define OCTAVE_SS_INT_OPS(TYPE) \ @@ -360,7 +360,7 @@ for (int i = 0; i < b.length (); i++) \ { \ OCTAVE_QUIT; \ - result (i) = pow (a, b(i)); \ + result (i) = powf (a, b(i)); \ } \ return octave_value (result); \ } \ @@ -372,7 +372,7 @@ for (int i = 0; i < b.length (); i++) \ { \ OCTAVE_QUIT; \ - result (i) = pow (a, b(i)); \ + result (i) = powf (a, b(i)); \ } \ return octave_value (result); \ } @@ -512,7 +512,7 @@ for (int i = 0; i < a.length (); i++) \ { \ OCTAVE_QUIT; \ - result (i) = pow (a(i), b); \ + result (i) = powf (a(i), b); \ } \ return octave_value (result); \ } \ @@ -523,7 +523,7 @@ for (int i = 0; i < a.length (); i++) \ { \ OCTAVE_QUIT; \ - result (i) = pow (a(i), b); \ + result (i) = powf (a(i), b); \ } \ return octave_value (result); \ } @@ -690,7 +690,7 @@ for (int i = 0; i < a.length (); i++) \ { \ OCTAVE_QUIT; \ - result (i) = pow (a(i), b(i)); \ + result (i) = powf (a(i), b(i)); \ } \ return octave_value (result); \ } \ @@ -709,7 +709,7 @@ for (int i = 0; i < a.length (); i++) \ { \ OCTAVE_QUIT; \ - result (i) = pow (a(i), b(i)); \ + result (i) = powf (a(i), b(i)); \ } \ return octave_value (result); \ } diff -r f46e73bcb85b -r e998e81224b5 src/data.cc --- a/src/data.cc Wed Jul 09 18:03:10 2008 -0400 +++ b/src/data.cc Thu Jul 10 08:59:18 2008 -0400 @@ -63,6 +63,11 @@ #include "variables.h" #include "pager.h" +#if ! defined (HAVE_HYPOTF) && defined (HAVE__HYPOTF) +#define hypotf _hypotf +#define HAVE_HYPOTF 1 +#endif + #define ANY_ALL(FCN) \ \ octave_value retval; \ diff -r f46e73bcb85b -r e998e81224b5 src/gl-render.cc --- a/src/gl-render.cc Wed Jul 09 18:03:10 2008 -0400 +++ b/src/gl-render.cc Thu Jul 10 08:59:18 2008 -0400 @@ -380,8 +380,6 @@ vertex_data_rep *get_rep (void) const { return rep; } }; -#include - class opengl_renderer::patch_tesselator : public opengl_tesselator { @@ -2300,7 +2298,8 @@ has_facealpha = ((a.numel () > 0) && (a.rows () == f.rows ())); } - Array2 vdata (f.dims ()); + octave_idx_type fr = f.rows (), fc = f.columns (); + std::vector vdata (f.numel ()); for (int i = 0; i < nf; i++) for (int j = 0; j < count_f(i); j++) @@ -2333,7 +2332,7 @@ aa = a(idx); } - vdata(i,j) = + vdata[i+j*fr] = vertex_data (vv, cc, nn, aa, as, ds, ss, se); } @@ -2383,7 +2382,7 @@ for (int j = 0; j < count_f(i); j++) { - vertex_data::vertex_data_rep *vv = vdata(i,j).get_rep (); + vertex_data::vertex_data_rep *vv = vdata[i+j*fr].get_rep (); tess.add_vertex (vv->coords.fortran_vec (), vv); } @@ -2443,7 +2442,7 @@ for (int j = 0; j < count_f(i); j++) { - vertex_data::vertex_data_rep *vv = vdata(i,j).get_rep (); + vertex_data::vertex_data_rep *vv = vdata[i+j*fr].get_rep (); tess.add_vertex (vv->coords.fortran_vec (), vv); } @@ -2498,10 +2497,10 @@ continue; Matrix lc = (do_edge ? (mecolor.numel () == 0 ? - vdata(i,j).get_rep ()->color : mecolor) + vdata[i+j*fr].get_rep ()->color : mecolor) : Matrix ()); Matrix fc = (do_face ? (mfcolor.numel () == 0 ? - vdata(i,j).get_rep ()->color : mfcolor) + vdata[i+j*fr].get_rep ()->color : mfcolor) : Matrix ()); draw_marker (v(idx,0), v(idx,1), (has_z ? v(idx,2) : 0), lc, fc); diff -r f46e73bcb85b -r e998e81224b5 src/gl-render.h --- a/src/gl-render.h Wed Jul 09 18:03:10 2008 -0400 +++ b/src/gl-render.h Thu Jul 10 08:59:18 2008 -0400 @@ -35,7 +35,7 @@ #include "graphics.h" class -OCTGRAPHICS_API +OCTINTERP_API opengl_renderer { public: