g++ -DHAVE_CONFIG_H -I. -I. -I../../../../src/include -I/usr/X11R6/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/X11R6/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -D_THREAD_SAFE -DXTHREADS -DXUSE_MTSAFE_API -I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include -I/usr/local/include/atk-1.0 -I/usr/local/include/cairo -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/X11R6/include -I/usr/local/include/freetype2 -I/usr/local/include -I../../../../src/include -I../../../../src/include/wxscintilla/include -I../../../../src/include/wxFlatNotebook/include -Ulinux -Uunix -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT memorymappedfile.lo -MD -MP -MF .deps/memorymappedfile.Tpo -c memorymappedfile.cpp -fPIC -DPIC -o .libs/memorymappedfile.o
memorymappedfile.cpp: In static member function `static wxULongLong wxMemoryMappedFile::GetFileSize64(wxMemoryMappedFileHandleType)':
memorymappedfile.cpp:222: error: `off64_t' was not declared in this scope
memorymappedfile.cpp:222: error: expected `;' before "size"
memorymappedfile.cpp:223: error: `lseek64' was not declared in this scope
memorymappedfile.cpp:224: error: `size' was not declared in this scope
memorymappedfile.cpp:228: error: `size' was not declared in this scope
gmake[5]: *** [memorymappedfile.lo] Error 1
gmake[5]: Leaving directory `/usr/src/codeblocks/src/plugins/contrib/codesnippets'
Build machine is freebsd 6.2. I'm building C::B with wx2.8, since 2.6 is throwing wx errors when drawing some graphics. Or at least trying to - this module won't build. The reason is
probably because freebsd doesn't seem to have off64_t or the functions that use it.
I'll do gmake -i in the meantime.
Using Google, I may have found an solution, it needs tested on BSD and MAC OSX.
Note, BSD and Darwin are supposed to 64 bit already in lseek and other calls.
Tim S
Index: src/plugins/contrib/codesnippets/memorymappedfile.cpp
===================================================================
--- src/plugins/contrib/codesnippets/memorymappedfile.cpp (revision 3917)
+++ src/plugins/contrib/codesnippets/memorymappedfile.cpp (working copy)
@@ -218,6 +218,14 @@
{
return wxULongLong(INVALID_FILE_SIZE);
}
+#elif defined(__BSD__) || defined(__DARWIN__)
+ off_t size = lseek(hFile, 0, SEEK_END);
+ lseek(hFile, 0, SEEK_SET);//go back to the start of the file
+ if (-1 == size)
+ {
+ throw wxMemoryMappedInvalidFileSize();
+ }
+ return wxULongLong(size);
#else
off64_t size = lseek64(hFile, 0, SEEK_END);
lseek64(hFile, 0, SEEK_SET);//go back to the start of the file
Yeah, that one probably did the trick.
Now to deal with this new addition
./wxslistbook.cpp: In member function `virtual bool wxsListbook::OnMouseClick(wxWindow*, int, int)':
/usr/X11R6/include/wx-2.8/wx/listbook.h:94: error: `virtual int wxListbook::HitTest(const wxPoint&, long int*) const' is protected
./wxslistbook.cpp:301: error: within this context
gmake[6]: *** [wxslistbook.lo] Error 1
Yeah, that one probably did the trick.
Now to deal with this new addition
./wxslistbook.cpp: In member function `virtual bool wxsListbook::OnMouseClick(wxWindow*, int, int)':
/usr/X11R6/include/wx-2.8/wx/listbook.h:94: error: `virtual int wxListbook::HitTest(const wxPoint&, long int*) const' is protected
./wxslistbook.cpp:301: error: within this context
gmake[6]: *** [wxslistbook.lo] Error 1
What 2.8 are you using; the above bug was supposed to be fixed in 2.8.3?
I am updated my old patch for the new wxSmith right below.
New patch below:
Index: src/plugins/contrib/wxSmith/wxwidgets/defitems/wxslistbook.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/defitems/wxslistbook.cpp (revision 3929)
+++ src/plugins/contrib/wxSmith/wxwidgets/defitems/wxslistbook.cpp (working copy)
@@ -297,7 +297,12 @@
bool wxsListbook::OnMouseClick(wxWindow* Preview,int PosX,int PosY)
{
UpdateCurrentSelection();
+#if wxCHECK_VERSION(2, 8, 0) && (!(wxCHECK_VERSION(2, 8, 3)))
+ // Work around on bug in wxWidgets 2.8.0 to 2.8.2
+ wxBookCtrlBase* Listbook = (wxBookCtrlBase*)Preview;
+#else
wxListbook* Listbook = (wxListbook*)Preview;
+#endif
int Hit = Listbook->HitTest(wxPoint(PosX,PosY));
if ( Hit != wxNOT_FOUND )
{
Old Patch Below:
Index: src/plugins/contrib/wxSmith/defwidgets/wxslistbook.cpp
===================================================================
--- src/plugins/contrib/wxSmith/defwidgets/wxslistbook.cpp (revision 3438)
+++ src/plugins/contrib/wxSmith/defwidgets/wxslistbook.cpp (working copy)
@@ -204,7 +204,11 @@
if ( GetPreview() && event.LeftDown() )
{
wxListbook* Preview = (wxListbook*)GetPreview();
+#if wxCHECK_VERSION(2, 8, 0)
+ int Hit = wxStaticCast(Preview, wxBookCtrlBase)->HitTest(wxPoint(event.GetX(),event.GetY()));
+#else
int Hit = Preview->HitTest(wxPoint(event.GetX(),event.GetY()));
+#endif
if ( Hit != wxNOT_FOUND )
{
CurrentSelection = GetChild(Hit);
Tim S