--- a/gambas/trunk/main/share/gambas.h +++ b/gambas/trunk/main/share/gambas.h @@ -66,7 +66,8 @@ #endif #if defined(__cplusplus) && !defined(__clang__) - #define __null ((intptr_t)0) + #undef NULL + #define NULL ((intptr_t)0) #else #ifdef bool #undef bool --- a/gambas/trunk/gb.sdl/src/Cmouse.cpp +++ b/gambas/trunk/gb.sdl/src/Cmouse.cpp @@ -35,7 +35,7 @@ CMOUSE_INFO CMOUSE_info = { 0 }; #define CHECK_VALID() \ - if (UNLIKELY(CMOUSE_info.valid == NULL)) \ + if (UNLIKELY(!CMOUSE_info.valid)) \ { \ GB.Error("No mouse event data"); \ return; \ --- a/gambas/trunk/gb.sdl/src/Cjoystick.cpp +++ b/gambas/trunk/gb.sdl/src/Cjoystick.cpp @@ -46,7 +46,7 @@ CJOY_INFO CJOY_info = { 0 }; #define CHECK_VALID() \ - if (UNLIKELY(CJOY_info.valid == NULL)) \ + if (UNLIKELY(!CJOY_info.valid)) \ { \ GB.Error("No joystick event data"); \ return; \ --- a/gambas/trunk/gb.qt4/src/CWidget.cpp +++ b/gambas/trunk/gb.qt4/src/CWidget.cpp @@ -2297,7 +2297,7 @@ { _post_check_hovered = true; _post_check_hovered_window = top; - GB.Post((void (*)())post_check_hovered, NULL); + GB.Post((void (*)())post_check_hovered, (intptr_t)NULL); } } @@ -2392,7 +2392,7 @@ return; _focus_change = TRUE; - GB.Post((void (*)())post_focus_change, NULL); + GB.Post((void (*)())post_focus_change, (intptr_t)NULL); } void CWIDGET_finish_focus(void) --- a/gambas/trunk/gb.qt4/src/CImage.cpp +++ b/gambas/trunk/gb.qt4/src/CImage.cpp @@ -126,7 +126,7 @@ CIMAGE *CIMAGE_create(QImage *image) { CIMAGE *img; - static GB_CLASS class_id = NULL; + static GB_CLASS class_id = 0; if (!class_id) class_id = GB.FindClass("Image"); --- a/gambas/trunk/gb.gtk/src/CImage.cpp +++ b/gambas/trunk/gb.gtk/src/CImage.cpp @@ -79,7 +79,7 @@ CIMAGE *CIMAGE_create(gPicture *image) { CIMAGE *img; - static GB_CLASS class_id = NULL; + static GB_CLASS class_id = 0; if (!class_id) class_id = GB.FindClass("Image");