wxBase compilation fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		@@ -1641,20 +1641,15 @@ wxDateTime::wxDateTime_t wxDateTime::GetWeekOfMonth(wxDateTime::WeekFlags flags,
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    Tm tm = GetTm(tz);
 | 
					    Tm tm = GetTm(tz);
 | 
				
			||||||
    wxDateTime dtMonthStart = wxDateTime(1, tm.mon, tm.year);
 | 
					    wxDateTime dtMonthStart = wxDateTime(1, tm.mon, tm.year);
 | 
				
			||||||
    size_t nWeek = GetWeekOfYear(flags) - dtMonthStart.GetWeekOfYear(flags) + 1;
 | 
					    int nWeek = GetWeekOfYear(flags) - dtMonthStart.GetWeekOfYear(flags) + 1;
 | 
				
			||||||
#ifdef __VMS__ // nWeek is unsigned so avoid the warning
 | 
					 | 
				
			||||||
   int nweek2 = (int) nWeek;
 | 
					 | 
				
			||||||
   if ( nweek2 < 0 )
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
    if ( nWeek < 0 )
 | 
					    if ( nWeek < 0 )
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // this may happen for January when Jan, 1 is the last week of the
 | 
					        // this may happen for January when Jan, 1 is the last week of the
 | 
				
			||||||
        // previous year
 | 
					        // previous year
 | 
				
			||||||
        nWeek += IsLeapYear(tm.year - 1) ? 53 : 52;
 | 
					        nWeek += IsLeapYear(tm.year - 1) ? 53 : 52;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return nWeek;
 | 
					    return (wxDateTime::wxDateTime_t)nWeek;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wxDateTime& wxDateTime::SetToYearDay(wxDateTime::wxDateTime_t yday)
 | 
					wxDateTime& wxDateTime::SetToYearDay(wxDateTime::wxDateTime_t yday)
 | 
				
			||||||
@@ -3486,9 +3481,9 @@ wxDateTimeHolidayAuthority::GetHolidaysInRange(const wxDateTime& dtStart,
 | 
				
			|||||||
    holidays.Empty();
 | 
					    holidays.Empty();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    size_t count = ms_authorities.GetCount();
 | 
					    size_t count = ms_authorities.GetCount();
 | 
				
			||||||
    for ( size_t n = 0; n < count; n++ )
 | 
					    for ( size_t nAuth = 0; nAuth < count; nAuth++ )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        ms_authorities[n]->DoGetHolidaysInRange(dtStart, dtEnd, hol);
 | 
					        ms_authorities[nAuth]->DoGetHolidaysInRange(dtStart, dtEnd, hol);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        WX_APPEND_ARRAY(holidays, hol);
 | 
					        WX_APPEND_ARRAY(holidays, hol);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,7 @@
 | 
				
			|||||||
// Copyright:   (c) 1998 Guilhem Lavaux
 | 
					// Copyright:   (c) 1998 Guilhem Lavaux
 | 
				
			||||||
// Licence:     wxWindows license
 | 
					// Licence:     wxWindows license
 | 
				
			||||||
/////////////////////////////////////////////////////////////////////////////
 | 
					/////////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __GNUG__
 | 
					#ifdef __GNUG__
 | 
				
			||||||
    #pragma implementation "objstrm.h"
 | 
					    #pragma implementation "objstrm.h"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@@ -321,5 +322,5 @@ wxObject *wxObjectInputStream::LoadObject()
 | 
				
			|||||||
  return object;
 | 
					  return object;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif // wxUSE_SERIAL && wxUSE_STREAMS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -560,8 +560,14 @@ void wxGNOMEIconHandler::GetMimeInfoRecords(wxMimeTypesManagerImpl *manager)
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if wxUSE_GUI
 | 
				
			||||||
 | 
					    #define WXUNUSED_UNLESS_GUI(p)  p
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					    #define WXUNUSED_UNLESS_GUI(p)
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wxGNOMEIconHandler::GetIcon(const wxString& mimetype, wxIcon *icon)
 | 
					bool wxGNOMEIconHandler::GetIcon(const wxString& mimetype,
 | 
				
			||||||
 | 
					                                 wxIcon * WXUNUSED_UNLESS_GUI(icon))
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if ( !m_inited )
 | 
					    if ( !m_inited )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -581,8 +587,11 @@ bool wxGNOMEIconHandler::GetIcon(const wxString& mimetype, wxIcon *icon)
 | 
				
			|||||||
        icn = wxIcon(iconname);
 | 
					        icn = wxIcon(iconname);
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        icn = wxIcon(iconname, wxBITMAP_TYPE_ANY);
 | 
					        icn = wxIcon(iconname, wxBITMAP_TYPE_ANY);
 | 
				
			||||||
    if (icn.Ok()) *icon = icn;
 | 
					    if ( !icn.Ok() )
 | 
				
			||||||
    else return FALSE;
 | 
					        return FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ( icon )
 | 
				
			||||||
 | 
					        *icon = icn;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    // helpful for testing in console mode
 | 
					    // helpful for testing in console mode
 | 
				
			||||||
    wxLogDebug(_T("Found GNOME icon for '%s': '%s'\n"),
 | 
					    wxLogDebug(_T("Found GNOME icon for '%s': '%s'\n"),
 | 
				
			||||||
@@ -801,7 +810,8 @@ void wxKDEIconHandler::Init()
 | 
				
			|||||||
    m_inited = TRUE;
 | 
					    m_inited = TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wxKDEIconHandler::GetIcon(const wxString& mimetype, wxIcon *icon)
 | 
					bool wxKDEIconHandler::GetIcon(const wxString& mimetype,
 | 
				
			||||||
 | 
					                               wxIcon * WXUNUSED_UNLESS_GUI(icon))
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if ( !m_inited )
 | 
					    if ( !m_inited )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -821,8 +831,12 @@ bool wxKDEIconHandler::GetIcon(const wxString& mimetype, wxIcon *icon)
 | 
				
			|||||||
        icn = wxIcon(iconname);
 | 
					        icn = wxIcon(iconname);
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        icn = wxIcon(iconname, wxBITMAP_TYPE_ANY);
 | 
					        icn = wxIcon(iconname, wxBITMAP_TYPE_ANY);
 | 
				
			||||||
    if (icn.Ok()) *icon = icn;
 | 
					
 | 
				
			||||||
    else return FALSE;
 | 
					    if ( !icn.Ok() )
 | 
				
			||||||
 | 
					        return FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ( icon )
 | 
				
			||||||
 | 
					        *icon = icn;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    // helpful for testing in console mode
 | 
					    // helpful for testing in console mode
 | 
				
			||||||
    wxLogDebug(_T("Found KDE icon for '%s': '%s'\n"),
 | 
					    wxLogDebug(_T("Found KDE icon for '%s': '%s'\n"),
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,7 +25,9 @@
 | 
				
			|||||||
#include "wx/process.h"
 | 
					#include "wx/process.h"
 | 
				
			||||||
#include "wx/thread.h"
 | 
					#include "wx/thread.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if wxUSE_GUI
 | 
				
			||||||
    #include "wx/unix/execute.h"
 | 
					    #include "wx/unix/execute.h"
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdarg.h>
 | 
					#include <stdarg.h>
 | 
				
			||||||
#include <dirent.h>
 | 
					#include <dirent.h>
 | 
				
			||||||
@@ -212,6 +214,8 @@ bool wxShell(const wxString& command)
 | 
				
			|||||||
    return wxExecute(cmd) != 0;
 | 
					    return wxExecute(cmd) != 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if wxUSE_GUI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void wxHandleProcessTermination(wxEndProcessData *proc_data)
 | 
					void wxHandleProcessTermination(wxEndProcessData *proc_data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int pid = (proc_data->pid > 0) ? proc_data->pid : -(proc_data->pid);
 | 
					    int pid = (proc_data->pid > 0) ? proc_data->pid : -(proc_data->pid);
 | 
				
			||||||
@@ -262,7 +266,17 @@ void wxHandleProcessTermination(wxEndProcessData *proc_data)
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
long wxExecute( wxChar **argv, bool sync, wxProcess *process )
 | 
					#endif // wxUSE_GUI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if wxUSE_GUI
 | 
				
			||||||
 | 
					    #define WXUNUSED_UNLESS_GUI(p)  p
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					    #define WXUNUSED_UNLESS_GUI(p)
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					long wxExecute(wxChar **argv,
 | 
				
			||||||
 | 
					               bool sync,
 | 
				
			||||||
 | 
					               wxProcess * WXUNUSED_UNLESS_GUI(process))
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    wxCHECK_MSG( *argv, 0, wxT("can't exec empty command") );
 | 
					    wxCHECK_MSG( *argv, 0, wxT("can't exec empty command") );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -364,7 +378,6 @@ long wxExecute( wxChar **argv, bool sync, wxProcess *process )
 | 
				
			|||||||
#if wxUSE_GUI
 | 
					#if wxUSE_GUI
 | 
				
			||||||
        wxEndProcessData *data = new wxEndProcessData;
 | 
					        wxEndProcessData *data = new wxEndProcessData;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
        ARGS_CLEANUP;
 | 
					        ARGS_CLEANUP;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ( sync )
 | 
					        if ( sync )
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user