Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
authorBob Pendleton <bob@pendleton.com>
Fri, 05 Jun 2009 23:36:00 +0000
changeset 31670c85abc61e47
parent 3166 3a63a5824557
child 3168 6338b7f2d024
Added a #ifndef SDL_NO_COMPAT around SDL_ActiveEvent and SDL_ResizeEvent so that code
that has a #defien SDL_NO_COMPAT before the #include SDL.h with not be able to use
these obsolete events.
include/SDL_events.h
     1.1 --- a/include/SDL_events.h	Fri Jun 05 07:35:06 2009 +0000
     1.2 +++ b/include/SDL_events.h	Fri Jun 05 23:36:00 2009 +0000
     1.3 @@ -313,20 +313,6 @@
     1.4      SDL_SysWMmsg *msg;  /**< driver dependent data, defined in SDL_syswm.h */
     1.5  } SDL_SysWMEvent;
     1.6  
     1.7 -/* Typedefs for backwards compatibility */
     1.8 -typedef struct SDL_ActiveEvent
     1.9 -{
    1.10 -    Uint8 type;
    1.11 -    Uint8 gain;
    1.12 -    Uint8 state;
    1.13 -} SDL_ActiveEvent;
    1.14 -typedef struct SDL_ResizeEvent
    1.15 -{
    1.16 -    Uint8 type;
    1.17 -    int w;
    1.18 -    int h;
    1.19 -} SDL_ResizeEvent;
    1.20 -
    1.21  typedef struct SDL_ProximityEvent
    1.22  {
    1.23      Uint8 type;
    1.24 @@ -336,6 +322,23 @@
    1.25      int y;
    1.26  } SDL_ProximityEvent;
    1.27  
    1.28 +/* Typedefs for backwards compatibility */
    1.29 +#ifndef SDL_NO_COMPAT
    1.30 +typedef struct SDL_ActiveEvent
    1.31 +{
    1.32 +    Uint8 type;
    1.33 +    Uint8 gain;
    1.34 +    Uint8 state;
    1.35 +} SDL_ActiveEvent;
    1.36 +
    1.37 +typedef struct SDL_ResizeEvent
    1.38 +{
    1.39 +    Uint8 type;
    1.40 +    int w;
    1.41 +    int h;
    1.42 +} SDL_ResizeEvent;
    1.43 +#endif
    1.44 +
    1.45  /**
    1.46   * \union SDL_Event
    1.47   *
    1.48 @@ -360,8 +363,10 @@
    1.49      SDL_ProximityEvent proximity;   /**< Proximity In or Out event */
    1.50  
    1.51      /* Temporarily here for backwards compatibility */
    1.52 +#ifndef SDL_NO_COMPAT
    1.53      SDL_ActiveEvent active;
    1.54      SDL_ResizeEvent resize;
    1.55 +#endif
    1.56  } SDL_Event;
    1.57  
    1.58