Ticket #47189: include_wxmac_code_in_wxgtk.diff

File include_wxmac_code_in_wxgtk.diff, 13.0 KB (added by RJVB (René Bertin), 9 years ago)

this "hacks in" code that should have been inside #ifdef APPLE blocks...

  • src/effects/ladspa/LoadLadspa.cpp

    diff --git a/src/effects/ladspa/LoadLadspa.cpp b/src/effects/ladspa/LoadLadspa.cpp
    index 5758b1f..f15c23a 100644
    a b void LoadLadspaPlugins() 
    292292   wxGetApp().AddUniquePathToPathList(wxT(LIBDIR) wxT("/ladspa"), pathList);
    293293   #endif
    294294
    295    #ifdef __WXMAC__
     295//    #ifdef __WXMAC__
    296296   wxGetApp().AddUniquePathToPathList(wxT("~/Library/Audio/Plug-Ins/LADSPA"), pathList);
    297297   wxGetApp().AddUniquePathToPathList(wxT("/Library/Audio/Plug-Ins/LADSPA"), pathList);
    298    #endif
     298//    #endif
    299299
    300300   for(i=0; i<audacityPathList.GetCount(); i++) {
    301301      wxString prefix = audacityPathList[i] + wxFILE_SEP_PATH;
  • src/Audacity.h

    diff --git a/src/Audacity.h b/src/Audacity.h
    index 16a5fb9..9d09d96 100644
    a b void QuitAudacity(); 
    7474// platform-specific conditionals everywhere we want to check it.
    7575#define PLATFORM_MAX_PATH 260 // Play it safe for default, with same value as Windows' MAX_PATH.
    7676
    77 #ifdef __WXMAC__
     77// #ifdef __WXMAC__
    7878#include "configmac.h"
    7979#undef PLATFORM_MAX_PATH
    8080#define PLATFORM_MAX_PATH PATH_MAX
    81 #endif
    82 
    83 #ifdef __WXGTK__
    84 #include "configunix.h"
    85 // Some systems do not restrict the path length and therefore PATH_MAX is undefined
    86 #ifdef PATH_MAX
    87 #undef PLATFORM_MAX_PATH
    88 #define PLATFORM_MAX_PATH PATH_MAX
    89 #endif
    90 #endif
     81// #endif
     82
     83// #ifdef __WXGTK__
     84// #include "configunix.h"
     85// // Some systems do not restrict the path length and therefore PATH_MAX is undefined
     86// #ifdef PATH_MAX
     87// #undef PLATFORM_MAX_PATH
     88// #define PLATFORM_MAX_PATH PATH_MAX
     89// #endif
     90// #endif
    9191
    9292#ifdef __WXX11__
    9393#include "configunix.h"
  • src/AudacityApp.cpp

    diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp
    index e0277ca..78e535d 100644
    a b void AudacityApp::InitLang( const wxString & lang ) 
    938938//
    939939//     2013-09-13:  I've checked this again and it is still required.  Still
    940940//                  no idea why.
    941 #if defined(__WXMAC__)
     941// #if defined(__WXMAC__)
    942942   wxString oldval;
    943943   bool existed;
    944944
    945945   existed = wxGetEnv(wxT("LANG"), &oldval);
    946946   wxSetEnv(wxT("LANG"), wxT("en_US"));
    947 #endif
     947// #endif
    948948
    949949   mLocale = new wxLocale(wxT(""), lang, wxT(""), true, true);
    950950
    951 #if defined(__WXMAC__)
     951// #if defined(__WXMAC__)
    952952   if (existed) {
    953953      wxSetEnv(wxT("LANG"), oldval);
    954954   }
    955955   else {
    956956      wxUnsetEnv(wxT("LANG"));
    957957   }
    958 #endif
     958// #endif
    959959
    960960   for(unsigned int i=0; i<audacityPathList.GetCount(); i++)
    961961      mLocale->AddCatalogLookupPathPrefix(audacityPathList[i]);
  • src/AudioIO.cpp

    diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp
    index 1e52a39..8eab51b 100644
    a b int compareTime( const void* a, const void* b ); 
    390390//
    391391//////////////////////////////////////////////////////////////////////
    392392
     393#define __WXMAC__ 1
     394
    393395#ifdef __WXMAC__
    394396
    395397// On Mac OS X, it's better not to use the wxThread class.
  • src/DirManager.cpp

    diff --git a/src/DirManager.cpp b/src/DirManager.cpp
    index 097bfaa..1d8a5fd 100644
    a b  
    104104#include "prefs/PrefsDialog.h"
    105105#include "ondemand/ODManager.h"
    106106
     107#define __WXMAC__
     108
    107109#if defined(__WXMAC__)
    108110#include <mach/mach.h>
    109111#include <mach/vm_statistics.h>
  • src/FFmpeg.h

    diff --git a/src/FFmpeg.h b/src/FFmpeg.h
    index d277ebe..59a05eb 100644
    a b public: 
    302302   {
    303303      return (wxT("avutil-") wxT(AV_STRINGIFY(LIBAVUTIL_VERSION_MAJOR)) wxT(".dll"));
    304304   }
    305 #elif defined(__WXMAC__)
     305#elif defined(__WXMAC__) || defined(__APPLE__)
    306306   /* Library names and file filters for Mac OS only */
    307307   wxString GetLibraryTypeString()
    308308   {
  • src/FileFormats.cpp

    diff --git a/src/FileFormats.cpp b/src/FileFormats.cpp
    index bfdce00..0571922 100644
    a b wxArrayString sf_get_all_extensions() 
    237237   return exts;
    238238}
    239239
    240 #ifdef __WXMAC__
     240// #ifdef __WXMAC__
    241241
    242242// TODO: find out the appropriate OSType
    243243// for the ones with an '????'.  The others
    OSType sf_header_mactype(int format) 
    272272      return '\?\?\?\?';
    273273}
    274274
    275 #endif // __WXMAC__
     275// #endif // __WXMAC__
  • src/FileFormats.h

    diff --git a/src/FileFormats.h b/src/FileFormats.h
    index 5bab39b..7ec96ed 100644
    a b wxArrayString sf_get_all_extensions(); 
    100100// Mac OS 4-char type
    101101//
    102102
    103 #ifdef __WXMAC__
    104 # ifdef __UNIX__
     103// #ifdef __WXMAC__
     104// # ifdef __UNIX__
    105105#  include <CoreServices/CoreServices.h>
    106 # else
    107 #  include <Types.h>
    108 # endif
     106// # else
     107// #  include <Types.h>
     108// # endif
    109109
    110110OSType sf_header_mactype(int format);
    111 #endif
     111// #endif
  • src/FileIO.cpp

    diff --git a/src/FileIO.cpp b/src/FileIO.cpp
    index 9f98cb1..dc1ac3d 100644
    a b void FileIO::Close() 
    7575
    7676void FileIO::SetCatalogInfo()
    7777{
    78 #ifdef __WXMAC__
     78// #ifdef __WXMAC__
    7979   if (!mOpen ) {
    8080      return;
    8181   }
    void FileIO::SetCatalogInfo() 
    9090          (ext[3] & 0xff);
    9191
    9292   SetCatalogInfo(type);
    93 #endif
     93// #endif
    9494
    9595   return;
    9696}
  • src/Internat.h

    diff --git a/src/Internat.h b/src/Internat.h
    index 1a03060..e78e704 100644
    a b private: 
    9393// See VerifyFilename() for an explanation.
    9494#define OSINPUT(X) Internat::VerifyFilename(X, true)
    9595#define OSOUTPUT(X) Internat::VerifyFilename(X, false)
    96 #elif defined(__WXMAC__)
     96#elif 1 || defined(__WXMAC__)
    9797#define OSFILENAME(X) ((char *) (const char *)(X).fn_str())
    9898#define OSINPUT(X) OSFILENAME(X)
    9999#define OSOUTPUT(X) OSFILENAME(X)
  • src/LabelDialog.cpp

    diff --git a/src/LabelDialog.cpp b/src/LabelDialog.cpp
    index 1a251c8..34cd049 100644
    a b void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event)) 
    592592   }
    593593
    594594   wxTextFile f(fName);
    595 #ifdef __WXMAC__
     595// #ifdef __WXMAC__
    596596   wxFile *temp = new wxFile();
    597597   temp->Create(fName);
    598598   delete temp;
    599 #else
    600    f.Create();
    601 #endif
     599// #else
     600//    f.Create();
     601// #endif
    602602   f.Open();
    603603   if (!f.IsOpened()) {
    604604      wxMessageBox(_("Couldn't write to file: ") + fName);
    void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event)) 
    619619   lt->Export(f);
    620620   delete lt;
    621621
    622 #ifdef __WXMAC__
     622// #ifdef __WXMAC__
    623623   f.Write(wxTextFileType_Mac);
    624 #else
    625    f.Write();
    626 #endif
     624// #else
     625//    f.Write();
     626// #endif
    627627   f.Close();
    628628}
    629629
  • src/Prefs.cpp

    diff --git a/src/Prefs.cpp b/src/Prefs.cpp
    index 5702ca8..ee9aa40 100644
    a b  
    6565
    6666#include "sndfile.h"
    6767
    68 #ifdef __WXMAC__
     68// #ifdef __WXMAC__
    6969#include <CoreServices/CoreServices.h>
    7070
    7171/* prototype of MoreFiles fn, included in wxMac already */
    7272pascal OSErr FSpGetFullPath(const FSSpec * spec,
    7373                            short *fullPathLength, Handle * fullPath);
    74 #endif
     74// #endif
    7575
    7676#include "Prefs.h"
    7777
  • src/Project.cpp

    diff --git a/src/Project.cpp b/src/Project.cpp
    index eab0226..8a6ba11 100644
    a b scroll information. It also has some status flags. 
    8484
    8585#include <wx/arrimpl.cpp>       // this allows for creation of wxObjArray
    8686
    87 #if defined(__WXMAC__)
     87// #if defined(__WXMAC__)
    8888#include <CoreServices/CoreServices.h>
    89 #include <wx/mac/private.h>
    90 #endif
     89// #include <wx/mac/private.h>
     90// #endif
    9191
    9292#include "Project.h"
    9393
  • src/effects/Contrast.cpp

    diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp
    index c896556..358336d 100644
    a b void ContrastDialog::OnExport(wxCommandEvent & WXUNUSED(event)) 
    502502      return;
    503503
    504504   wxTextFile f(fName);
    505 #ifdef __WXMAC__
     505// #ifdef __WXMAC__
    506506   wxFile *temp = new wxFile();
    507507   temp->Create(fName);
    508508   delete temp;
    509 #else
    510    f.Create();
    511 #endif
     509// #else
     510//    f.Create();
     511// #endif
    512512   f.Open();
    513513   if (!f.IsOpened()) {
    514514      wxMessageBox(_("Couldn't write to file: ") + fName);
    void ContrastDialog::OnExport(wxCommandEvent & WXUNUSED(event)) 
    590590   f.AddLine(wxT("==================================="));
    591591   f.AddLine(wxT(""));
    592592
    593 #ifdef __WXMAC__
     593// #ifdef __WXMAC__
    594594   f.Write(wxTextFileType_Mac);
    595 #else
    596    f.Write();
    597 #endif
     595// #else
     596//    f.Write();
     597// #endif
    598598   f.Close();
    599599}
    600600
  • src/effects/nyquist/Nyquist.cpp

    diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp
    index 902c12a..a072fe9 100644
    a b void EffectNyquist::OSCallback() 
    11391139   //       doesn't seem to make much of a difference in execution time.
    11401140   //
    11411141   //       So, yielding on the Mac only...
    1142 #if defined(__WXMAC__)
     1142// #if defined(__WXMAC__)
    11431143   wxYieldIfNeeded();
    1144 #endif
     1144// #endif
    11451145}
    11461146
    11471147/**********************************************************/
  • src/export/ExportMP3.cpp

    diff --git a/src/export/ExportMP3.cpp b/src/export/ExportMP3.cpp
    index 3c998bf..094fd1f 100644
    a b wxString MP3Exporter::GetLibraryPath() 
    14431443
    14441444wxString MP3Exporter::GetLibraryName()
    14451445{
    1446    return wxT("libmp3lame.so.0");
     1446//    return wxT("libmp3lame.so.0");
     1447   return wxT("libmp3lame.0.dylib");
    14471448}
    14481449
    14491450wxString MP3Exporter::GetLibraryTypeString()
    14501451{
    1451    return wxString(_("Only libmp3lame.so.0|libmp3lame.so.0|Primary Shared Object files (*.so)|*.so|Extended Libraries (*.so*)|*.so*|All Files (*)|*"));
     1452//    return wxString(_("Only libmp3lame.so.0|libmp3lame.so.0|Primary Shared Object files (*.so)|*.so|Extended Libraries (*.so*)|*.so*|All Files (*)|*"));
     1453   return wxString(_("Only libmp3lame.0.dylib|libmp3lame.0.dylib|Primary Shared Object files (*.dylib)|*.dylib|Extended Libraries (*.dylib*)|*.dylib*|All Files (*)|*"));
    14521454}
    14531455#endif
    14541456
  • src/ondemand/ODManager.h

    diff --git a/src/ondemand/ODManager.h b/src/ondemand/ODManager.h
    index 1b23672..4ba3e1d 100644
    a b number of threads. 
    2525#include <wx/thread.h>
    2626#include <wx/wx.h>
    2727
    28 #ifdef __WXMAC__
     28#if defined(__WXMAC__) || defined(__APPLE__)
    2929// On Mac OS X, it's better not to use the wxThread class.
    3030// We use our own implementation based on pthreads instead.
    3131#include <pthread.h>
    class ODManager 
    165165   ODLock         mQueueNotEmptyCondLock;
    166166   ODCondition*   mQueueNotEmptyCond;
    167167
    168 #ifdef __WXMAC__
     168#if defined(__WXMAC__) || defined(__APPLE__)
    169169
    170170// On Mac OS X, it's better not to use the wxThread class.
    171171// We use our own implementation based on pthreads instead.
  • src/ondemand/ODTaskThread.h

    diff --git a/src/ondemand/ODTaskThread.h b/src/ondemand/ODTaskThread.h
    index 4ca5331..859c809 100644
    a b  
    2727
    2828class ODTask;
    2929
    30 #ifdef __WXMAC__
     30#if defined(__WXMAC__) || defined(__APPLE__)
    3131
    3232// On Mac OS X, it's better not to use the wxThread class.
    3333// We use our own implementation based on pthreads instead.
    class ODTaskThread { 
    5454   }
    5555   static void *callback(void *p) {
    5656      ODTaskThread *th = (ODTaskThread *)p;
    57 #if defined(__WXMAC__)
    5857      /*return (void *)*/ th->Entry();
    5958      return NULL;
    60 #else
    61       return (void *) th->Entry();
    62 #endif
    6359   }
    6460   void Run() {
    6561      pthread_create(&mThread, NULL, callback, this);
  • src/ondemand/ODTaskThread.cpp

    diff --git a/src/ondemand/ODTaskThread.cpp b/src/ondemand/ODTaskThread.cpp
    index fd92a40..df32d02 100644
    a b  
    2020#include "ODTask.h"
    2121#include "ODManager.h"
    2222
     23#define __WXMAC__
    2324
    2425ODTaskThread::ODTaskThread(ODTask* task)
    2526#ifndef __WXMAC__
  • src/prefs/RecordingPrefs.cpp

    diff --git a/src/prefs/RecordingPrefs.cpp b/src/prefs/RecordingPrefs.cpp
    index 01e3db2..eca3341 100644
    a b void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) 
    6565      S.TieCheckBox(_("Overdub: &Play other tracks while recording new one"),
    6666                    wxT("/AudioIO/Duplex"),
    6767                    true);
    68 #if defined(__WXMAC__)
     68// #if defined(__WXMAC__)
    6969      S.TieCheckBox(_("&Hardware Playthrough: Listen while recording or monitoring new track"),
    7070                    wxT("/AudioIO/Playthrough"),
    7171                    false);
    72 #endif
     72// #endif
    7373      S.TieCheckBox(_("&Software Playthrough: Listen while recording or monitoring new track"),
    7474                    wxT("/AudioIO/SWPlaythrough"),
    7575                    false);
  • lib-src/FileDialog/generic/FileDialogPrivate.cpp

    old new  
    544544   wxListItem item;
    545545   item.m_itemId = 0;
    546546   item.m_col = 0;
    547    
    548 #if (defined(__WINDOWS__) || defined(__DOS__) || defined(__WXMAC__) || defined(__OS2__)) && !defined(__WXWINCE__)
     547
     548// #if (defined(__WINDOWS__) || defined(__DOS__) || defined(__WXMAC__) || defined(__OS2__)) && !defined(__WXWINCE__)
    549549   if ( IsTopMostDir(m_dirName) )
    550550   {
    551551      wxArrayString names, paths;
    552552      wxArrayInt icons;
    553553      size_t n, count = wxGetAvailableDrives(paths, names, icons);
    554      
     554
    555555      for (n=0; n<count; n++)
    556556      {
    557557         FileData *fd = new FileData(paths[n], names[n], FileData::is_drive, icons[n]);
     
    562562      }
    563563   }
    564564   else
    565 #endif // defined(__DOS__) || defined(__WINDOWS__)
     565// #endif // defined(__DOS__) || defined(__WINDOWS__)
    566566   {
    567567      // Real directory...
    568568      if ( !IsTopMostDir(m_dirName) && !m_dirName.empty() )