Re-commit MSVC build fixes, which were forcibly removed by 4675. Please (a) bring these upstream so they don't get deleted again, and (b) always check the build with MSVC prior to committing modifications to any libraries that affect that build.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4689 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/fltk/FL/Fl_Widget.H b/common/fltk/FL/Fl_Widget.H
index 5cc6a79..041b2d3 100644
--- a/common/fltk/FL/Fl_Widget.H
+++ b/common/fltk/FL/Fl_Widget.H
@@ -108,6 +108,7 @@
*/
class FL_EXPORT Fl_Widget {
friend class Fl_Group;
+ friend class Fl_X;
Fl_Group* parent_;
Fl_Callback* callback_;
diff --git a/common/fltk/src/fl_draw_pixmap.cxx b/common/fltk/src/fl_draw_pixmap.cxx
index 8296f67..b024485 100644
--- a/common/fltk/src/fl_draw_pixmap.cxx
+++ b/common/fltk/src/fl_draw_pixmap.cxx
@@ -128,7 +128,7 @@
if ((chars_per_pixel < 1) || (chars_per_pixel > 2))
return 0;
- uchar colors[1<<(chars_per_pixel*8)][4];
+ uchar (*colors)[4] = new uchar [1<<(chars_per_pixel*8)][4];
#ifdef WIN32
color_count = 0;
@@ -229,6 +229,7 @@
}
}
+ delete [] colors;
return 1;
}
@@ -242,10 +243,12 @@
if (!fl_measure_pixmap(cdata, w, h))
return 0;
- uchar buffer[w*h*4];
+ uchar *buffer = new uchar[w*h*4];
- if (!fl_convert_pixmap(cdata, buffer, bg))
+ if (!fl_convert_pixmap(cdata, buffer, bg)) {
+ delete buffer;
return 0;
+ }
// FIXME: Hack until fl_draw_image() supports alpha properly
#ifdef __APPLE_QUARTZ__
@@ -292,6 +295,7 @@
}
#endif
+ delete buffer;
return 1;
}