comparison mac/dw.m @ 2161:a1bf891d5990

Mac: Switch to using cross platform DW_UNUSED() macro. Remove the Mac specific __DW_UNUSED__ macro.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 29 Sep 2020 22:54:26 +0000
parents 1337859c1a20
children 8a609f6748e7
comparison
equal deleted inserted replaced
2160:07f1366a724c 2161:a1bf891d5990
16 #include <sys/un.h> 16 #include <sys/un.h>
17 #include <sys/mman.h> 17 #include <sys/mman.h>
18 #include <sys/time.h> 18 #include <sys/time.h>
19 #include <sys/stat.h> 19 #include <sys/stat.h>
20 #include <math.h> 20 #include <math.h>
21
22 /* This may move to dw.h for use on all platforms in the future */
23 #define __DW_UNUSED__ __attribute__((unused))
24 21
25 /* Create a define to let us know to include Snow Leopard specific features */ 22 /* Create a define to let us know to include Snow Leopard specific features */
26 #if defined(MAC_OS_X_VERSION_10_6) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED)) 23 #if defined(MAC_OS_X_VERSION_10_6) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED))
27 #define BUILDING_FOR_SNOW_LEOPARD 24 #define BUILDING_FOR_SNOW_LEOPARD
28 #endif 25 #endif
7151 * item: Handle of the item to be modified. 7148 * item: Handle of the item to be modified.
7152 */ 7149 */
7153 DW_FUNCTION_DEFINITION(dw_tree_get_title, char *, HWND handle, HTREEITEM item) 7150 DW_FUNCTION_DEFINITION(dw_tree_get_title, char *, HWND handle, HTREEITEM item)
7154 DW_FUNCTION_ADD_PARAM2(handle, item) 7151 DW_FUNCTION_ADD_PARAM2(handle, item)
7155 DW_FUNCTION_RETURN(dw_tree_get_title, char *) 7152 DW_FUNCTION_RETURN(dw_tree_get_title, char *)
7156 DW_FUNCTION_RESTORE_PARAM2(__DW_UNUSED__ handle, HWND, item, HTREEITEM) 7153 DW_FUNCTION_RESTORE_PARAM2(DW_UNUSED(handle), HWND, item, HTREEITEM)
7157 { 7154 {
7158 DW_FUNCTION_INIT; 7155 DW_FUNCTION_INIT;
7159 char *retval = NULL; 7156 char *retval = NULL;
7160 NSMutableArray *array = (NSMutableArray *)item; 7157 NSMutableArray *array = (NSMutableArray *)item;
7161 NSString *nstr = (NSString *)[array objectAtIndex:1]; 7158 NSString *nstr = (NSString *)[array objectAtIndex:1];
7224 * itemdata: User defined data to be associated with item. 7221 * itemdata: User defined data to be associated with item.
7225 */ 7222 */
7226 DW_FUNCTION_DEFINITION(dw_tree_item_set_data, void, HWND handle, HTREEITEM item, void *itemdata) 7223 DW_FUNCTION_DEFINITION(dw_tree_item_set_data, void, HWND handle, HTREEITEM item, void *itemdata)
7227 DW_FUNCTION_ADD_PARAM3(handle, item, itemdata) 7224 DW_FUNCTION_ADD_PARAM3(handle, item, itemdata)
7228 DW_FUNCTION_NO_RETURN(dw_tree_item_set_data) 7225 DW_FUNCTION_NO_RETURN(dw_tree_item_set_data)
7229 DW_FUNCTION_RESTORE_PARAM3(__DW_UNUSED__ handle, HWND, item, HTREEITEM, itemdata, void *) 7226 DW_FUNCTION_RESTORE_PARAM3(DW_UNUSED(handle), HWND, item, HTREEITEM, itemdata, void *)
7230 { 7227 {
7231 DW_FUNCTION_INIT; 7228 DW_FUNCTION_INIT;
7232 NSMutableArray *array = (NSMutableArray *)item; 7229 NSMutableArray *array = (NSMutableArray *)item;
7233 [array replaceObjectAtIndex:2 withObject:[NSValue valueWithPointer:itemdata]]; 7230 [array replaceObjectAtIndex:2 withObject:[NSValue valueWithPointer:itemdata]];
7234 DW_FUNCTION_RETURN_NOTHING; 7231 DW_FUNCTION_RETURN_NOTHING;
7241 * item: Handle of the item to be modified. 7238 * item: Handle of the item to be modified.
7242 */ 7239 */
7243 DW_FUNCTION_DEFINITION(dw_tree_item_get_data, void *, HWND handle, HTREEITEM item) 7240 DW_FUNCTION_DEFINITION(dw_tree_item_get_data, void *, HWND handle, HTREEITEM item)
7244 DW_FUNCTION_ADD_PARAM2(handle, item) 7241 DW_FUNCTION_ADD_PARAM2(handle, item)
7245 DW_FUNCTION_RETURN(dw_tree_item_get_data, void *) 7242 DW_FUNCTION_RETURN(dw_tree_item_get_data, void *)
7246 DW_FUNCTION_RESTORE_PARAM2(__DW_UNUSED__ handle, HWND, item, HTREEITEM) 7243 DW_FUNCTION_RESTORE_PARAM2(DW_UNUSED(handle), HWND, item, HTREEITEM)
7247 { 7244 {
7248 DW_FUNCTION_INIT; 7245 DW_FUNCTION_INIT;
7249 void *result = NULL; 7246 void *result = NULL;
7250 NSMutableArray *array = (NSMutableArray *)item; 7247 NSMutableArray *array = (NSMutableArray *)item;
7251 NSValue *value = [array objectAtIndex:2]; 7248 NSValue *value = [array objectAtIndex:2];
7376 * (this item may only be used in OS/2) 7373 * (this item may only be used in OS/2)
7377 */ 7374 */
7378 DW_FUNCTION_DEFINITION(dw_container_setup, int, HWND handle, unsigned long *flags, char **titles, int count, int separator) 7375 DW_FUNCTION_DEFINITION(dw_container_setup, int, HWND handle, unsigned long *flags, char **titles, int count, int separator)
7379 DW_FUNCTION_ADD_PARAM5(handle, flags, titles, count, separator) 7376 DW_FUNCTION_ADD_PARAM5(handle, flags, titles, count, separator)
7380 DW_FUNCTION_RETURN(dw_container_setup, int) 7377 DW_FUNCTION_RETURN(dw_container_setup, int)
7381 DW_FUNCTION_RESTORE_PARAM5(handle, HWND, flags, unsigned long *, titles, char **, count, int, __DW_UNUSED__ separator, int) 7378 DW_FUNCTION_RESTORE_PARAM5(handle, HWND, flags, unsigned long *, titles, char **, count, int, DW_UNUSED(separator), int)
7382 { 7379 {
7383 DW_FUNCTION_INIT; 7380 DW_FUNCTION_INIT;
7384 int z, retval = DW_ERROR_NONE; 7381 int z, retval = DW_ERROR_NONE;
7385 DWContainer *cont = handle; 7382 DWContainer *cont = handle;
7386 7383
7822 * rowcount: The number of rows to be inserted. 7819 * rowcount: The number of rows to be inserted.
7823 */ 7820 */
7824 DW_FUNCTION_DEFINITION(dw_container_insert, void, HWND handle, void *pointer, int rowcount) 7821 DW_FUNCTION_DEFINITION(dw_container_insert, void, HWND handle, void *pointer, int rowcount)
7825 DW_FUNCTION_ADD_PARAM3(handle, pointer, rowcount) 7822 DW_FUNCTION_ADD_PARAM3(handle, pointer, rowcount)
7826 DW_FUNCTION_NO_RETURN(dw_container_insert) 7823 DW_FUNCTION_NO_RETURN(dw_container_insert)
7827 DW_FUNCTION_RESTORE_PARAM3(handle, HWND, __DW_UNUSED__ pointer, void *, __DW_UNUSED__ rowcount, int) 7824 DW_FUNCTION_RESTORE_PARAM3(handle, HWND, DW_UNUSED(pointer), void *, DW_UNUSED(rowcount), int)
7828 { 7825 {
7829 DW_FUNCTION_INIT; 7826 DW_FUNCTION_INIT;
7830 DWContainer *cont = handle; 7827 DWContainer *cont = handle;
7831 [cont reloadData]; 7828 [cont reloadData];
7832 DW_FUNCTION_RETURN_NOTHING; 7829 DW_FUNCTION_RETURN_NOTHING;
8980 * id: An ID to be used with dw_window_from_id() or 0L. 8977 * id: An ID to be used with dw_window_from_id() or 0L.
8981 */ 8978 */
8982 DW_FUNCTION_DEFINITION(dw_html_new, HWND, ULONG cid) 8979 DW_FUNCTION_DEFINITION(dw_html_new, HWND, ULONG cid)
8983 DW_FUNCTION_ADD_PARAM1(cid) 8980 DW_FUNCTION_ADD_PARAM1(cid)
8984 DW_FUNCTION_RETURN(dw_html_new, HWND) 8981 DW_FUNCTION_RETURN(dw_html_new, HWND)
8985 DW_FUNCTION_RESTORE_PARAM1(__DW_UNUSED__ cid, ULONG) 8982 DW_FUNCTION_RESTORE_PARAM1(DW_UNUSED(cid), ULONG)
8986 { 8983 {
8987 DW_FUNCTION_INIT; 8984 DW_FUNCTION_INIT;
8988 DWWebView *web = [[DWWebView alloc] init]; 8985 DWWebView *web = [[DWWebView alloc] init];
8989 #if WK_API_ENABLED 8986 #if WK_API_ENABLED
8990 web.navigationDelegate = web; 8987 web.navigationDelegate = web;