#define wxMax(a,b) (((a) > (b)) ? (a) : (b))
#define wxMin(a,b) (((a) < (b)) ? (a) : (b))
+// wxGetFreeMemory can return huge amount of memory on 64-bit platforms
+// define wxMemorySize according to the type which best fits your platform
+#if wxUSE_LONGLONG && defined(__WIN64__)
+ // 64 bit Windowses have sizeof(long) only 32 bit long
+ // we need to use wxLongLong to express memory sizes
+ #define wxMemorySize wxLongLong
+#else
+ // 64 bit UNIX has sizeof(long) = 64
+ // assume 32 bit platforms cannnot return more than 32bits of
+ #define wxMemorySize long
+#endif
+
// ----------------------------------------------------------------------------
// String functions (deprecated, use wxString)
// ----------------------------------------------------------------------------
// under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill
// kills all children as well as pid
- wxEXEC_MAKE_GROUP_LEADER = 4
+ wxEXEC_MAKE_GROUP_LEADER = 4,
+
+ // by default synchronous execution disables all program windows to avoid
+ // that the user interacts with the program while the child process is
+ // running, you can use this flag to prevent this from happening
+ wxEXEC_NODISABLE = 8
};
// Execute another program.
// execute the command capturing its output into an array line by line, this is
// always synchronous
WXDLLIMPEXP_BASE long wxExecute(const wxString& command,
- wxArrayString& output);
+ wxArrayString& output,
+ int flags = 0);
// also capture stderr (also synchronous)
WXDLLIMPEXP_BASE long wxExecute(const wxString& command,
- wxArrayString& output,
- wxArrayString& error);
+ wxArrayString& output,
+ wxArrayString& error,
+ int flags = 0);
enum wxSignal
{
WXDLLIMPEXP_BASE unsigned long wxGetProcessId();
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
-WXDLLIMPEXP_BASE long wxGetFreeMemory();
+WXDLLIMPEXP_BASE wxMemorySize wxGetFreeMemory();
// should wxApp::OnFatalException() be called?
WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = true);