[Plib-cvs] plib/src/util ul.cxx,1.30,1.31 ul.h,1.55,1.56 ulClock.cxx,1.8,1.9
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2002-11-29 19:39:51
|
Update of /cvsroot/plib/plib/src/util In directory sc8-pr-cvs1:/tmp/cvs-serv26502/plib/src/util Modified Files: ul.cxx ul.h ulClock.cxx Log Message: Major rework of JS library. Cleaned up OS type flags in conditional compilations. Index: ul.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.cxx,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- ul.cxx 26 Oct 2002 19:00:56 -0000 1.30 +++ ul.cxx 29 Nov 2002 19:39:48 -0000 1.31 @@ -27,14 +27,13 @@ #include <sys/types.h> #include <sys/stat.h> -#if defined(__CYGWIN__) || !defined(WIN32) -#include <dirent.h> -#elif defined(WIN32) +#ifdef UL_MSVC #include <direct.h> +#else +#include <dirent.h> #endif [...429 lines suppressed...] pathname[1] == ':' && ( pathname[2] == SLASH[0] || pathname[2] == '/' ) ) ; -#elif defined(macintosh) +#elif defined(UL_MACINTOSH) return (pathname [0] != ':' && strchr( pathname, ':') != NULL ); -#else +#else return pathname [0] == SLASH[0] ; #endif } @@ -490,7 +525,7 @@ has enough space for 'maxlength-1' characters and a '\0'. */ -#if defined(_MSC_VER) || defined(__MINGW__) +#ifdef UL_MSVC return _getcwd ( result, maxlength ) ; #else return getcwd ( result, maxlength ) ; Index: ul.h =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.h,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- ul.h 11 Sep 2002 22:29:43 -0000 1.55 +++ ul.h 29 Nov 2002 19:39:48 -0000 1.56 @@ -44,50 +44,86 @@ #include <ctype.h> #include <assert.h> -#if !defined(WIN32) && (defined(_WIN32) || defined(__WIN32__) || \ - defined(__CYGWIN__) || defined(_MSC_VER)) -# define WIN32 +/**********************\ +* * +* Determine OS type * +* * +\**********************/ [...163 lines suppressed...] @@ -547,9 +583,8 @@ } }; -#elif defined (__APPLE__) +#elif defined (UL_MAC_OSX) -/* Mac OS X */ class ulDynamicLibrary { @@ -651,7 +686,7 @@ } } ; -#endif /* if defined(WIN32) */ +#endif class ulList Index: ulClock.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ulClock.cxx,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ulClock.cxx 2 Sep 2002 06:05:49 -0000 1.8 +++ ulClock.cxx 29 Nov 2002 19:39:48 -0000 1.9 @@ -24,46 +24,44 @@ #include <stdio.h> #include <stdlib.h> -#if defined(WIN32) -#include <windows.h> -#include <mmsystem.h> - #ifdef __CYGWIN__ +#include "ul.h" + +#ifdef UL_CYGWIN typedef long long _int64; #define LARGEINTEGER _int64 -// #include <largeint.h> - #endif #else #include <sys/time.h> #endif + #include <time.h> -#include "ul.h" +#ifdef UL_WIN32 -#if defined(WIN32) double ulClock::res ; int ulClock::perf_timer = -1; void ulClock::initPerformanceTimer () { - if( perf_timer == -1 ) { - /* Use Performance Timer if it's available, mmtimer if not. */ + if ( perf_timer == -1 ) + { + /* Use Performance Timer if it's available, mmtimer if not. */ - __int64 frequency ; + __int64 frequency ; - perf_timer = QueryPerformanceFrequency ( (LARGE_INTEGER *) & frequency ) ; + perf_timer = QueryPerformanceFrequency ( (LARGE_INTEGER *) & frequency ) ; - if ( perf_timer ) - { - res = 1.0 / (double) frequency ; - perf_timer = 1 ; - } - } + if ( perf_timer ) + { + res = 1.0 / (double) frequency ; + perf_timer = 1 ; + } + } } #endif double ulClock::getRawTime () const { -#if defined(WIN32) +#ifdef UL_WIN32 /* Use Performance Timer if it's available, mmtimer if not. */ |