From: <laz...@us...> - 2004-03-08 20:19:57
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2834/src/core Modified Files: Array.cpp String.cpp Log Message: More dev-cpp fixes: - Do not compile with profiling enabled (lots of linker errors) - Emulate lsearch in Array Index: Array.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/Array.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Array.cpp 22 Feb 2004 11:50:15 -0000 1.5 --- Array.cpp 8 Mar 2004 19:55:23 -0000 1.6 *************** *** 45,49 **** #include <string.h> #include <stdlib.h> ! #include <search.h> // Note: For this to compile under Dev-C++ 4.9.8.x You'll need latest mingw-runtime! namespace Rtk --- 45,52 ---- #include <string.h> #include <stdlib.h> ! ! #if !defined(_RTK_CC_GCC_) || (defined(_RTK_CC_GCC_) && !defined(_RTK_WIN32_)) ! # include <search.h> ! #endif namespace Rtk *************** *** 155,159 **** --- 158,174 ---- const uchar *Array::lfind(const uchar *key, CmpFunction cmpfunc) { + #if !defined(_RTK_CC_GCC_) || (defined(_RTK_CC_GCC_) && !defined(_RTK_WIN32_)) return (const uchar *)(::lfind(key, _data, &_count, _elsize, cmpfunc)); + #else + uint cnt = _count; + register uchar *ptr = _data; + + for(uint n=0; n<cnt; n++) { + if((*cmpfunc)(key, ptr)==0) + return ptr; + ptr += _elsize; + } + return NULL; + #endif } Index: String.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/String.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** String.cpp 22 Feb 2004 10:21:29 -0000 1.3 --- String.cpp 8 Mar 2004 19:55:24 -0000 1.4 *************** *** 483,487 **** int patternLength = rstrlen(pattern); ! RCHAR *temp = rstrdup(sh ? sh->str : _R("")); RCHAR *head = temp; RCHAR *tail = rstrstr(head, pattern); --- 483,487 ---- int patternLength = rstrlen(pattern); ! RCHAR *temp = rstrdup((RCHAR*)(sh ? sh->str : _R(""))); RCHAR *head = temp; RCHAR *tail = rstrstr(head, pattern); |