diff --git a/core/ctk/ctk.c b/core/ctk/ctk.c index 5edcb8985..3e45fe918 100644 --- a/core/ctk/ctk.c +++ b/core/ctk/ctk.c @@ -44,7 +44,7 @@ * * This file is part of the Contiki operating system. * - * $Id: ctk.c,v 1.23 2009/02/27 14:42:49 oliverschmidt Exp $ + * $Id: ctk.c,v 1.24 2009/02/28 10:43:30 oliverschmidt Exp $ * */ @@ -1165,6 +1165,7 @@ activate(CC_REGISTER_ARG struct ctk_widget *w) return REDRAW_NONE; } /*---------------------------------------------------------------------------*/ +#ifdef SDCC /* Dummy function that we define to keep sdcc happy - with sdcc, function pointers cannot be NULL. ctk_textentry_input is typedef'd in ctk/ctk.h, hence the strange-looking function signature. */ @@ -1173,6 +1174,7 @@ ctk_textentry_input_null(ctk_arch_key_t c, struct ctk_textentry *t) { return 0; } +#endif /* SDCC */ /*---------------------------------------------------------------------------*/ static void CC_FASTCALL textentry_input(ctk_arch_key_t c, CC_REGISTER_ARG struct ctk_textentry *t) diff --git a/core/ctk/ctk.h b/core/ctk/ctk.h index c4907eb3e..55b2fc203 100644 --- a/core/ctk/ctk.h +++ b/core/ctk/ctk.h @@ -43,7 +43,7 @@ * * This file is part of the Contiki desktop OS. * - * $Id: ctk.h,v 1.8 2009/02/25 09:01:38 adamdunkels Exp $ + * $Id: ctk.h,v 1.9 2009/02/28 10:43:30 oliverschmidt Exp $ * */ @@ -266,9 +266,15 @@ typedef unsigned char (* ctk_textentry_input)(ctk_arch_key_t c, * \param text A pointer to the buffer that should be edited. * \param len The length of the text buffer */ +#ifdef SDCC #define CTK_TEXTENTRY(x, y, w, h, text, len) \ NULL, NULL, x, y, CTK_WIDGET_TEXTENTRY, w, 1, CTK_WIDGET_FLAG_INITIALIZER(0) text, len, \ CTK_TEXTENTRY_NORMAL, 0, 0, ctk_textentry_input_null +#else /* SDCC */ +#define CTK_TEXTENTRY(x, y, w, h, text, len) \ + NULL, NULL, x, y, CTK_WIDGET_TEXTENTRY, w, 1, CTK_WIDGET_FLAG_INITIALIZER(0) text, len, \ + CTK_TEXTENTRY_NORMAL, 0, 0, NULL +#endif /* SDCC */ #define CTK_TEXTENTRY_INPUT(x, y, w, h, text, len, input) \ NULL, NULL, x, y, CTK_WIDGET_TEXTENTRY, w, h, CTK_WIDGET_FLAG_INITIALIZER(0) text, len, \ CTK_TEXTENTRY_NORMAL, 0, 0, input @@ -288,9 +294,11 @@ struct ctk_textentry { ctk_textentry_input input; }; +#ifdef SDCC /* Dummy function that we define to keep sdcc happy - with sdcc, function pointers cannot be NULL.*/ unsigned char ctk_textentry_input_null(ctk_arch_key_t c, struct ctk_textentry *t); +#endif /* SDCC */ #if CTK_CONF_ICON_BITMAPS #define CTK_ICON_BITMAP(bitmap) bitmap