]> git.saurik.com Git - wxWidgets.git/commitdiff
Categorized all functions and macros in the Debugging and Version categories.
authorBryan Petty <bryan@ibaku.net>
Sat, 15 Mar 2008 03:14:51 +0000 (03:14 +0000)
committerBryan Petty <bryan@ibaku.net>
Sat, 15 Mar 2008 03:14:51 +0000 (03:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52538 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/doxygen/groups/funcmacro_debug.h
docs/doxygen/groups/funcmacro_version.h
interface/debug.h
interface/defs.h
interface/link.h
interface/platform.h
interface/version.h

index 74bc4819f531e9b8a35929029435db85e0876be4..5024ec607fada9a0183f263834ec786905af705e 100644 (file)
 @ingroup group_funcmacro
 
 Useful macros and functions for error checking and defensive programming.
-wxWidgets defines three families of the assert-like macros: the wxASSERT and
-wxFAIL macros only do anything if __WXDEBUG__ is defined (in other words, in
+wxWidgets defines three families of the assert-like macros: the wxASSERT() and
+wxFAIL() macros only do anything if __WXDEBUG__ is defined (in other words, in
 the debug build) but disappear completely in the release build. On the other
-hand, the wxCHECK macros stay event in release builds but a check failure
-doesn't generate any user-visible effects then. Finally, the compile time
-assertions don't happen during the run-time but result in the compilation error
-messages if the condition they check fail.
-
-@header{wx/debug.h}
+hand, the wxCHECK() macros stay in release builds but a check failure doesn't
+generate any user-visible effects. Finally, the compile time assertions don't
+happen during the run-time but result in the compilation error messages if the
+condition they check fail.
 
 */
 
index b65fac553f15b4f63362ce75533fec60dd66a979..034c3e466a6b2ffddea634355817f3fae857d2d0 100644 (file)
@@ -32,7 +32,6 @@ The subrelease number is only used for the sources in between official releases
 and so normally is not useful.
 
 @header{wx/version.h}
-@header{wx/defs.h}
 
 */
 
index e28aadd000d535c5dbc9dfc1fca098a2a2dd7d6f..8668d880aa9ec00d1d700a426a63066290efd942 100644 (file)
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
-/**
-Will always generate an assert error if this code is reached (in debug mode).
-See also: wxFAIL_MSG()
-*/
-wxFAIL();
-
-
-/**
-This function is called whenever one of debugging macros fails (i.e. condition
-is @false in an assertion). It is only defined in the debug mode, in release
-builds the wxCHECK() failures don't result in anything.
-To override the default behaviour in the debug builds which is to show the user
-a dialog asking whether he wants to abort the program, continue or continue
-ignoring any subsequent assert failures, you may override
-wxApp::OnAssertFailure which is called by this function if
-the global application object exists.
-*/
-void wxOnAssert(const char* fileName, int lineNumber,
-                const char* func,
-                const char* cond,
-                const char* msg = NULL);
-
-/**
-    In debug mode (when @c __WXDEBUG__ is defined) this function generates a
-    debugger exception meaning that the control is passed to the debugger if one is
-    attached to the process. Otherwise the program just terminates abnormally.
-    In release mode this function does nothing.
-*/
-void wxTrap();
+/** @ingroup group_funcmacro_debug */
+//@{
 
 /**
-    Will always generate an assert error with specified message if this code is
-    reached (in debug mode).
-    This macro is useful for marking unreachable" code areas, for example
-    it may be used in the "default:" branch of a switch statement if all possible
-    cases are processed above.
+    Assert macro. An error message will be generated if the condition is @false in
+    debug mode, but nothing will be done in the release build.
+    Please note that the condition in wxASSERT() should have no side effects
+    because it will not be executed in release mode at all.
 
-    @see wxFAIL()
-*/
-#define wxFAIL_MSG(msg)     /* implementation is private */
+    @see wxASSERT_MSG(), wxCOMPILE_TIME_ASSERT()
 
-/**
-    Checks that the condition is @true, returns with the given return value if not
-    (FAILs in debug mode).
-    This check is done even in release mode.
+    @header{wx/debug.h}
 */
-#define wxCHECK(condition, retValue)     /* implementation is private */
+#define wxASSERT( condition )
 
 /**
     This macro results in a
-    @ref overview_wxcompiletimeassert "compile time assertion failure" if the size
-    of the given type @a type is less than @a size bits.
+    @ref overview_wxcompiletimeassert "compile time assertion failure" if the
+    size of the given @c type is less than @c size bits.
+
     You may use it like this, for example:
 
     @code
     // we rely on the int being able to hold values up to 2^32
-        wxASSERT_MIN_BITSIZE(int, 32);
+    wxASSERT_MIN_BITSIZE(int, 32);
 
-        // can't work with the platforms using UTF-8 for wchar_t
-        wxASSERT_MIN_BITSIZE(wchar_t, 16);
+    // can't work with the platforms using UTF-8 for wchar_t
+    wxASSERT_MIN_BITSIZE(wchar_t, 16);
     @endcode
+
+    @header{wx/debug.h}
 */
-#define wxASSERT_MIN_BITSIZE(type, size)     /* implementation is private */
+#define wxASSERT_MIN_BITSIZE( type, size )
 
 /**
-    Assert macro with message. An error message will be generated if the condition
-    is @false.
+    Assert macro with message. An error message will be generated if the
+    condition is @false.
 
     @see wxASSERT(), wxCOMPILE_TIME_ASSERT()
-*/
-#define wxASSERT_MSG(condition, msg)     /* implementation is private */
 
-/**
-    This is the same as wxCHECK2(), but
-    wxFAIL_MSG() with the specified @a msg is called
-    instead of wxFAIL() if the @a condition is @false.
+    @header{wx/debug.h}
 */
-#define wxCHECK2(condition, operation, msg)     /* implementation is private */
+#define wxASSERT_MSG( condition, message )
 
 /**
-    Assert macro. An error message will be generated if the condition is @false in
-    debug mode, but nothing will be done in the release build.
-    Please note that the condition in wxASSERT() should have no side effects
-    because it will not be executed in release mode at all.
+    Checks that the condition is @true, returns with the given return value if
+    not (stops execution in debug mode). This check is done even in release
+    mode.
 
-    @see wxASSERT_MSG(), wxCOMPILE_TIME_ASSERT()
+    @header{wx/debug.h}
 */
-#define wxASSERT(condition)     /* implementation is private */
+#define wxCHECK( condition, retValue )
 
 /**
-    Checks that the condition is @true, and returns if not (FAILs with given error
-    message in debug mode). This check is done even in release mode.
-    This macro should be used in void functions instead of
-    wxCHECK_MSG().
+    Checks that the condition is @true, returns with the given return value if
+    not (stops execution in debug mode). This check is done even in release
+    mode.
+
+    This macro may be only used in non-void functions, see also wxCHECK_RET().
+
+    @header{wx/debug.h}
 */
-#define wxCHECK_RET(condition, msg)     /* implementation is private */
+#define wxCHECK_MSG( condition, retValue, message )
 
 /**
-    Checks that the condition is @true and wxFAIL() and execute
-    @a operation if it is not. This is a generalisation of
-    wxCHECK() and may be used when something else than just
-    returning from the function must be done when the @a condition is @false.
-    This check is done even in release mode.
+    Checks that the condition is @true, and returns if not (stops execution
+    with the given error message in debug mode). This check is done even in
+    release mode.
+
+    This macro should be used in void functions instead of wxCHECK_MSG().
+
+    @header{wx/debug.h}
 */
-#define wxCHECK2(condition, operation)     /* implementation is private */
+#define wxCHECK_RET( condition, message )
 
 /**
-    This macro is identical to wxCOMPILE_TIME_ASSERT2()
-    except that it allows you to specify a unique @a name for the struct
-    internally defined by this macro to avoid getting the compilation errors
-    described above().
+    Checks that the condition is @true, and if not, it will wxFAIL() and
+    execute the given @c operation if it is not. This is a generalisation of
+    wxCHECK() and may be used when something else than just returning from the
+    function must be done when the @c condition is @false. This check is done
+    even in release mode.
+
+    @header{wx/debug.h}
 */
-#define wxCOMPILE_TIME_ASSERT(condition, msg, name)     /* implementation is private */
+#define wxCHECK2(condition, operation)
 
 /**
-    Checks that the condition is @true, returns with the given return value if not
-    (FAILs in debug mode).
-    This check is done even in release mode.
-    This macro may be only used in non-void functions, see also
-    wxCHECK_RET().
+    This is the same as wxCHECK2(), but wxFAIL_MSG() with the specified
+    @c message is called instead of wxFAIL() if the @c condition is @false.
+
+    @header{wx/debug.h}
 */
-#define wxCHECK_MSG(condition, retValue, msg)     /* implementation is private */
+#define wxCHECK2_MSG( condition, operation, message )
 
 /**
-    Using @c wxCOMPILE_TIME_ASSERT results in a compilation error if the
-    specified @a condition is @false. The compiler error message should include
-    the @a msg identifier - please note that it must be a valid C++ identifier
-    and not a string unlike in the other cases.
+    Using wxCOMPILE_TIME_ASSERT() results in a compilation error if the
+    specified @c condition is @false. The compiler error message should include
+    the @c message identifier - please note that it must be a valid C++
+    identifier and not a string unlike in the other cases.
+
     This macro is mostly useful for testing the expressions involving the
     @c sizeof operator as they can't be tested by the preprocessor but it is
     sometimes desirable to test them at the compile time.
-    Note that this macro internally declares a struct whose name it tries to make
-    unique by using the @c __LINE__ in it but it may still not work if you
+
+    Note that this macro internally declares a struct whose name it tries to
+    make unique by using the @c __LINE__ in it but it may still not work if you
     use it on the same line in two different source files. In this case you may
     either change the line in which either of them appears on or use the
     wxCOMPILE_TIME_ASSERT2() macro.
-    Also note that Microsoft Visual C++ has a bug which results in compiler errors
-    if you use this macro with 'Program Database For Edit And Continue'
-    (@c /ZI) option, so you shouldn't use it ('Program Database'
-    (@c /Zi) is ok though) for the code making use of this macro.
+
+    Also note that Microsoft Visual C++ has a bug which results in compiler
+    errors if you use this macro with 'Program Database For Edit And Continue'
+    (@c /ZI) option, so you shouldn't use it ('Program Database' (@c /Zi) is ok
+    though) for the code making use of this macro.
 
     @see wxASSERT_MSG(), wxASSERT_MIN_BITSIZE()
+
+    @header{wx/debug.h}
+*/
+#define wxCOMPILE_TIME_ASSERT( condition, message )
+
+/**
+    This macro is identical to wxCOMPILE_TIME_ASSERT() except that it allows
+    you to specify a unique @c name for the struct internally defined by this
+    macro to avoid getting the compilation errors described for
+    wxCOMPILE_TIME_ASSERT().
+
+    @header{wx/debug.h}
+*/
+#define wxCOMPILE_TIME_ASSERT2(condition, message, name)
+
+/**
+    Will always generate an assert error if this code is reached (in debug
+    mode).
+
+    @see wxFAIL_MSG()
+
+    @header{wx/debug.h}
+*/
+#define wxFAIL()
+
+/**
+    Will always generate an assert error with specified message if this code is
+    reached (in debug mode).
+
+    This macro is useful for marking unreachable" code areas, for example it
+    may be used in the "default:" branch of a switch statement if all possible
+    cases are processed above.
+
+    @see wxFAIL()
+
+    @header{wx/debug.h}
+*/
+#define wxFAIL_MSG( message )
+
+/**
+    Returns @true if the program is running under debugger, @false otherwise.
+
+    Please note that this function is currently only implemented for Win32 and
+    Mac builds using CodeWarrior and always returns @false elsewhere.
+
+    @header{wx/debug.h}
 */
-#define wxCOMPILE_TIME_ASSERT(condition, msg)     /* implementation is private */
+bool wxIsDebuggerRunning();
+
+/**
+    This function is called whenever one of debugging macros fails (i.e.
+    condition is @false in an assertion). It is only defined in the debug mode,
+    in release builds the wxCHECK() failures don't result in anything.
+
+    To override the default behaviour in the debug builds which is to show the
+    user a dialog asking whether he wants to abort the program, continue or
+    continue ignoring any subsequent assert failures, you may override
+    wxApp::OnAssertFailure() which is called by this function if the global
+    application object exists.
+
+    @header{wx/debug.h}
+*/
+void wxOnAssert( const char* fileName,
+                  int lineNumber,
+                  const char* function,
+                  const char* condition,
+                  const char* message = NULL );
+
+/**
+    In debug mode (when @c __WXDEBUG__ is defined) this function generates a
+    debugger exception meaning that the control is passed to the debugger if
+    one is attached to the process. Otherwise the program just terminates
+    abnormally. In release mode this function does nothing.
+
+    @header{wx/debug.h}
+*/
+void wxTrap();
+
+//@}
 
index 62c2f977f60be5aaba0ade4ffaab5420bcd53a6d..9aaed38e01085963c20a6c8e4a88843390d4a99b 100644 (file)
@@ -6,34 +6,68 @@
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
+/** @ingroup group_funcmacro_byteorder */
 //@{
+
 /**
-    These macros will swap the bytes of the @a value variable from little
-    endian to big endian or vice versa unconditionally, i.e. independently of the
+    This macro will swap the bytes of the @a value variable from little endian
+    to big endian or vice versa unconditionally, i.e. independently of the
     current platform.
+
+    @header{wx/defs.h}
 */
-wxInt32 wxINT32_SWAP_ALWAYS(wxInt32 value);
-wxUint32 wxUINT32_SWAP_ALWAYS(wxUint32 value);
-wxInt16 wxINT16_SWAP_ALWAYS(wxInt16 value);
-wxUint16 wxUINT16_SWAP_ALWAYS(wxUint16 value);
+#define wxINT32_SWAP_ALWAYS( wxInt32 value )
+#define wxUINT32_SWAP_ALWAYS( wxUint32 value )
+#define wxINT16_SWAP_ALWAYS( wxInt16 value )
+#define wxUINT16_SWAP_ALWAYS( wxUint16 value )
+
 //@}
 
+/** @ingroup group_funcmacro_byteorder */
+//@{
+
+/**
+    This macro will swap the bytes of the @a value variable from little endian
+    to big endian or vice versa if the program is compiled on a big-endian
+    architecture (such as Sun work stations). If the program has been compiled
+    on a little-endian architecture, the value will be unchanged.
+
+    Use these macros to read data from and write data to a file that stores
+    data in little-endian (for example Intel i386) format.
+
+    @header{wx/defs.h}
+*/
+#define wxINT32_SWAP_ON_BE( wxInt32 value )
+#define wxUINT32_SWAP_ON_BE( wxUint32 value )
+#define wxINT16_SWAP_ON_BE( wxInt16 value )
+#define wxUINT16_SWAP_ON_BE( wxUint16 value )
 
+//@}
+
+/** @ingroup group_funcmacro_byteorder */
 //@{
+
 /**
-    This macro will swap the bytes of the @a value variable from little
-    endian to big endian or vice versa if the program is compiled on a
-    little-endian architecture (such as Intel PCs). If the program has
-    been compiled on a big-endian architecture, the value will be unchanged.
+    This macro will swap the bytes of the @a value variable from little endian
+    to big endian or vice versa if the program is compiled on a little-endian
+    architecture (such as Intel PCs). If the program has been compiled on a
+    big-endian architecture, the value will be unchanged.
+
     Use these macros to read data from and write data to a file that stores
     data in big-endian format.
+
+    @header{wx/defs.h}
 */
-wxInt32 wxINT32_SWAP_ON_LE(wxInt32 value);
-wxUint32 wxUINT32_SWAP_ON_LE(wxUint32 value);
-wxInt16 wxINT16_SWAP_ON_LE(wxInt16 value);
-wxUint16 wxUINT16_SWAP_ON_LE(wxUint16 value);
+#define wxINT32_SWAP_ON_LE( wxInt32 value )
+#define wxUINT32_SWAP_ON_LE( wxUint32 value )
+#define wxINT16_SWAP_ON_LE( wxInt16 value )
+#define wxUINT16_SWAP_ON_LE( wxUint16 value )
+
 //@}
 
+
+
+
 /**
     This macro is similar to wxDEPRECATED() but can be used
     to not only declare the function @a func as deprecated but to also provide
@@ -88,21 +122,6 @@ wxUint16 wxUINT16_SWAP_ON_LE(wxUint16 value);
 */
 #define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name)     /* implementation is private */
 
-//@{
-/**
-    This macro will swap the bytes of the @a value variable from little
-    endian to big endian or vice versa if the program is compiled on a
-    big-endian architecture (such as Sun work stations). If the program has
-    been compiled on a little-endian architecture, the value will be unchanged.
-    Use these macros to read data from and write data to a file that stores
-    data in little-endian (for example Intel i386) format.
-*/
-wxInt32 wxINT32_SWAP_ON_BE(wxInt32 value);
-wxUint32 wxUINT32_SWAP_ON_BE(wxUint32 value);
-wxInt16 wxINT16_SWAP_ON_BE(wxInt16 value);
-wxUint16 wxUINT16_SWAP_ON_BE(wxUint16 value);
-//@}
-
 /**
     This macro can be used around a function declaration to generate warnings
     indicating that this function is deprecated (i.e. obsolete and planned to be
index 28f39ec619bbfbd21453cd518b5a836a48519c9c..48eb4ee357292ffb937dac8b431f54fba67ec55d 100644 (file)
@@ -6,27 +6,35 @@
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
+/** @ingroup group_funcmacro_byteorder */
+//@{
+
 /**
-This macro can be used in conjunction with the
-wxFORCE_LINK_MODULE() macro to force
-the linker to include in its output a specific object file.
-In particular, you should use this macro in the source file which you want
-to force for inclusion. The @c moduleName needs to be a name not already
-in use in other @c wxFORCE_LINK_THIS_MODULE macros, but is not required
-to be e.g. the same name of the source file (even if it's a good choice).
-*/
-#define wxFORCE_LINK_THIS_MODULE()     /* implementation is private */
+    This macro can be used in conjunction with the wxFORCE_LINK_MODULE() macro
+    to force the linker to include in its output a specific object file.
+    
+    In particular, you should use this macro in the source file which you want
+    to force for inclusion. The @c moduleName needs to be a name not already in
+    use in other wxFORCE_LINK_THIS_MODULE() macros, but is not required to be
+    e.g. the same name of the source file (even if it's a good choice).
 
+    @header{wx/link.h}
+*/
+#define wxFORCE_LINK_THIS_MODULE( moduleName )
 
 /**
-This macro can be used in conjunction with the
-wxFORCE_LINK_THIS_MODULE() macro to force
-the linker to include in its output a specific object file.
-In particular, you should use this macro in a source file which you know
-for sure is linked in the output (e.g. the source file containing the "main()"
-of your app). The @c moduleName is the name of the module you want to
-forcefully link
-(i.e. the name you used in the relative wxFORCE_LINK_THIS_MODULE() macro.
+    This macro can be used in conjunction with the wxFORCE_LINK_THIS_MODULE()
+    macro to force the linker to include in its output a specific object file.
+    
+    In particular, you should use this macro in a source file which you know
+    for sure is linked in the output (e.g. the source file containing the
+    @c main() of your app). The @c moduleName is the name of the module you
+    want to forcefully link (i.e. the name you used in the relative
+    wxFORCE_LINK_THIS_MODULE() macro.
+
+    @header{wx/link.h}
 */
-#define wxFORCE_LINK_MODULE()     /* implementation is private */
+#define wxFORCE_LINK_MODULE( moduleName )
+
+//@}
 
index 04f1831d79d45bc9b46a690b59bd6f81d3b91ff4..73ff643e010d9ab73900bb751515a79ca3311559 100644 (file)
 /**
     Returns @true if the compiler being used is GNU C++ and its version is
     at least major.minor or greater. Returns @false otherwise.
+
+    @header{wx/platform.h}
 */
 #define wxCHECK_GCC_VERSION( major, minor )
 
 /**
     Returns @true if the compiler being used is Sun CC Pro and its version is
     at least major.minor or greater. Returns @false otherwise.
+
+    @header{wx/platform.h}
 */
 #define wxCHECK_SUNCC_VERSION( major, minor )
 
 /**
     Returns @true if the compiler being used is Visual C++ and its version is
     at least major or greater. Returns @false otherwise.
+
+    @header{wx/platform.h}
 */
 #define wxCHECK_VISUALC_VERSION( major )
 
@@ -31,6 +37,8 @@
     Returns @true if the version of w32api headers used is major.minor or
     greater. Otherwise, and also if we are not compiling with MinGW32/Cygwin
     under Win32 at all, returns @false.
+
+    @header{wx/platform.h}
 */
 #define wxCHECK_W32API_VERSION( major, minor )
 
index 2fedd80c3c0b812e04484dd8bd606d723bedd42a..3ead46e5453613b891d448b05749857449d6fb40 100644 (file)
             ...
         }
     @endcode
+
+    @header{wx/version.h}
 */
 #define wxCHECK_VERSION( major, minor, release )
 
 /**
     Same as wxCHECK_VERSION() but also checks that wxSUBRELEASE_NUMBER is at
     least subrel.
+
+    @header{wx/version.h}
 */
 #define wxCHECK_VERSION_FULL( major, minor, release, subrel )