From 4b651a467595490343055edef6b16f9283e501a6 Mon Sep 17 00:00:00 2001
From: Gilles Depeyrot <gilles_depeyrot@mac.com>
Date: Sat, 29 Jun 2002 16:25:18 +0000
Subject: [PATCH] rename method to prevent collision with some BSD definitions
 of macro Free() (detected compiling mahogany)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 include/wx/mac/choice.h    |  3 ++-
 include/wx/mac/listbox.h   |  3 ++-
 include/wx/mac/wave.h      |  3 ++-
 src/mac/carbon/choice.cpp  | 10 +++++-----
 src/mac/carbon/listbox.cpp |  6 +++---
 src/mac/carbon/wave.cpp    |  4 ++--
 src/mac/choice.cpp         | 10 +++++-----
 src/mac/listbox.cpp        |  6 +++---
 src/mac/wave.cpp           |  4 ++--
 9 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/include/wx/mac/choice.h b/include/wx/mac/choice.h
index 82c7a52228..f9d790df06 100644
--- a/include/wx/mac/choice.h
+++ b/include/wx/mac/choice.h
@@ -93,7 +93,8 @@ protected:
     virtual wxClientData* DoGetItemClientObject( int n ) const;
 
     // free all memory we have (used by Clear() and dtor)
-    void Free();
+    // prevent collision with some BSD definitions of macro Free()   
+    void FreeData();
 
   wxArrayString m_strings;
   wxChoiceDataArray m_datas ;
diff --git a/include/wx/mac/listbox.h b/include/wx/mac/listbox.h
index ff4be45527..e35fb87b2f 100644
--- a/include/wx/mac/listbox.h
+++ b/include/wx/mac/listbox.h
@@ -138,7 +138,8 @@ protected:
     bool HasMultipleSelection() const;
 
     // free memory (common part of Clear() and dtor)
-    void Free();
+    // prevent collision with some BSD definitions of macro Free()   
+    void FreeData();
 
     int m_noItems;
     int m_selected;
diff --git a/include/wx/mac/wave.h b/include/wx/mac/wave.h
index 0f30137a64..6f9f959b81 100644
--- a/include/wx/mac/wave.h
+++ b/include/wx/mac/wave.h
@@ -33,7 +33,8 @@ public:
   bool  Play(bool async = TRUE, bool looped = FALSE) const;
 
 protected:
-  bool  Free();
+  // prevent collision with some BSD definitions of macro Free()
+  bool  FreeData();
 
 private:
   void* m_sndChan;
diff --git a/src/mac/carbon/choice.cpp b/src/mac/carbon/choice.cpp
index f8068ff829..072badfdd2 100644
--- a/src/mac/carbon/choice.cpp
+++ b/src/mac/carbon/choice.cpp
@@ -98,18 +98,18 @@ void wxChoice::Delete(int n)
 
 void wxChoice::Clear()
 {
-    Free();
+    FreeData();
 
     for ( int i = 0 ; i < GetCount() ; i++ )
     {
     	::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , 1 ) ;
-	  }
+    }
     m_strings.Empty() ;
     m_datas.Empty() ;
-	SetControlMaximum( (ControlHandle) m_macControl , 0 ) ;
+    SetControlMaximum( (ControlHandle) m_macControl , 0 ) ;
 }
 
