1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| /* Définintions pour fonctions inline */
#ifndef CCPP_INLINE
#if defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901) || defined(__GNUC__)
#define CCPP_INLINE inline
#elif defined(_MSC_VER)
#define CCPP_INLINE __inline
#else
#define CCPP_INLINE
#endif
#endif
/* Définition pour cast: C ou C++ */
#ifndef STATIC_CAST
#ifdef __cplusplus
#define STATIC_CAST(t, x) static_cast< t >(x)
#else
#define STATIC_CAST(t, x) ((t)(x))
#endif
#endif
#ifdef GetWindowLongPtrW
//GetWindowLongPtr's are defines
#undef GetWindowLongPtrA
#undef GetWindowLongPtrW
#undef SetWindowLongPtrA
#undef SetWindowLongPtrW
static CCPP_INLINE LONG_PTR GetWindowLongPtrA(HWND hWnd, int nIndex)
{ return STATIC_CAST(LONG_PTR, GetWindowLongA(hWnd, nIndex)); }
static CCPP_INLINE LONG_PTR GetWindowLongPtrW(HWND hWnd, int nIndex)
{ return STATIC_CAST(LONG_PTR, GetWindowLongW(hWnd, nIndex)); }
static CCPP_INLINE LONG_PTR SetWindowLongPtrA(HWND hWnd, int nIndex, LONG_PTR lp)
{ return STATIC_CAST(LONG_PTR, SetWindowLongA( hWnd, nIndex, STATIC_CAST(LONG, lp) )); }
static CCPP_INLINE LONG_PTR SetWindowLongPtrW(HWND hWnd, int nIndex, LONG_PTR lp)
{ return STATIC_CAST(LONG_PTR, SetWindowLongW( hWnd, nIndex, STATIC_CAST(LONG, lp) )); }
#endif |
Partager