diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-16 05:10:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-16 05:10:06 +0400 |
commit | f2cfe4b2e9212a536a880bde606eb7ce88e0e94a (patch) | |
tree | 24c985799ce09a1b6af7bf6b7b38e9f569e4a905 /intern/ghost | |
parent | 761ac8987799050c860f2b649d626aaa4258a8bd (diff) |
minor changes to ghost
- use WITH_ASSERT_ABORT define, so GHOST_ASSERT will abort.
- rename XTablet -> GHOST_TabletX11, was confusing since it was named like an xlib struct.
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_Debug.h | 17 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowX11.h | 9 |
2 files changed, 18 insertions, 8 deletions
diff --git a/intern/ghost/intern/GHOST_Debug.h b/intern/ghost/intern/GHOST_Debug.h index f0db1b3de8d..9292235a9c7 100644 --- a/intern/ghost/intern/GHOST_Debug.h +++ b/intern/ghost/intern/GHOST_Debug.h @@ -58,12 +58,23 @@ # define GHOST_PRINTF(x, ...) #endif // GHOST_DEBUG - -#ifdef GHOST_DEBUG +#ifdef WITH_ASSERT_ABORT +# include <stdio.h> //for fprintf() +# include <stdlib.h> //for abort() +# define GHOST_ASSERT(x, info) \ + { \ + if (!(x)) { \ + fprintf(stderr, "GHOST_ASSERT failed: "); \ + fprintf(stderr, info); \ + fprintf(stderr, "\n"); \ + abort(); \ + } \ + } (void)0 +#elif defined(GHOST_DEBUG) # define GHOST_ASSERT(x, info) \ { \ if (!(x)) { \ - GHOST_PRINT("assertion failed: "); \ + GHOST_PRINT("GHOST_ASSERT failed: "); \ GHOST_PRINT(info); \ GHOST_PRINT("\n"); \ } \ diff --git a/intern/ghost/intern/GHOST_WindowX11.h b/intern/ghost/intern/GHOST_WindowX11.h index 5b2ffced29c..907fac3cfab 100644 --- a/intern/ghost/intern/GHOST_WindowX11.h +++ b/intern/ghost/intern/GHOST_WindowX11.h @@ -196,9 +196,8 @@ public: getXWindow( ); #ifdef WITH_X11_XINPUT - class XTablet + typedef struct GHOST_TabletX11 { -public: GHOST_TabletData CommonData; XDevice *StylusDevice; @@ -212,9 +211,9 @@ public: int PressureLevels; int XtiltLevels, YtiltLevels; - }; + } GHOST_TabletX11; - XTablet& GetXTablet() + GHOST_TabletX11 &GetXTablet() { return m_xtablet; } @@ -388,7 +387,7 @@ private: #ifdef WITH_X11_XINPUT /* Tablet devices */ - XTablet m_xtablet; + GHOST_TabletX11 m_xtablet; #endif #if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING) |