comparison os2/dw.c @ 1888:0df3fc47002e

Fix build issues with last commit on OS/2... Compile error with VAC and GCC... additionally... Watcom does not support _threadstore() so currently Watcom builds will leak anchor block and message queue handles when threads terminate, looking for a fix. Also fixed a minor warning with GCC.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 09 Sep 2013 20:03:43 +0000
parents 09860ba329a4
children 0448507827e6
comparison
equal deleted inserted replaced
1887:09860ba329a4 1888:0df3fc47002e
10455 * data: Data usually returned by dw_container_query(). 10455 * data: Data usually returned by dw_container_query().
10456 */ 10456 */
10457 void API dw_container_delete_row_by_data(HWND handle, void *data) 10457 void API dw_container_delete_row_by_data(HWND handle, void *data)
10458 { 10458 {
10459 PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 10459 PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
10460 int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp"));
10461 10460
10462 while(pCore) 10461 while(pCore)
10463 { 10462 {
10464 if((void *)pCore->pszText == data) 10463 if((void *)pCore->pszText == data)
10465 { 10464 {
11920 */ 11919 */
11921 void API _dw_init_thread(void) 11920 void API _dw_init_thread(void)
11922 { 11921 {
11923 HAB thishab = WinInitialize(0); 11922 HAB thishab = WinInitialize(0);
11924 HMQ thishmq = WinCreateMsgQueue(thishab, 0); 11923 HMQ thishmq = WinCreateMsgQueue(thishab, 0);
11924 #ifndef __WATCOMC__
11925 void **threadinfo = (void **)malloc(sizeof(void *) * 2); 11925 void **threadinfo = (void **)malloc(sizeof(void *) * 2);
11926 11926
11927 threadinfo[0] = (void *)thishab; 11927 threadinfo[0] = (void *)thishab;
11928 threadinfo[1] = (void *)thishmq; 11928 threadinfo[1] = (void *)thishmq;
11929 11929
11930 _threadstore() = (void *)threadinfo; 11930 *_threadstore() = (void *)threadinfo;
11931 11931 #endif
11932
11932 #ifdef UNICODE 11933 #ifdef UNICODE
11933 /* Set the codepage to 1208 (UTF-8) */ 11934 /* Set the codepage to 1208 (UTF-8) */
11934 WinSetCp(thishmq, 1208); 11935 WinSetCp(thishmq, 1208);
11935 #endif 11936 #endif
11936 } 11937 }
11941 * However it is exported so language bindings can call it when 11942 * However it is exported so language bindings can call it when
11942 * they exit threads that require access to Dynamic Windows. 11943 * they exit threads that require access to Dynamic Windows.
11943 */ 11944 */
11944 void API _dw_deinit_thread(void) 11945 void API _dw_deinit_thread(void)
11945 { 11946 {
11946 void **threadinfo = (void **)_threadstore(); 11947 #ifndef __WATCOMC__
11948 void **threadinfo = (void **)*_threadstore();
11947 11949
11948 if(threadinfo) 11950 if(threadinfo)
11949 { 11951 {
11950 HAB thishab = (HAB)threadinfo[0]; 11952 HAB thishab = (HAB)threadinfo[0];
11951 HMQ thishmq = (HMQ)threadinfo[1]; 11953 HMQ thishmq = (HMQ)threadinfo[1];
11952 11954
11953 WinDestroyMsgQueue(thishmq); 11955 WinDestroyMsgQueue(thishmq);
11954 WinTerminate(thishab); 11956 WinTerminate(thishab);
11955 free(threadinfo); 11957 free(threadinfo);
11956 } 11958 }
11959 #endif
11957 } 11960 }
11958 11961
11959 /* 11962 /*
11960 * Encapsulate the message queues on OS/2. 11963 * Encapsulate the message queues on OS/2.
11961 */ 11964 */