Patch #845 2006-02-19 10:27

heromyth

Fixes for compiling on FreeBSD 6.0
Download
845-Fixes_for_compi.patch (5.8 KB)
Category
Platform-Specific
Status
Accepted
Close date
2006-02-21 22:35
Assigned to
 
Index: D:/codeblocks/src/sdk/as/source/as_arrayobject.cpp
===================================================================
--- D:/codeblocks/src/sdk/as/source/as_arrayobject.cpp    (revision 2051)
+++ D:/codeblocks/src/sdk/as/source/as_arrayobject.cpp    (working copy)
@@ -33,8 +33,14 @@
 #endif
 #include <assert.h>
 #include <new>
-#include <malloc.h>
 
+#ifdef __FreeBSD__
+    #include <stdlib.h>
+#else
+    #include <malloc.h>
+#endif
+
+
 #include "as_config.h"
 #include "as_arrayobject.h"
 #include "as_scriptengine.h"
Index: D:/codeblocks/src/sdk/as/source/as_gcobject.cpp
===================================================================
--- D:/codeblocks/src/sdk/as/source/as_gcobject.cpp    (revision 2051)
+++ D:/codeblocks/src/sdk/as/source/as_gcobject.cpp    (working copy)
@@ -34,8 +34,11 @@
 #endif
 #include <assert.h>
 #include <new>
-#if defined(WIN32) || defined(HAVE_MALLOC_H)
-#include <malloc.h>
+
+#ifdef __FreeBSD__
+    #include <stdlib.h>
+#else
+    #include <malloc.h>
 #endif
 
 #include "as_config.h"
Index: D:/codeblocks/src/sdk/as/source/as_scriptengine.cpp
===================================================================
--- D:/codeblocks/src/sdk/as/source/as_scriptengine.cpp    (revision 2051)
+++ D:/codeblocks/src/sdk/as/source/as_scriptengine.cpp    (working copy)
@@ -39,8 +39,13 @@
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
-#include <malloc.h>
 
+#ifdef __FreeBSD__
+    #include <stdlib.h>
+#else
+    #include <malloc.h>
+#endif
+
 #include "as_config.h"
 #include "as_scriptengine.h"
 #include "as_builder.h"
Index: D:/codeblocks/src/sdk/configmanager.cpp
===================================================================
--- D:/codeblocks/src/sdk/configmanager.cpp    (revision 2051)
+++ D:/codeblocks/src/sdk/configmanager.cpp    (working copy)
@@ -1230,8 +1230,7 @@
     if(mNode)
     {
         while((curr = mNode->IterateChildren(curr)->ToElement()))
-            set->insert(_U(curr->FirstChild()->ToText()->Value()))
-            ;
+            set->insert(_U(curr->FirstChild()->ToText()->Value()));
     }
 }
 
Index: D:/codeblocks/src/sdk/editorbase.cpp
===================================================================
--- D:/codeblocks/src/sdk/editorbase.cpp    (revision 2051)
+++ D:/codeblocks/src/sdk/editorbase.cpp    (working copy)
@@ -317,6 +317,7 @@
         }
         m_SwitchTo.clear();
     }
+#if wxABI_VERSION >= 20601
     else if (id == idGoogle)/////////////////// TODO: UrlEncode
     {
         wxLaunchDefaultBrowser(wxString(_T("http://www.google.com/search?q=")) << URLEncode(lastWord));
@@ -325,6 +326,7 @@
     {
         wxLaunchDefaultBrowser(wxString(_T("http://search.microsoft.com/search/results.aspx?qu=")) << URLEncode(lastWord) << _T("&View=msdn"));
     }
+#endif
     else
     {
         event.Skip();
Index: D:/codeblocks/src/src/appglobals.cpp
===================================================================
--- D:/codeblocks/src/src/appglobals.cpp    (revision 2051)
+++ D:/codeblocks/src/src/appglobals.cpp    (working copy)
@@ -28,6 +28,8 @@
   const wxString g_AppPlatform = _T("OS/2");
 #elif defined(__WXMAC__)
   const wxString g_AppPlatform = _T("Mac OS X");
+#elif defined(__FreeBSD__)
+  const wxString g_AppPlatform = _T("FreeBSD");
 #elif defined(__UNIX__)
   const wxString g_AppPlatform = _T("Linux");
 #else
@@ -46,7 +48,9 @@
 
 operating_system_t __cb_get_os()
 {
-#if   defined(__UNIX__)
+#if defined(__FreeBSD__)
+    return oxFreeBSD;
+#elif defined(__UNIX__)
     return osLinux;
 #elif defined(__WXMAC__)
     return osOSX;
@@ -78,7 +82,7 @@
 }
 
 
-const wxString langs[] =
+const wxString langs[LANGUAGES_SIZE] =
 {
     _("(System default)")
 //        ,_T("English (U.S.)")
@@ -89,7 +93,7 @@
 };
 
 // Must have the same order than the above
-const int locales[] =
+const int locales[LANGUAGES_SIZE] =
 {
     wxLANGUAGE_DEFAULT
 //        ,wxLANGUAGE_ENGLISH_US
Index: D:/codeblocks/src/src/appglobals.h
===================================================================
--- D:/codeblocks/src/src/appglobals.h    (revision 2051)
+++ D:/codeblocks/src/src/appglobals.h    (working copy)
@@ -17,17 +17,18 @@
 extern const wxString g_DefaultBatchBuildArgs;
 
 #define LOCALIZE   true
-#define LANGUAGES  2
-//Please fix this. I have no Idea that the WXSIZEOF couldn't work whithout defining LANGUAGES
-extern const wxString langs[LANGUAGES];
-extern const int locales[LANGUAGES];
+#define LANGUAGES_SIZE  2
 
+extern const wxString langs[LANGUAGES_SIZE];
+extern const int locales[LANGUAGES_SIZE];
+
 typedef enum
 {
 osUnknownWindows,
 osWindows9598ME,
 osWindowsNT2000,
 osWindowsXP,
+oxFreeBSD,
 osLinux,
 osOS2,
 osOSX
Index: D:/codeblocks/src/src/environmentsettingsdlg.cpp
===================================================================
--- D:/codeblocks/src/src/environmentsettingsdlg.cpp    (revision 2051)
+++ D:/codeblocks/src/src/environmentsettingsdlg.cpp    (working copy)
@@ -117,7 +117,7 @@
 
     bool i18n=cfg->ReadBool(_T("/enviro
download for full patch...
thomasdenk 2006-02-19 10:52

Patch is unusable for me, my non-Chinese Subversion does not like รจ&#1118;&#1449;&#1126; 203 as revision string ;)

Please re-submit without Chinese letters.

heromyth 2006-02-21 09:24

OK, I have updated it. Addtionally, I did some modifications which has no relation with FreeBSD.

thomasdenk 2006-02-21 22:35

Got it now, thanks :)