-void wxChoice::Free()
+void wxChoice::FreeData()
 {
     if ( HasClientObjectData() )
     {
@@ -156,7 +156,7 @@ int wxChoice::FindString(const wxString& s) const
 
 void wxChoice::SetString(int n, const wxString& s)
 {
-    wxFAIL_MSG(wxT("not implemented"));
+    wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented"));
 
 #if 0 // should do this, but no Insert() so far
     Delete(n);
diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp
index 2d9a8708d1..f4ddc539b3 100644
--- a/src/mac/carbon/listbox.cpp
+++ b/src/mac/carbon/listbox.cpp
@@ -246,7 +246,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
 
 wxListBox::~wxListBox()
 {
-    Free() ;
+    FreeData() ;
     if ( m_macList )
     {
 #if !TARGET_CARBON
@@ -257,7 +257,7 @@ wxListBox::~wxListBox()
     }
 }
 
-void wxListBox::Free()
+void wxListBox::FreeData()
 {
 #if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW )
@@ -468,7 +468,7 @@ int wxListBox::FindString(const wxString& st) const
 
 void wxListBox::Clear()
 {
-  Free();
+  FreeData();
   m_noItems = 0;
   m_stringArray.Empty() ;
   m_dataArray.Empty() ;
diff --git a/src/mac/carbon/wave.cpp b/src/mac/carbon/wave.cpp
index 7cc1c23534..01c7b9b035 100644
--- a/src/mac/carbon/wave.cpp
+++ b/src/mac/carbon/wave.cpp
@@ -38,7 +38,7 @@ wxWave::wxWave(const wxString& sFileName, bool isResource)
 
 wxWave::~wxWave()
 {
-    Free();
+    FreeData();
 }
 
 wxWave::wxWave(int size, const wxByte* data)
@@ -156,7 +156,7 @@ bool wxWave::Play(bool async, bool looped) const
 }
 
 
-bool wxWave::Free()
+bool wxWave::FreeData()
 {
 	bool ret = false;
 	
diff --git a/src/mac/choice.cpp b/src/mac/choice.cpp
index f8068ff829..072badfdd2 100644
--- a/src/mac/choice.cpp
+++ b/src/mac/choice.cpp
@@ -98,18 +98,18 @@ void wxChoice::Delete(int n)
 
 void wxChoice::Clear()
 {
-    Free();
+    FreeData();
 
     for ( int i = 0 ; i < GetCount() ; i++ )
     {
     	::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , 1 ) ;
-	  }
+    }
     m_strings.Empty() ;
     m_datas.Empty() ;
-	SetControlMaximum( (ControlHandle) m_macControl , 0 ) ;
+    SetControlMaximum( (ControlHandle) m_macControl , 0 ) ;
 }
 
-void wxChoice::Free()
+void wxChoice::FreeData()
 {
     if ( HasClientObjectData() )
     {
@@ -156,7 +156,7 @@ int wxChoice::FindString(const wxString& s) const
 
 void wxChoice::SetString(int n, const wxString& s)
 {
-    wxFAIL_MSG(wxT("not implemented"));
+    wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented"));
 
 #if 0 // should do this, but no Insert() so far
     Delete(n);
diff --git a/src/mac/listbox.cpp b/src/mac/listbox.cpp
index 2d9a8708d1..f4ddc539b3 100644
--- a/src/mac/listbox.cpp
+++ b/src/mac/listbox.cpp
@@ -246,7 +246,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
 
 wxListBox::~wxListBox()
 {
-    Free() ;
+    FreeData() ;
     if ( m_macList )
     {
 #if !TARGET_CARBON
@@ -257,7 +257,7 @@ wxListBox::~wxListBox()
     }
 }
 
-void wxListBox::Free()
+void wxListBox::FreeData()
 {
 #if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW )
@@ -468,7 +468,7 @@ int wxListBox::FindString(const wxString& st) const
 
 void wxListBox::Clear()
 {
-  Free();
+  FreeData();
   m_noItems = 0;
   m_stringArray.Empty() ;
   m_dataArray.Empty() ;
diff --git a/src/mac/wave.cpp b/src/mac/wave.cpp
index 7cc1c23534..01c7b9b035 100644
--- a/src/mac/wave.cpp
+++ b/src/mac/wave.cpp
@@ -38,7 +38,7 @@ wxWave::wxWave(const wxString& sFileName, bool isResource)
 
 wxWave::~wxWave()
 {
-    Free();
+    FreeData();
 }
 
 wxWave::wxWave(int size, const wxByte* data)
@@ -156,7 +156,7 @@ bool wxWave::Play(bool async, bool looped) const
 }
 
 
-bool wxWave::Free()
+bool wxWave::FreeData()
 {
 	bool ret = false;
 	
-- 
2.47.2