From: <ped...@us...> - 2007-02-24 16:34:49
|
Revision: 903 http://svn.sourceforge.net/cegcc/?rev=903&view=rev Author: pedroalves Date: 2007-02-24 05:53:54 -0800 (Sat, 24 Feb 2007) Log Message: ----------- * include/math.h (_isnanf, _isnan): Declare. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/math.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-24 13:50:56 UTC (rev 902) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-24 13:53:54 UTC (rev 903) @@ -2,6 +2,7 @@ * mingwex/mathce/s_roundf.c (isinff, isnanf): Define on __MINGW32CE__ + * include/math.h (_isnanf, _isnan): Declare. 2007-02-07 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/include/math.h =================================================================== --- trunk/cegcc/src/mingw/include/math.h 2007-02-24 13:50:56 UTC (rev 902) +++ trunk/cegcc/src/mingw/include/math.h 2007-02-24 13:53:54 UTC (rev 903) @@ -392,6 +392,9 @@ #endif /* __i386__ */ #ifdef __COREDLL__ +extern int __cdecl _isnanf (float _x); +extern int __cdecl _isnan (double _x); + __CRT_INLINE int __cdecl _isnanl (long double _x) { int sw = fpclassify (_x); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-24 16:34:49
|
Revision: 902 http://svn.sourceforge.net/cegcc/?rev=902&view=rev Author: pedroalves Date: 2007-02-24 05:50:56 -0800 (Sat, 24 Feb 2007) Log Message: ----------- * mingwex/mathce/s_roundf.c (isinff, isnanf): Define on __MINGW32CE__ Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/mathce/s_roundf.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-13 23:23:10 UTC (rev 901) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-24 13:50:56 UTC (rev 902) @@ -1,3 +1,8 @@ +2007-02-24 Pedro Alves <ped...@po...> + + * mingwex/mathce/s_roundf.c (isinff, isnanf): Define on + __MINGW32CE__ + 2007-02-07 Pedro Alves <ped...@po...> * include/math.h: Expose __fpclassifyf, __fpclassify, Modified: trunk/cegcc/src/mingw/mingwex/mathce/s_roundf.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/s_roundf.c 2007-02-13 23:23:10 UTC (rev 901) +++ trunk/cegcc/src/mingw/mingwex/mathce/s_roundf.c 2007-02-24 13:50:56 UTC (rev 902) @@ -30,7 +30,8 @@ #include "math_private.h" #ifdef __MINGW32CE__ -#define isinff(x) isinf((float)x) +#define isinff(x) isinf(x) +#define isnanf(x) isnan(x) #endif float This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-24 16:34:52
|
Revision: 905 http://svn.sourceforge.net/cegcc/?rev=905&view=rev Author: pedroalves Date: 2007-02-24 06:40:25 -0800 (Sat, 24 Feb 2007) Log Message: ----------- * mingwex/Makefile.in (WINCE_OBJS): Add rename.o, stat.o, chmod.o, utime.o ,futime.o, timeutil.o and ctime.o. (MATHCE_OBJS): Avoid going over 80 text columns. * mingwex/wince/timeutil.c: New. * mingwex/wince/timeutil.h: New. * mingwex/wince/gmtime.c: Reimplement. * mingwex/wince/mktime.c: Likewise. * mingwex/wince/time.c: Likewise. * mingwex/wince/localtime.c: Likewise. * mingwex/wince/utime.c: New. * mingwex/wince/futime.c: New. * mingwex/wince/ctime.c: New. * mingwex/wince/stat.c: New. * include/sys/stat.h (_fstat, _chmod, _stat, fstat, chmod, stat): Expose. * include/sys/utime.h (_utime, utime, _futime): Expose. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/sys/stat.h trunk/cegcc/src/mingw/include/sys/utime.h trunk/cegcc/src/mingw/mingwex/Makefile.in trunk/cegcc/src/mingw/mingwex/wince/gmtime.c trunk/cegcc/src/mingw/mingwex/wince/localtime.c trunk/cegcc/src/mingw/mingwex/wince/mktime.c trunk/cegcc/src/mingw/mingwex/wince/time.c Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/ctime.c trunk/cegcc/src/mingw/mingwex/wince/futime.c trunk/cegcc/src/mingw/mingwex/wince/stat.c trunk/cegcc/src/mingw/mingwex/wince/timeutil.c trunk/cegcc/src/mingw/mingwex/wince/timeutil.h trunk/cegcc/src/mingw/mingwex/wince/utime.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-24 14:06:32 UTC (rev 904) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-24 14:40:25 UTC (rev 905) @@ -8,7 +8,23 @@ (_fileno, fileno): Revert to int return type. * mingwex/wince/rename.c: New. * mingwex/wince/chmod.c: New. - + * mingwex/Makefile.in (WINCE_OBJS): Add rename.o, stat.o, + chmod.o, utime.o ,futime.o, timeutil.o and ctime.o. + (MATHCE_OBJS): Avoid going over 80 text columns. + * mingwex/wince/timeutil.c: New. + * mingwex/wince/timeutil.h: New. + * mingwex/wince/gmtime.c: Reimplement. + * mingwex/wince/mktime.c: Likewise. + * mingwex/wince/time.c: Likewise. + * mingwex/wince/localtime.c: Likewise. + * mingwex/wince/utime.c: New. + * mingwex/wince/futime.c: New. + * mingwex/wince/ctime.c: New. + * mingwex/wince/stat.c: New. + * include/sys/stat.h (_fstat, _chmod, _stat, fstat, + chmod, stat): Expose. + * include/sys/utime.h (_utime, utime, _futime): Expose. + 2007-02-07 Pedro Alves <ped...@po...> * include/math.h: Expose __fpclassifyf, __fpclassify, Modified: trunk/cegcc/src/mingw/include/sys/stat.h =================================================================== --- trunk/cegcc/src/mingw/include/sys/stat.h 2007-02-24 14:06:32 UTC (rev 904) +++ trunk/cegcc/src/mingw/include/sys/stat.h 2007-02-24 14:40:25 UTC (rev 905) @@ -155,20 +155,15 @@ extern "C" { #endif -#ifndef __COREDLL__ _CRTIMP int __cdecl _fstat (int, struct _stat*); _CRTIMP int __cdecl _chmod (const char*, int); _CRTIMP int __cdecl _stat (const char*, struct _stat*); - #ifndef _NO_OLDNAMES - /* These functions live in liboldnames.a. */ _CRTIMP int __cdecl fstat (int, struct stat*); _CRTIMP int __cdecl chmod (const char*, int); _CRTIMP int __cdecl stat (const char*, struct stat*); - #endif /* Not _NO_OLDNAMES */ -#endif #if defined (__MSVCRT__) _CRTIMP int __cdecl _fstati64(int, struct _stati64 *); Modified: trunk/cegcc/src/mingw/include/sys/utime.h =================================================================== --- trunk/cegcc/src/mingw/include/sys/utime.h 2007-02-24 14:06:32 UTC (rev 904) +++ trunk/cegcc/src/mingw/include/sys/utime.h 2007-02-24 14:40:25 UTC (rev 905) @@ -52,7 +52,6 @@ extern "C" { #endif -#ifndef __COREDLL__ _CRTIMP int __cdecl _utime (const char*, struct _utimbuf*); #ifndef _NO_OLDNAMES @@ -60,7 +59,6 @@ #endif /* Not _NO_OLDNAMES */ _CRTIMP int __cdecl _futime (int, struct _utimbuf*); -#endif /* The wide character version, only available for MSVCRT versions of the * C runtime library. */ Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-24 14:06:32 UTC (rev 904) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-24 14:40:25 UTC (rev 905) @@ -213,8 +213,9 @@ asctime.o freopen.o gmtime.o localtime.o mktime.o strftime.o time.o \ tempnam.o unlink.o wcsftime.o fdopen.o read.o write.o open.o lseek.o \ close.o isalnum.o isalpha.o iscntrl.o isgraph.o islower.o isprint.o \ - ispunct.o isspace.o isupper.o isxdigit.o _tolower.o _toupper.o mb_cur_max.o - + ispunct.o isspace.o isupper.o isxdigit.o _tolower.o _toupper.o \ + mb_cur_max.o rename.o stat.o chmod.o utime.o futime.o timeutil.o \ + ctime.o MATHCE_OBJS = \ e_acosf.o e_acosh.o e_acoshf.o e_asinf.o e_atan2f.o e_atanh.o e_coshf.o \ e_expf.o e_gamma_r.o e_gammaf_r.o e_lgamma_r.o e_lgammaf_r.o e_log10f.o \ @@ -228,10 +229,9 @@ s_modff.o s_nextafterf.o s_rint.o s_rintf.o s_round.o s_roundf.o \ s_scalbn.o s_scalbnf.o s_signgam.o s_sinf.o s_tanf.o s_tanh.o s_tanhf.o \ s_trunc.o s_truncf.o w_acosf.o w_acosh.o w_acoshf.o w_asinf.o w_atan2f.o \ - w_atanh.o w_coshf.o w_expf.o w_hypotf.o w_lgamma.o w_lgammaf.o w_log2.o w_log2f.o \ - w_log10f.o w_logf.o w_powf.o w_remainder.o w_remainderf.o w_sinhf.o \ - w_tgamma.o w_tgammaf.o fpclassify.o - + w_atanh.o w_coshf.o w_expf.o w_hypotf.o w_lgamma.o w_lgammaf.o w_log2.o \ + w_log2f.o w_log10f.o w_logf.o w_powf.o w_remainder.o w_remainderf.o \ + w_sinhf.o w_tgamma.o w_tgammaf.o fpclassify.o GDTOA_OBJS = \ dmisc.o dtoa.o g__fmt.o g_dfmt.o g_ffmt.o g_xfmt.o gdtoa.o \ gethex.o gmisc.o hd_init.o hexnan.o misc.o smisc.o \ Added: trunk/cegcc/src/mingw/mingwex/wince/ctime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/ctime.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/ctime.c 2007-02-24 14:40:25 UTC (rev 905) @@ -0,0 +1,8 @@ +#include <time.h> + +char * +ctime (const time_t *t) +{ + struct tm tms = *localtime(t); + return asctime (&tms); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/ctime.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/futime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/futime.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/futime.c 2007-02-24 14:40:25 UTC (rev 905) @@ -0,0 +1,31 @@ +#include <sys/utime.h> + +#include "timeutil.h" + +int +_futime (int fildes, struct _utimbuf *times) +{ + FILETIME last_write_time; + FILETIME last_access_time; + + struct _utimbuf times_def; + + if (!times) + { + time_t curr_time; + time (&curr_time); + times_def.actime = times_def.modtime = curr_time; + times = ×_def; + } + + __time_t_to_FILETIME (times->actime, &last_access_time); + __time_t_to_FILETIME (times->modtime, &last_write_time); + + if (!SetFileTime ((HANDLE) fildes, + NULL, + &last_access_time, + &last_write_time)) + return -1; + + return 0; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/futime.c ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/cegcc/src/mingw/mingwex/wince/gmtime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/gmtime.c 2007-02-24 14:06:32 UTC (rev 904) +++ trunk/cegcc/src/mingw/mingwex/wince/gmtime.c 2007-02-24 14:40:25 UTC (rev 905) @@ -1,78 +1,14 @@ -#include <windows.h> -#include <stdio.h> -#include <time.h> +#include "timeutil.h" -static struct tm mytm; - -static const int DMonth[13] = - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; - -static const int monthCodes[12] = { 6, 2, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 }; - -static int -calc_day_of_week (const struct tm *nTM) -{ - int day; - - day = (nTM->tm_year % 100); - day += day / 4; - day += monthCodes[nTM->tm_mon]; - day += nTM->tm_mday; - while (day >= 7) - day -= 7; - - return day; -} - struct tm * -gmtime (const time_t * timer) +gmtime(const time_t *t) { - unsigned long x = *timer; - int imin, ihrs, iday, iyrs; - int sec, min, hrs, day, mon, yrs; - int lday, qday, jday, mday; - - imin = x / 60; // whole minutes since 1/1/70 - sec = x - (60 * imin); // leftover seconds - ihrs = imin / 60; // whole hours since 1/1/70 - min = imin - 60 * ihrs; // leftover minutes - iday = ihrs / 24; // whole days since 1/1/70 - hrs = ihrs - 24 * iday; // leftover hours - iday = iday + 365 + 366; // whole days since 1/1/68 - lday = iday / ((4 * 365) + 1); // quadyr = 4 yr period = 1461 days - qday = iday % ((4 * 365) + 1); // days since current quadyr began - if (qday >= (31 + 29)) // if past feb 29 then - lday = lday + 1; // add this quadyr\x92s leap day to the - // # of quadyrs (leap days) since 68 - iyrs = (iday - lday) / 365; // whole years since 1968 - jday = iday - (iyrs * 365) - lday; // days since 1 /1 of current year. - if (qday <= 365 && qday >= 60) // if past 2/29 and a leap year then - jday = jday + 1; // add a leap day to the # of whole - // days since 1/1 of current year - yrs = iyrs + 1968; // compute year - mon = 13; // estimate month ( +1) - mday = 366; // max days since 1/1 is 365 - while (jday < mday) // mday = # of days passed from 1/1 - { // until first day of current month - mon = mon - 1; // mon = month (estimated) - mday = DMonth[mon]; // # elapsed days at first of mon - if ((mon > 2) && (yrs % 4) == 0) // if past 2/29 and leap year then - mday = mday + 1; // add leap day - // compute month by decrementing - } // month until found - - day = jday - mday + 1; // compute day of month - - mytm.tm_sec = sec; - mytm.tm_min = min; - mytm.tm_hour = hrs; - mytm.tm_mday = day; - mytm.tm_mon = mon; - mytm.tm_year = yrs - 1900; - - mytm.tm_wday = calc_day_of_week (&mytm); - mytm.tm_yday = jday; - mytm.tm_isdst = 0; - - return &mytm; + FILETIME f; + SYSTEMTIME s; + static struct tm tms; + + __time_t_to_FILETIME (*t, &f); + FileTimeToSystemTime (&f, &s); + __SYSTEMTIME_to_tm (&s, &tms); + return &tms; } Modified: trunk/cegcc/src/mingw/mingwex/wince/localtime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/localtime.c 2007-02-24 14:06:32 UTC (rev 904) +++ trunk/cegcc/src/mingw/mingwex/wince/localtime.c 2007-02-24 14:40:25 UTC (rev 905) @@ -1,7 +1,27 @@ -#include <time.h> +#include "timeutil.h" struct tm * -localtime (const time_t * timer) +localtime(const time_t *timer) { - return gmtime (timer); + SYSTEMTIME ss, ls, s; + FILETIME sf, lf, f; + long long t, diff; + + static struct tm tms; + + GetSystemTime (&ss); + GetLocalTime (&ls); + + SystemTimeToFileTime (&ss, &sf); + SystemTimeToFileTime (&ls, &lf); + + diff = __FILETIME_to_ll (&sf) - __FILETIME_to_ll (&lf); + + __time_t_to_FILETIME (*timer, &f); + t = __FILETIME_to_ll (&f) - diff; + __ll_to_FILETIME (t, &f); + FileTimeToSystemTime (&f, &s); + __SYSTEMTIME_to_tm (&s, &tms); + + return &tms; } Modified: trunk/cegcc/src/mingw/mingwex/wince/mktime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/mktime.c 2007-02-24 14:06:32 UTC (rev 904) +++ trunk/cegcc/src/mingw/mingwex/wince/mktime.c 2007-02-24 14:40:25 UTC (rev 905) @@ -1,38 +1,21 @@ -#include <windows.h> -#include <stdio.h> -#include <time.h> +#include "timeutil.h" -static const int month_to_day[12] = - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; - time_t -mktime (struct tm *t) +mktime (struct tm *pt) { - short month, year; - time_t result; + SYSTEMTIME ss, ls, s; + FILETIME sf, lf, f; + long long diff; - month = t->tm_mon; - year = t->tm_year + month / 12 + 1900; - month %= 12; - if (month < 0) - { - year -= 1; - month += 12; - } - result = (year - 1970) * 365 + (year - 1969) / 4 + month_to_day[month]; - result = (year - 1970) * 365 + month_to_day[month]; - if (month <= 1) - year -= 1; - result += (year - 1968) / 4; - result -= (year - 1900) / 100; - result += (year - 1600) / 400; - result += t->tm_mday; - result -= 1; - result *= 24; - result += t->tm_hour; - result *= 60; - result += t->tm_min; - result *= 60; - result += t->tm_sec; - return (result); + GetSystemTime (&ss); + GetLocalTime (&ls); + SystemTimeToFileTime (&ss, &sf); + SystemTimeToFileTime (&ls, &lf); + + diff = __FILETIME_to_ll (&lf) - __FILETIME_to_ll (&sf); + diff /= _onesec_in100ns; + + __tm_to_SYSTEMTIME (pt, &s); + SystemTimeToFileTime (&s, &f); + return __FILETIME_to_time_t (&f) - (time_t)diff; } Added: trunk/cegcc/src/mingw/mingwex/wince/stat.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/stat.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/stat.c 2007-02-24 14:40:25 UTC (rev 905) @@ -0,0 +1,139 @@ +/* + * stat.c: _stat, stat and fstat implementations for WinCE. + * + * This file has no copyright assigned and is placed in the Public Domain. + * This file is a part of the mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within the package. + * + * Written by Pedro Alves <ped...@po...> 10 Feb 2007 + * + */ + +#include <windows.h> +#include <time.h> +#include <fcntl.h> +#include <io.h> +#include <sys/stat.h> +#include <stdio.h> + +#include "timeutil.h" + +struct stat_file_info_t +{ + DWORD dwFileAttributes; + FILETIME ftLastWriteTime; + FILETIME ftCreationTime; + FILETIME ftLastAccessTime; + DWORD nFileSizeLow; +}; + +#define COPY_MEMBER(DEST, SRC, MEMBER) \ +do { \ + (DEST)->MEMBER = (SRC)->MEMBER; \ +} while (0) + +#define TO_STAT_FILE_INFO(DEST, SRC) \ +do { \ + COPY_MEMBER (DEST, SRC, dwFileAttributes); \ + COPY_MEMBER (DEST, SRC, ftLastWriteTime); \ + COPY_MEMBER (DEST, SRC, ftCreationTime); \ + COPY_MEMBER (DEST, SRC, ftLastAccessTime); \ + COPY_MEMBER (DEST, SRC, nFileSizeLow); \ +} while (0) + +static int +__stat_by_file_info (struct stat_file_info_t *fi, struct stat* st, int exec) +{ + int permission = _S_IREAD; + + memset (st, 0, sizeof (*st)); + + st->st_size = fi->nFileSizeLow; + st->st_mode = _S_IFREG; + + if((fi->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) + st->st_mode |= _S_IFDIR | _S_IEXEC; + else if (exec) + permission |= _S_IEXEC; + + if((fi->dwFileAttributes & FILE_ATTRIBUTE_READONLY) == 0) + permission |= _S_IWRITE; + + st->st_mode |= permission | (permission >> 3) | (permission >> 6); + + st->st_nlink = 1; /* always 1? */ + st->st_rdev = 1; /* Where to get drive info? */ + st->st_ino = 0; /* always 0 on Windows */ + + st->st_mtime = __FILETIME_to_time_t (&fi->ftLastWriteTime); + st->st_ctime = __FILETIME_to_time_t (&fi->ftCreationTime); + st->st_atime = __FILETIME_to_time_t (&fi->ftLastAccessTime); + + /* Looks like the code below is never triggered. + Windows CE always only keeps the LastWriteTime, and + copies it to the CreationTime and LastAccessTime fields. */ + if (st->st_ctime == 0) + st->st_ctime = st->st_mtime; + if (st->st_atime == 0) + { + /* On XP, at least, the st_atime is always set to the same + as the st_mtime, except the hour/min/sec == 00:00:00. */ + SYSTEMTIME s; + FILETIME f = fi->ftLastWriteTime; + FileTimeToSystemTime (&f, &s); + s.wHour = 0; s.wMinute = 0; + s.wSecond = 0; s.wMilliseconds = 0; + SystemTimeToFileTime (&s, &f); + st->st_atime = __FILETIME_to_time_t (&f); + /* st->st_atime = st->st_mtime; */ + } + return 0; +} + +int +fstat (int fd, struct stat *st) +{ + BY_HANDLE_FILE_INFORMATION fi; + struct stat_file_info_t sfi; + + GetFileInformationByHandle ((HANDLE)fd, &fi); + TO_STAT_FILE_INFO (&sfi, &fi); + return __stat_by_file_info (&sfi, st, 0); +} + +int +_stat (const char *path, struct _stat *st) +{ + WIN32_FIND_DATAW fd; + HANDLE h; + int ret; + struct stat_file_info_t sfi; + wchar_t pathw[MAX_PATH + 1]; + size_t len; + int exec; + + mbstowcs (pathw, path, MAX_PATH); + if((h = FindFirstFileW (pathw, &fd)) == INVALID_HANDLE_VALUE) + { + DWORD dwError = GetLastError (); + if(dwError == ERROR_NO_MORE_FILES) + /* Convert error to something more sensible. */ + SetLastError (ERROR_FILE_NOT_FOUND); + return -1; + } + + TO_STAT_FILE_INFO (&sfi, &fd); + + len = strlen (path); + exec = (len >= 4 + && strcasecmp (path + len - 4, ".exe") == 0); + ret = __stat_by_file_info (&sfi, (struct stat*)st, exec); + FindClose (h); + return ret; +} + +int +stat (const char *path, struct stat *st) +{ + return _stat (path, (struct _stat *)st); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/stat.c ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/cegcc/src/mingw/mingwex/wince/time.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/time.c 2007-02-24 14:06:32 UTC (rev 904) +++ trunk/cegcc/src/mingw/mingwex/wince/time.c 2007-02-24 14:40:25 UTC (rev 905) @@ -1,27 +1,16 @@ -#include <time.h> -#include <windows.h> +#include "timeutil.h" time_t -time (time_t * timer) +time (time_t *timer) { - SYSTEMTIME systime; - struct tm tmtime; - time_t tt; + SYSTEMTIME s; + FILETIME f; - GetLocalTime (&systime); + if (timer == NULL) + return 0; - tmtime.tm_year = systime.wYear - 1900; - tmtime.tm_mon = systime.wMonth - 1; - tmtime.tm_mday = systime.wDay; - tmtime.tm_wday = systime.wDayOfWeek; - tmtime.tm_hour = systime.wHour; - tmtime.tm_min = systime.wMinute; - tmtime.tm_sec = systime.wSecond; - - tt = mktime (&tmtime); - - if (timer) - *timer = tt; - - return tt; + GetSystemTime (&s); + SystemTimeToFileTime (&s, &f); + *timer = __FILETIME_to_time_t (&f); + return *timer; } Added: trunk/cegcc/src/mingw/mingwex/wince/timeutil.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/timeutil.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/timeutil.c 2007-02-24 14:40:25 UTC (rev 905) @@ -0,0 +1,110 @@ +#include "timeutil.h" + +/* Originally based on code found in the Ruby WinCE support, which + had the following notice: */ + +/* start original header */ + +/*************************************************************** + time.c + + author : uema2 + date : Nov 30, 2002 + + You can freely use, copy, modify, and redistribute + the whole contents. +***************************************************************/ + +/* end original header */ + +/* Note: The original filename was: wince/time_wce.c */ + +/* Adapted to mingw32ce by Pedro Alves <ped...@po...> + 10 Feb 2007 - Initial revision. */ + +#define DELTA_EPOCH 116444736000000000LL + +#if 0 +how_to_calc_delta_epoch () +{ + FILETIME f1601, f1970; + __FILETIME_from_Year (1601, &f1601); + __FILETIME_from_Year (1970, &f1970); + DELTA_EPOCH = __FILETIME_to_ll (&f1970) - __FILETIME_to_ll (&f1601); +} +#endif + +void +__tm_to_SYSTEMTIME (struct tm *t, SYSTEMTIME *s) +{ + s->wYear = t->tm_year + 1900; + s->wMonth = t->tm_mon + 1; + s->wDayOfWeek = t->tm_wday; + s->wDay = t->tm_mday; + s->wHour = t->tm_hour; + s->wMinute = t->tm_min; + s->wSecond = t->tm_sec; + s->wMilliseconds = 0; +} + +static void +__FILETIME_from_Year (WORD year, FILETIME *f) +{ + SYSTEMTIME s = {0}; + + s.wYear = year; + s.wMonth = 1; + s.wDayOfWeek = 1; + s.wDay = 1; + + SystemTimeToFileTime (&s, f); +} + +static int +__Yday_from_SYSTEMTIME (const SYSTEMTIME *s) +{ + long long t; + FILETIME f1, f2; + + __FILETIME_from_Year (s->wYear, &f1); + SystemTimeToFileTime (s, &f2); + + t = __FILETIME_to_ll (&f2) - __FILETIME_to_ll (&f1); + + return ((t / _onesec_in100ns) / (60 * 60 * 24)); +} + +void +__SYSTEMTIME_to_tm (SYSTEMTIME *s, struct tm *tm) +{ + tm->tm_year = s->wYear - 1900; + tm->tm_mon = s->wMonth- 1; + tm->tm_wday = s->wDayOfWeek; + tm->tm_mday = s->wDay; + tm->tm_yday = __Yday_from_SYSTEMTIME (s); + tm->tm_hour = s->wHour; + tm->tm_min = s->wMinute; + tm->tm_sec = s->wSecond; + tm->tm_isdst = 0; +} + +time_t +__FILETIME_to_time_t (const FILETIME* f) +{ + long long t; + t = __FILETIME_to_ll (f); + t -= DELTA_EPOCH; + return (time_t)(t / _onesec_in100ns); +} + +void +__time_t_to_FILETIME (time_t t, FILETIME *f) +{ + long long time; + + time = t; + time *= _onesec_in100ns; + time += DELTA_EPOCH; + + __ll_to_FILETIME (time, f); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/timeutil.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/timeutil.h =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/timeutil.h (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/timeutil.h 2007-02-24 14:40:25 UTC (rev 905) @@ -0,0 +1,30 @@ +#ifndef __TIMEUTIL_H +#define __TIMEUTIL_H + +#include <windows.h> +#include <sys/time.h> + +#define _onesec_in100ns 10000000LL + +__CRT_INLINE long long +__FILETIME_to_ll (const FILETIME *f) +{ + long long t; + t = (long long)f->dwHighDateTime << 32; + t |= f->dwLowDateTime; + return t; +} + +__CRT_INLINE void +__ll_to_FILETIME (long long t, FILETIME* f) +{ + f->dwHighDateTime = (DWORD)((t >> 32) & 0x00000000FFFFFFFF); + f->dwLowDateTime = (DWORD)(t & 0x00000000FFFFFFFF); +} + +extern void __tm_to_SYSTEMTIME (struct tm *, SYSTEMTIME *); +extern void __SYSTEMTIME_to_tm (SYSTEMTIME *, struct tm *); +extern time_t __FILETIME_to_time_t (const FILETIME *); +extern void __time_t_to_FILETIME (time_t, FILETIME *); + +#endif Property changes on: trunk/cegcc/src/mingw/mingwex/wince/timeutil.h ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/utime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/utime.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/utime.c 2007-02-24 14:40:25 UTC (rev 905) @@ -0,0 +1,22 @@ +#include <sys/utime.h> +#include <fcntl.h> + +int +utime (const char *path, struct utimbuf *times) +{ + int retval; + int fildes = open (path, _O_RDWR); + if (fildes == -1) + return -1; + + retval = _futime (fildes, (struct _utimbuf*)times); + + close (fildes); + return retval; +} + +int +_utime (const char *fname, struct _utimbuf *times) +{ + return utime (fname, (struct utimbuf *)times); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/utime.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-24 16:38:09
|
Revision: 904 http://svn.sourceforge.net/cegcc/?rev=904&view=rev Author: pedroalves Date: 2007-02-24 06:06:32 -0800 (Sat, 24 Feb 2007) Log Message: ----------- * include/io.h (rename): Expose. * include/stdio.h (rename): Expose. (_fileno, fileno): Revert to int return type. * mingwex/wince/rename.c: New. * mingwex/wince/chmod.c: New. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/io.h trunk/cegcc/src/mingw/include/stdio.h Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/chmod.c trunk/cegcc/src/mingw/mingwex/wince/rename.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-24 13:53:54 UTC (rev 903) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-24 14:06:32 UTC (rev 904) @@ -3,6 +3,11 @@ * mingwex/mathce/s_roundf.c (isinff, isnanf): Define on __MINGW32CE__ * include/math.h (_isnanf, _isnan): Declare. + * include/io.h (rename): Expose. + * include/stdio.h (rename): Expose. + (_fileno, fileno): Revert to int return type. + * mingwex/wince/rename.c: New. + * mingwex/wince/chmod.c: New. 2007-02-07 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/include/io.h =================================================================== --- trunk/cegcc/src/mingw/include/io.h 2007-02-24 13:53:54 UTC (rev 903) +++ trunk/cegcc/src/mingw/include/io.h 2007-02-24 14:06:32 UTC (rev 904) @@ -247,8 +247,9 @@ /* MS puts remove & rename (but not wide versions) in io.h as well as in stdio.h. */ _CRTIMP int __cdecl remove (const char*); +#endif _CRTIMP int __cdecl rename (const char*, const char*); - +#ifndef __COREDLL__ /* SH_... flags for nShFlags defined in share.h * Optional fourth argument is unsigned unPermissions */ _CRTIMP int __cdecl _sopen (const char*, int, int, ...); Modified: trunk/cegcc/src/mingw/include/stdio.h =================================================================== --- trunk/cegcc/src/mingw/include/stdio.h 2007-02-24 13:53:54 UTC (rev 903) +++ trunk/cegcc/src/mingw/include/stdio.h 2007-02-24 14:06:32 UTC (rev 904) @@ -194,7 +194,9 @@ #ifndef __COREDLL__ /* MS puts remove & rename (but not wide versions) in io.h also */ _CRTIMP int __cdecl remove (const char*); +#endif _CRTIMP int __cdecl rename (const char*, const char*); +#ifndef __COREDLL__ _CRTIMP FILE* __cdecl tmpfile (void); _CRTIMP char* __cdecl tmpnam (char*); #endif /* __COREDLL__ */ @@ -423,9 +425,15 @@ _CRTIMP FILE* __cdecl _fdopen (int, const char*); #ifndef __COREDLL__ _CRTIMP FILE* __cdecl _fsopen(const char*, const char*, int); +#endif +#ifdef __COREDLL__ +/* We know the Microsoft defines _fileno as returning + a void* (HANDLE), but that is so anoying, that we + define it as returning int, which is ok on arm (32-bit). +_CRTIMP void* __cdecl _fileno (FILE*); */ _CRTIMP int __cdecl _fileno (FILE*); #else -_CRTIMP void* __cdecl _fileno (FILE*); +_CRTIMP int __cdecl _fileno (FILE*); #endif _CRTIMP int __cdecl _fcloseall(void); #ifdef __MSVCRT__ @@ -445,7 +453,11 @@ _CRTIMP int __cdecl fputchar (int); _CRTIMP int __cdecl fileno (FILE*); #else -_CRTIMP void* __cdecl fileno (FILE*); +/* We know the Microsoft defines _fileno as returning + a void* (HANDLE), but that is so anoying, that we + define it as returning int, which is ok on arm (32-bit). +_CRTIMP void* __cdecl fileno (FILE*); */ +_CRTIMP int __cdecl fileno (FILE*); #endif #endif /* Not _NO_OLDNAMES */ Added: trunk/cegcc/src/mingw/mingwex/wince/chmod.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/chmod.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/chmod.c 2007-02-24 14:06:32 UTC (rev 904) @@ -0,0 +1,27 @@ +#include <wchar.h> +#include <windows.h> +#include <io.h> +#include <sys/stat.h> + +int +chmod (const char *path, int mode) +{ + wchar_t pathw[MAX_PATH + 1]; + DWORD attr; + + mbstowcs (pathw, path, MAX_PATH); + + /* This is racy, but it is the best we can do. */ + + attr = GetFileAttributes (pathw); + if(attr == 0xffffffff) + return -1; + + if((mode & _S_IWRITE) != 0) + attr &= ~FILE_ATTRIBUTE_READONLY; + else + attr |= FILE_ATTRIBUTE_READONLY; + + SetFileAttributes (pathw, attr); + return 0; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/chmod.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/rename.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/rename.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/rename.c 2007-02-24 14:06:32 UTC (rev 904) @@ -0,0 +1,16 @@ +#include <windows.h> + +/* We return an error if the TO file already exists, + like the Windows NT/9x 'rename' does. */ + +int +rename (const char* from, const char* to) +{ + wchar_t fromw[MAX_PATH + 1]; + wchar_t tow[MAX_PATH + 1]; + mbstowcs (fromw, from, MAX_PATH); + mbstowcs (tow, to, MAX_PATH); + if (MoveFileW (fromw, tow)) + return 0; + return -1; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/rename.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-24 16:38:36
|
Revision: 906 http://svn.sourceforge.net/cegcc/?rev=906&view=rev Author: pedroalves Date: 2007-02-24 08:38:32 -0800 (Sat, 24 Feb 2007) Log Message: ----------- * mingwex/Makefile.in (STDIO_OBJS_CE): New. (LIB_OBJS): Add STDIO_OBJS_CE. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/Makefile.in Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-24 14:40:25 UTC (rev 905) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-24 16:38:32 UTC (rev 906) @@ -1,5 +1,10 @@ 2007-02-24 Pedro Alves <ped...@po...> + * mingwex/Makefile.in (STDIO_OBJS_CE): New. + (LIB_OBJS): Add STDIO_OBJS_CE. + +2007-02-24 Pedro Alves <ped...@po...> + * mingwex/mathce/s_roundf.c (isinff, isnanf): Define on __MINGW32CE__ * include/math.h (_isnanf, _isnan): Declare. Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-24 14:40:25 UTC (rev 905) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-24 16:38:32 UTC (rev 906) @@ -162,6 +162,8 @@ fopen64.o fseeko64.o ftello64.o lseek64.o \ snprintf.o vsnprintf.o snwprintf.o vsnwprintf.o \ vfscanf.o vfwscanf.o vscanf.o vsscanf.o vswscanf.o vwscanf.o +STDIO_OBJS_CE = \ + snprintf.o vsnprintf.o snwprintf.o vsnwprintf.o MATH_OBJS = \ acosf.o acosl.o asinf.o asinl.o atan2f.o atan2l.o \ atanf.o atanl.o cbrt.o cbrtf.o cbrtl.o ceilf.o ceill.o \ @@ -239,7 +241,7 @@ MATHCE_FLAGS= ifneq (,$(findstring wince,$(target_alias))) -LIB_OBJS = $(WINCE_OBJS) $(MATHCE_OBJS) $(Q8_OBJS) +LIB_OBJS = $(WINCE_OBJS) $(MATHCE_OBJS) $(Q8_OBJS) $(STDIO_OBJS_CE) MATHCE_FLAGS=-D_IEEE_LIBM MATHDIR=mathce else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-24 16:42:25
|
Revision: 907 http://svn.sourceforge.net/cegcc/?rev=907&view=rev Author: pedroalves Date: 2007-02-24 08:42:23 -0800 (Sat, 24 Feb 2007) Log Message: ----------- * include/stdio.h (perror): Expose. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/stdio.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-24 16:38:32 UTC (rev 906) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-24 16:42:23 UTC (rev 907) @@ -2,6 +2,7 @@ * mingwex/Makefile.in (STDIO_OBJS_CE): New. (LIB_OBJS): Add STDIO_OBJS_CE. + * include/stdio.h (perror): Expose. 2007-02-24 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/include/stdio.h =================================================================== --- trunk/cegcc/src/mingw/include/stdio.h 2007-02-24 16:38:32 UTC (rev 906) +++ trunk/cegcc/src/mingw/include/stdio.h 2007-02-24 16:42:23 UTC (rev 907) @@ -397,9 +397,7 @@ #endif _CRTIMP void __cdecl clearerr (FILE*); -#ifndef __COREDLL__ _CRTIMP void __cdecl perror (const char*); -#endif #ifndef __STRICT_ANSI__ #ifndef __COREDLL__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-04 00:29:16
|
Revision: 875 http://svn.sourceforge.net/cegcc/?rev=875&view=rev Author: pedroalves Date: 2007-02-03 16:29:15 -0800 (Sat, 03 Feb 2007) Log Message: ----------- * mingwex/Makefile.in (MATHCE_DISTFILES): New variable. (MATHCE_OBJS): New variable. (MATHCE_FLAGS): New variable. (ALL_CFLAGS, ALL_CXXFLAGS): Use MATHCE_FLAGS. (LIB_OBJS): Add $(MATHCE_OBJS). (MATHDIR): New variable. (VPATH): Add $(MATHDIR). (dist): Handle $(MATHCE_DISTFILES). * mingwex/mathce: New dir. * mingwex/mathce/{e_acosf.c, e_acosh.c, e_acoshf.c, e_asinf.c, e_atan2f.c, e_atanh.c, e_coshf.c, e_expf.c, e_gamma_r.c, e_gammaf_r.c, e_lgamma_r.c, e_lgammaf_r.c, e_log10f.c, e_logf.c, e_powf.c, e_rem_pio2.c, e_rem_pio2f.c, e_remainder.c, e_remainderf.c, e_sinhf.c, fdlibm.h, ieee.h, k_cos.c, k_cosf.c, k_rem_pio2.c, k_rem_pio2f.c, k_sin.c, k_sinf.c, k_tan.c, k_tanf.c, llround.c, llroundf.c, lround.c, lroundf.c, math_private.h, s_asinh.c, s_asinhf.c, s_atanf.c, s_cbrt.c, s_cbrtf.c, s_copysignf.c, s_cosf.c, s_erf.c, s_erff.c, s_expm1.c, s_expm1f.c, s_frexpf.c, s_ilogb.c, s_ilogbf.c, s_isinf.c, s_isinff.c, s_ldexpf.c, s_llrint.c, s_llrintf.c, s_log1p.c, s_log1pf.c, s_logbf.c, s_lrint.c, s_lrintf.c, s_modff.c, s_nextafterf.c, s_rint.c, s_rintf.c, s_round.c, s_roundf.c, s_scalbn.c, s_scalbnf.c, s_signgam.c, s_sinf.c, s_tanf.c, s_tanh.c, s_tanhf.c, s_trunc.c, s_truncf.c, w_acosf.c, w_acosh.c, w_acoshf.c, w_asinf.c, w_atan2f.c, w_atanh.c, w_coshf.c, w_expf.c, w_hypotf.c, w_lgamma.c, w_lgammaf.c, w_log10f.c, w_log2.c, w_log2f.c, w_logf.c, w_powf.c, w_remainder.c, w_remainderf.c, w_sinhf.c, w_tgamma.c, w_tgammaf.c}: New files. * include/math.h (_matherr): Hide on __COREDLL__. Guard i387 only inline functions with __i386__. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/math.h trunk/cegcc/src/mingw/mingwex/Makefile.in Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/mathce/ trunk/cegcc/src/mingw/mingwex/mathce/e_acosf.c trunk/cegcc/src/mingw/mingwex/mathce/e_acosh.c trunk/cegcc/src/mingw/mingwex/mathce/e_acoshf.c trunk/cegcc/src/mingw/mingwex/mathce/e_asinf.c trunk/cegcc/src/mingw/mingwex/mathce/e_atan2f.c trunk/cegcc/src/mingw/mingwex/mathce/e_atanh.c trunk/cegcc/src/mingw/mingwex/mathce/e_coshf.c trunk/cegcc/src/mingw/mingwex/mathce/e_expf.c trunk/cegcc/src/mingw/mingwex/mathce/e_gamma_r.c trunk/cegcc/src/mingw/mingwex/mathce/e_gammaf_r.c trunk/cegcc/src/mingw/mingwex/mathce/e_lgamma_r.c trunk/cegcc/src/mingw/mingwex/mathce/e_lgammaf_r.c trunk/cegcc/src/mingw/mingwex/mathce/e_log10f.c trunk/cegcc/src/mingw/mingwex/mathce/e_logf.c trunk/cegcc/src/mingw/mingwex/mathce/e_powf.c trunk/cegcc/src/mingw/mingwex/mathce/e_rem_pio2.c trunk/cegcc/src/mingw/mingwex/mathce/e_rem_pio2f.c trunk/cegcc/src/mingw/mingwex/mathce/e_remainder.c trunk/cegcc/src/mingw/mingwex/mathce/e_remainderf.c trunk/cegcc/src/mingw/mingwex/mathce/e_sinhf.c trunk/cegcc/src/mingw/mingwex/mathce/fdlibm.h trunk/cegcc/src/mingw/mingwex/mathce/files.txt trunk/cegcc/src/mingw/mingwex/mathce/ieee.h trunk/cegcc/src/mingw/mingwex/mathce/k_cos.c trunk/cegcc/src/mingw/mingwex/mathce/k_cosf.c trunk/cegcc/src/mingw/mingwex/mathce/k_rem_pio2.c trunk/cegcc/src/mingw/mingwex/mathce/k_rem_pio2f.c trunk/cegcc/src/mingw/mingwex/mathce/k_sin.c trunk/cegcc/src/mingw/mingwex/mathce/k_sinf.c trunk/cegcc/src/mingw/mingwex/mathce/k_tan.c trunk/cegcc/src/mingw/mingwex/mathce/k_tanf.c trunk/cegcc/src/mingw/mingwex/mathce/llround.c trunk/cegcc/src/mingw/mingwex/mathce/llroundf.c trunk/cegcc/src/mingw/mingwex/mathce/lround.c trunk/cegcc/src/mingw/mingwex/mathce/lroundf.c trunk/cegcc/src/mingw/mingwex/mathce/math_private.h trunk/cegcc/src/mingw/mingwex/mathce/s_asinh.c trunk/cegcc/src/mingw/mingwex/mathce/s_asinhf.c trunk/cegcc/src/mingw/mingwex/mathce/s_atanf.c trunk/cegcc/src/mingw/mingwex/mathce/s_cbrt.c trunk/cegcc/src/mingw/mingwex/mathce/s_cbrtf.c trunk/cegcc/src/mingw/mingwex/mathce/s_copysignf.c trunk/cegcc/src/mingw/mingwex/mathce/s_cosf.c trunk/cegcc/src/mingw/mingwex/mathce/s_erf.c trunk/cegcc/src/mingw/mingwex/mathce/s_erff.c trunk/cegcc/src/mingw/mingwex/mathce/s_expm1.c trunk/cegcc/src/mingw/mingwex/mathce/s_expm1f.c trunk/cegcc/src/mingw/mingwex/mathce/s_frexpf.c trunk/cegcc/src/mingw/mingwex/mathce/s_ilogb.c trunk/cegcc/src/mingw/mingwex/mathce/s_ilogbf.c trunk/cegcc/src/mingw/mingwex/mathce/s_isinf.c trunk/cegcc/src/mingw/mingwex/mathce/s_isinff.c trunk/cegcc/src/mingw/mingwex/mathce/s_ldexpf.c trunk/cegcc/src/mingw/mingwex/mathce/s_llrint.c trunk/cegcc/src/mingw/mingwex/mathce/s_llrintf.c trunk/cegcc/src/mingw/mingwex/mathce/s_log1p.c trunk/cegcc/src/mingw/mingwex/mathce/s_log1pf.c trunk/cegcc/src/mingw/mingwex/mathce/s_logbf.c trunk/cegcc/src/mingw/mingwex/mathce/s_lrint.c trunk/cegcc/src/mingw/mingwex/mathce/s_lrintf.c trunk/cegcc/src/mingw/mingwex/mathce/s_modff.c trunk/cegcc/src/mingw/mingwex/mathce/s_nextafterf.c trunk/cegcc/src/mingw/mingwex/mathce/s_rint.c trunk/cegcc/src/mingw/mingwex/mathce/s_rintf.c trunk/cegcc/src/mingw/mingwex/mathce/s_round.c trunk/cegcc/src/mingw/mingwex/mathce/s_roundf.c trunk/cegcc/src/mingw/mingwex/mathce/s_scalbn.c trunk/cegcc/src/mingw/mingwex/mathce/s_scalbnf.c trunk/cegcc/src/mingw/mingwex/mathce/s_signgam.c trunk/cegcc/src/mingw/mingwex/mathce/s_sinf.c trunk/cegcc/src/mingw/mingwex/mathce/s_tanf.c trunk/cegcc/src/mingw/mingwex/mathce/s_tanh.c trunk/cegcc/src/mingw/mingwex/mathce/s_tanhf.c trunk/cegcc/src/mingw/mingwex/mathce/s_trunc.c trunk/cegcc/src/mingw/mingwex/mathce/s_truncf.c trunk/cegcc/src/mingw/mingwex/mathce/w_acosf.c trunk/cegcc/src/mingw/mingwex/mathce/w_acosh.c trunk/cegcc/src/mingw/mingwex/mathce/w_acoshf.c trunk/cegcc/src/mingw/mingwex/mathce/w_asinf.c trunk/cegcc/src/mingw/mingwex/mathce/w_atan2f.c trunk/cegcc/src/mingw/mingwex/mathce/w_atanh.c trunk/cegcc/src/mingw/mingwex/mathce/w_coshf.c trunk/cegcc/src/mingw/mingwex/mathce/w_expf.c trunk/cegcc/src/mingw/mingwex/mathce/w_hypotf.c trunk/cegcc/src/mingw/mingwex/mathce/w_lgamma.c trunk/cegcc/src/mingw/mingwex/mathce/w_lgammaf.c trunk/cegcc/src/mingw/mingwex/mathce/w_log10f.c trunk/cegcc/src/mingw/mingwex/mathce/w_log2.c trunk/cegcc/src/mingw/mingwex/mathce/w_log2f.c trunk/cegcc/src/mingw/mingwex/mathce/w_logf.c trunk/cegcc/src/mingw/mingwex/mathce/w_powf.c trunk/cegcc/src/mingw/mingwex/mathce/w_remainder.c trunk/cegcc/src/mingw/mingwex/mathce/w_remainderf.c trunk/cegcc/src/mingw/mingwex/mathce/w_sinhf.c trunk/cegcc/src/mingw/mingwex/mathce/w_tgamma.c trunk/cegcc/src/mingw/mingwex/mathce/w_tgammaf.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-03 23:44:45 UTC (rev 874) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-04 00:29:15 UTC (rev 875) @@ -1,3 +1,35 @@ +2007-02-04 Pedro Alves <ped...@po...> + + * mingwex/Makefile.in (MATHCE_DISTFILES): New variable. + (MATHCE_OBJS): New variable. + (MATHCE_FLAGS): New variable. + (ALL_CFLAGS, ALL_CXXFLAGS): Use MATHCE_FLAGS. + (LIB_OBJS): Add $(MATHCE_OBJS). + (MATHDIR): New variable. + (VPATH): Add $(MATHDIR). + (dist): Handle $(MATHCE_DISTFILES). + * mingwex/mathce: New dir. + * mingwex/mathce/{e_acosf.c, e_acosh.c, e_acoshf.c, e_asinf.c, + e_atan2f.c, e_atanh.c, e_coshf.c, e_expf.c, e_gamma_r.c, + e_gammaf_r.c, e_lgamma_r.c, e_lgammaf_r.c, e_log10f.c, e_logf.c, + e_powf.c, e_rem_pio2.c, e_rem_pio2f.c, e_remainder.c, + e_remainderf.c, e_sinhf.c, fdlibm.h, ieee.h, k_cos.c, k_cosf.c, + k_rem_pio2.c, k_rem_pio2f.c, k_sin.c, k_sinf.c, k_tan.c, k_tanf.c, + llround.c, llroundf.c, lround.c, lroundf.c, math_private.h, + s_asinh.c, s_asinhf.c, s_atanf.c, s_cbrt.c, s_cbrtf.c, + s_copysignf.c, s_cosf.c, s_erf.c, s_erff.c, s_expm1.c, s_expm1f.c, + s_frexpf.c, s_ilogb.c, s_ilogbf.c, s_isinf.c, s_isinff.c, s_ldexpf.c, + s_llrint.c, s_llrintf.c, s_log1p.c, s_log1pf.c, s_logbf.c, s_lrint.c, + s_lrintf.c, s_modff.c, s_nextafterf.c, s_rint.c, s_rintf.c, + s_round.c, s_roundf.c, s_scalbn.c, s_scalbnf.c, s_signgam.c, + s_sinf.c, s_tanf.c, s_tanh.c, s_tanhf.c, s_trunc.c, s_truncf.c, + w_acosf.c, w_acosh.c, w_acoshf.c, w_asinf.c, w_atan2f.c, w_atanh.c, + w_coshf.c, w_expf.c, w_hypotf.c, w_lgamma.c, w_lgammaf.c, w_log10f.c, + w_log2.c, w_log2f.c, w_logf.c, w_powf.c, w_remainder.c, + w_remainderf.c, w_sinhf.c, w_tgamma.c, w_tgammaf.c}: New files. + * include/math.h (_matherr): Hide on __COREDLL__. + Guard i387 only inline functions with __i386__. + 2007-02-03 Pedro Alves <ped...@po...> * dllmain.c: Fix typo. Modified: trunk/cegcc/src/mingw/include/math.h =================================================================== --- trunk/cegcc/src/mingw/include/math.h 2007-02-03 23:44:45 UTC (rev 874) +++ trunk/cegcc/src/mingw/include/math.h 2007-02-04 00:29:15 UTC (rev 875) @@ -222,7 +222,9 @@ _CRTIMP double __cdecl _y0 (double); _CRTIMP double __cdecl _y1 (double); _CRTIMP double __cdecl _yn (int, double); +#ifndef __COREDLL__ _CRTIMP int __cdecl _matherr (struct _exception *); +#endif /* These are also declared in Mingw float.h; needed here as well to work around GCC build issues. */ @@ -305,6 +307,9 @@ #endif /* __MINGW_GNUC_PREREQ(3, 3) */ /* 7.12.3.1 */ + +#ifdef __i386__ + /* Return values for fpclassify. These are based on Intel x87 fpu condition codes @@ -345,10 +350,18 @@ /* 7.12.3.3 */ #define isinf(x) (fpclassify(x) == FP_INFINITE) +#else + +extern int isfinite (double x); +extern int isinf (double x); + +#endif + /* 7.12.3.4 */ -/* We don't need to worry about trucation here: +/* We don't need to worry about truncation here: A NaN stays a NaN. */ +#ifdef __i386__ __CRT_INLINE int __cdecl __isnan (double _x) { unsigned short sw; @@ -381,9 +394,15 @@ : sizeof (x) == sizeof (double) ? __isnan (x) \ : __isnanl (x)) +#else +extern int isnan (double x); +extern int isnanf (float x); +#endif + /* 7.12.3.5 */ #define isnormal(x) (fpclassify(x) == FP_NORMAL) +#ifdef __i386__ /* 7.12.3.6 The signbit macro */ __CRT_INLINE int __cdecl __signbit (double x) { unsigned short stw; @@ -406,6 +425,7 @@ #define signbit(x) (sizeof (x) == sizeof (float) ? __signbitf (x) \ : sizeof (x) == sizeof (double) ? __signbit (x) \ : __signbitl (x)) +#endif /* 7.12.4 Trigonometric functions: Double in C89 */ extern float __cdecl sinf (float); @@ -517,7 +537,7 @@ /* Inline versions. GCC-4.0+ can do a better fast-math optimization with __builtins. */ -#if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) +#if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) && defined __i386__ __CRT_INLINE double __cdecl logb (double x) { double res; @@ -541,7 +561,7 @@ "fstp %%st" : "=t" (res) : "0" (x)); return res; } -#endif /* !defined __FAST_MATH__ || !__MINGW_GNUC_PREREQ (4, 0) */ +#endif /* !defined __FAST_MATH__ || !__MINGW_GNUC_PREREQ (4, 0) && __i386__ */ /* 7.12.6.12 Double in C89 */ extern float __cdecl modff (float, float*); @@ -631,7 +651,7 @@ /* Inline versions of above. GCC 4.0+ can do a better fast-math job with __builtins. */ -#if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) +#if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) && defined __i386__ __CRT_INLINE double __cdecl rint (double x) { double retval; @@ -700,7 +720,7 @@ ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); return retval; } -#endif /* !__FAST_MATH__ || !__MINGW_GNUC_PREREQ (4,0) */ +#endif /* !__FAST_MATH__ || !__MINGW_GNUC_PREREQ (4,0) && __i386__ */ /* 7.12.9.6 */ /* round away from zero, regardless of fpu control word settings */ Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-03 23:44:45 UTC (rev 874) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-04 00:29:15 UTC (rev 875) @@ -4,7 +4,6 @@ # This makefile requires GNU make. srcdir = @srcdir@ -VPATH = $(srcdir):$(srcdir)/math:$(srcdir)/stdio:$(srcdir)/complex:$(srcdir)/wince objdir = . target_alias = @target_alias@ @@ -89,6 +88,23 @@ close.c isalnum.c isalpha.c iscntrl.c isgraph.c islower.c isprint.c \ ispunct.c isspace.c isupper.c isxdigit.c _tolower.c _toupper.c +MATHCE_DISTFILES = \ + e_acosf.c e_acosh.c e_acoshf.c e_asinf.c e_atan2f.c e_atanh.c e_coshf.c \ + e_expf.c e_gamma_r.c e_gammaf_r.c e_lgamma_r.c e_lgammaf_r.c e_log10f.c \ + e_logf.c e_powf.c e_rem_pio2.c e_rem_pio2f.c e_remainder.c \ + e_remainderf.c e_sinhf.c k_cos.c k_cosf.c k_rem_pio2.c k_rem_pio2f.c \ + k_sin.c k_sinf.c k_tan.c k_tanf.c llround.c llroundf.c \ + lround.c lroundf.c s_asinh.c s_asinhf.c s_atanf.c s_cbrt.c s_cbrtf.c \ + s_copysignf.c s_cosf.c s_erf.c s_erff.c s_expm1.c s_expm1f.c s_frexpf.c \ + s_ilogb.c s_ilogbf.c s_isinf.c s_isinff.c s_ldexpf.c s_llrint.c \ + s_llrintf.c s_log1p.c s_log1pf.c s_logbf.c s_lrint.c s_lrintf.c \ + s_modff.c s_nextafterf.c s_rint.c s_rintf.c s_round.c s_roundf.c \ + s_scalbn.c s_scalbnf.c s_signgam.c s_sinf.c s_tanf.c s_tanh.c s_tanhf.c \ + s_trunc.c s_truncf.c w_acosf.c w_acosh.c w_acoshf.c w_asinf.c w_atan2f.c \ + w_atanh.c w_coshf.c w_expf.c w_hypotf.c w_lgamma.c w_lgammaf.c w_log2.c w_log2f.c \ + w_log10f.c w_logf.c w_powf.c w_remainder.c w_remainderf.c w_sinhf.c \ + w_tgamma.c w_tgammaf.c + CC = @CC@ # FIXME: Which is it, CC or CC_FOR_TARGET? CC_FOR_TARGET = $(CC) @@ -104,8 +120,8 @@ INCLUDES = -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../include \ -nostdinc \ -iwithprefixbefore include -ALL_CFLAGS = $(CFLAGS) $(OPTFLAGS) $(W32API_INCLUDE) $(INCLUDES) $(MNO_CYGWIN) -ALL_CXXFLAGS = $(CXXFLAGS) $(OPTFLAGS) $(W32API_INCLUDE) $(INCLUDES) -nostdinc++ $(MNO_CYGWIN) +ALL_CFLAGS = $(CFLAGS) $(OPTFLAGS) $(W32API_INCLUDE) $(INCLUDES) $(MNO_CYGWIN) $(MATHCE_FLAGS) +ALL_CXXFLAGS = $(CXXFLAGS) $(OPTFLAGS) $(W32API_INCLUDE) $(INCLUDES) -nostdinc++ $(MNO_CYGWIN) $(MATHCE_FLAGS) AS = @AS@ AR = @AR@ @@ -190,16 +206,37 @@ tempnam.o unlink.o wcsftime.o fdopen.o read.o write.o open.o lseek.o \ close.o isalnum.o isalpha.o iscntrl.o isgraph.o islower.o isprint.o \ ispunct.o isspace.o isupper.o isxdigit.o _tolower.o _toupper.o +MATHCE_OBJS = \ + e_acosf.o e_acosh.o e_acoshf.o e_asinf.o e_atan2f.o e_atanh.o e_coshf.o \ + e_expf.o e_gamma_r.o e_gammaf_r.o e_lgamma_r.o e_lgammaf_r.o e_log10f.o \ + e_logf.o e_powf.o e_rem_pio2.o e_rem_pio2f.o e_remainder.o \ + e_remainderf.o e_sinhf.o k_cos.o k_cosf.o k_rem_pio2.o k_rem_pio2f.o \ + k_sin.o k_sinf.o k_tan.o k_tanf.o llround.o llroundf.o \ + lround.o lroundf.o s_asinh.o s_asinhf.o s_atanf.o s_cbrt.o s_cbrtf.o \ + s_copysignf.o s_cosf.o s_erf.o s_erff.o s_expm1.o s_expm1f.o s_frexpf.o \ + s_ilogb.o s_ilogbf.o s_isinf.o s_isinff.o s_ldexpf.o s_llrint.o \ + s_llrintf.o s_log1p.o s_log1pf.o s_logbf.o s_lrint.o s_lrintf.o \ + s_modff.o s_nextafterf.o s_rint.o s_rintf.o s_round.o s_roundf.o \ + s_scalbn.o s_scalbnf.o s_signgam.o s_sinf.o s_tanf.o s_tanh.o s_tanhf.o \ + s_trunc.o s_truncf.o w_acosf.o w_acosh.o w_acoshf.o w_asinf.o w_atan2f.o \ + w_atanh.o w_coshf.o w_expf.o w_hypotf.o w_lgamma.o w_lgammaf.o w_log2.o w_log2f.o \ + w_log10f.o w_logf.o w_powf.o w_remainder.o w_remainderf.o w_sinhf.o \ + w_tgamma.o w_tgammaf.o - +MATHCE_FLAGS= ifneq (,$(findstring wince,$(target_alias))) -LIB_OBJS = $(WINCE_OBJS) +LIB_OBJS = $(WINCE_OBJS) $(MATHCE_OBJS) +MATHCE_FLAGS=-D_IEEE_LIBM +MATHDIR=mathce else LIB_OBJS = $(Q8_OBJS) $(CTYPE_OBJS) $(STDLIB_OBJS) $(STDLIB_STUB_OBJS) \ $(STDIO_OBJS) $(MATH_OBJS) $(FENV_OBJS) \ $(POSIX_OBJS) $(REPLACE_OBJS) $(COMPLEX_OBJS) +MATHDIR=math endif +VPATH = $(srcdir):$(srcdir)/stdio:$(srcdir)/complex:$(srcdir)/wince:$(srcdir)/$(MATHDIR) + LIBS = $(LIBMINGWEX_A) DLLS = @@ -282,4 +319,8 @@ @for i in $(WINCE_DISTFILES); do\ cp -p $(srcdir)/wince/$$i $(distdir)/mingwex/wince/$$i ; \ done - + mkdir $(distdir)/mingwex/mathce + chmod 755 $(distdir)/mingwex/mathce + @for i in $(MATHCE_DISTFILES); do\ + cp -p $(srcdir)/mathce/$$i $(distdir)/mingwex/mathce/$$i ; \ + done Added: trunk/cegcc/src/mingw/mingwex/mathce/e_acosf.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_acosf.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_acosf.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,85 @@ +/* e_acosf.c -- float version of e_acos.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ia...@cy.... + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: e_acosf.c,v 1.5 1995/05/12 04:57:16 jtc Exp $"; +#endif + +#include "math.h" +#include "math_private.h" + +static const float +one = 1.0000000000e+00, /* 0x3F800000 */ +pi = 3.1415925026e+00, /* 0x40490fda */ +pio2_hi = 1.5707962513e+00, /* 0x3fc90fda */ +pio2_lo = 7.5497894159e-08, /* 0x33a22168 */ +pS0 = 1.6666667163e-01, /* 0x3e2aaaab */ +pS1 = -3.2556581497e-01, /* 0xbea6b090 */ +pS2 = 2.0121252537e-01, /* 0x3e4e0aa8 */ +pS3 = -4.0055535734e-02, /* 0xbd241146 */ +pS4 = 7.9153501429e-04, /* 0x3a4f7f04 */ +pS5 = 3.4793309169e-05, /* 0x3811ef08 */ +qS1 = -2.4033949375e+00, /* 0xc019d139 */ +qS2 = 2.0209457874e+00, /* 0x4001572d */ +qS3 = -6.8828397989e-01, /* 0xbf303361 */ +qS4 = 7.7038154006e-02; /* 0x3d9dc62e */ + +#ifdef __MINGW32CE__ +#define __ieee754_sqrtf sqrtf +#endif + +float +__ieee754_acosf(float x) +{ + float z,p,q,r,w,s,c,df; + int32_t hx,ix; + GET_FLOAT_WORD(hx,x); + ix = hx&0x7fffffff; + if(ix==0x3f800000) { /* |x|==1 */ + if(hx>0) return 0.0; /* acos(1) = 0 */ + else return pi+(float)2.0*pio2_lo; /* acos(-1)= pi */ + } else if(ix>0x3f800000) { /* |x| >= 1 */ + return (x-x)/(x-x); /* acos(|x|>1) is NaN */ + } + if(ix<0x3f000000) { /* |x| < 0.5 */ + if(ix<=0x23000000) return pio2_hi+pio2_lo;/*if|x|<2**-57*/ + z = x*x; + p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5))))); + q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4))); + r = p/q; + return pio2_hi - (x - (pio2_lo-x*r)); + } else if (hx<0) { /* x < -0.5 */ + z = (one+x)*(float)0.5; + p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5))))); + q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4))); + s = __ieee754_sqrtf(z); + r = p/q; + w = r*s-pio2_lo; + return pi - (float)2.0*(s+w); + } else { /* x > 0.5 */ + int32_t idf; + z = (one-x)*(float)0.5; + s = __ieee754_sqrtf(z); + df = s; + GET_FLOAT_WORD(idf,df); + SET_FLOAT_WORD(df,idf&0xfffff000); + c = (z-df*df)/(s+df); + p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5))))); + q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4))); + r = p/q; + w = r*s+c; + return (float)2.0*(df+w); + } +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/e_acosf.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/e_acosh.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_acosh.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_acosh.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,66 @@ +/* @(#)e_acosh.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: e_acosh.c,v 1.9 1995/05/12 04:57:18 jtc Exp $"; +#endif + +/* __ieee754_acosh(x) + * Method : + * Based on + * acosh(x) = log [ x + sqrt(x*x-1) ] + * we have + * acosh(x) := log(x)+ln2, if x is large; else + * acosh(x) := log(2x-1/(sqrt(x*x-1)+x)) if x>2; else + * acosh(x) := log1p(t+sqrt(2.0*t+t*t)); where t=x-1. + * + * Special cases: + * acosh(x) is NaN with signal if x<1. + * acosh(NaN) is NaN without signal. + */ + +#include "math.h" +#include "math_private.h" + +static const double +one = 1.0, +ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */ + +#ifdef __MINGW32CE__ +#define __ieee754_log log +#define __ieee754_sqrt sqrt +#endif + +double +__ieee754_acosh(double x) +{ + double t; + int32_t hx; + u_int32_t lx; + EXTRACT_WORDS(hx,lx,x); + if(hx<0x3ff00000) { /* x < 1 */ + return (x-x)/(x-x); + } else if(hx >=0x41b00000) { /* x > 2**28 */ + if(hx >=0x7ff00000) { /* x is inf of NaN */ + return x+x; + } else + return __ieee754_log(x)+ln2; /* acosh(huge)=log(2x) */ + } else if(((hx-0x3ff00000)|lx)==0) { + return 0.0; /* acosh(1) = 0 */ + } else if (hx > 0x40000000) { /* 2**28 > x > 2 */ + t=x*x; + return __ieee754_log(2.0*x-one/(x+__ieee754_sqrt(t-one))); + } else { /* 1<x<2 */ + t = x-one; + return log1p(t+sqrt(2.0*t+t*t)); + } +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/e_acosh.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/e_acoshf.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_acoshf.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_acoshf.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,53 @@ +/* e_acoshf.c -- float version of e_acosh.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ia...@cy.... + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: e_acoshf.c,v 1.5 1995/05/12 04:57:20 jtc Exp $"; +#endif + +#include "math.h" +#include "math_private.h" + +static const float +one = 1.0, +ln2 = 6.9314718246e-01; /* 0x3f317218 */ + +#ifdef __MINGW32CE__ +#define __ieee754_sqrtf sqrtf +#endif + +float +__ieee754_acoshf(float x) +{ + float t; + int32_t hx; + GET_FLOAT_WORD(hx,x); + if(hx<0x3f800000) { /* x < 1 */ + return (x-x)/(x-x); + } else if(hx >=0x4d800000) { /* x > 2**28 */ + if(hx >=0x7f800000) { /* x is inf of NaN */ + return x+x; + } else + return __ieee754_logf(x)+ln2; /* acosh(huge)=log(2x) */ + } else if (hx==0x3f800000) { + return 0.0; /* acosh(1) = 0 */ + } else if (hx > 0x40000000) { /* 2**28 > x > 2 */ + t=x*x; + return __ieee754_logf((float)2.0*x-one/(x+__ieee754_sqrtf(t-one))); + } else { /* 1<x<2 */ + t = x-one; + return log1pf(t+sqrtf((float)2.0*t+t*t)); + } +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/e_acoshf.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/e_asinf.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_asinf.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_asinf.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,88 @@ +/* e_asinf.c -- float version of e_asin.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ia...@cy.... + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: e_asinf.c,v 1.5 1995/05/12 04:57:25 jtc Exp $"; +#endif + +#include "math.h" +#include "math_private.h" + +static const float +one = 1.0000000000e+00, /* 0x3F800000 */ +huge = 1.000e+30, +pio2_hi = 1.5707962513e+00, /* 0x3fc90fda */ +pio2_lo = 7.5497894159e-08, /* 0x33a22168 */ +pio4_hi = 7.8539818525e-01, /* 0x3f490fdb */ + /* coefficient for R(x^2) */ +pS0 = 1.6666667163e-01, /* 0x3e2aaaab */ +pS1 = -3.2556581497e-01, /* 0xbea6b090 */ +pS2 = 2.0121252537e-01, /* 0x3e4e0aa8 */ +pS3 = -4.0055535734e-02, /* 0xbd241146 */ +pS4 = 7.9153501429e-04, /* 0x3a4f7f04 */ +pS5 = 3.4793309169e-05, /* 0x3811ef08 */ +qS1 = -2.4033949375e+00, /* 0xc019d139 */ +qS2 = 2.0209457874e+00, /* 0x4001572d */ +qS3 = -6.8828397989e-01, /* 0xbf303361 */ +qS4 = 7.7038154006e-02; /* 0x3d9dc62e */ + +#ifdef __MINGW32CE__ +#define __ieee754_sqrtf sqrtf +#endif + +float +__ieee754_asinf(float x) +{ + float t,w,p,q,c,r,s; + int32_t hx,ix; + GET_FLOAT_WORD(hx,x); + ix = hx&0x7fffffff; + if(ix==0x3f800000) { + /* asin(1)=+-pi/2 with inexact */ + return x*pio2_hi+x*pio2_lo; + } else if(ix> 0x3f800000) { /* |x|>= 1 */ + return (x-x)/(x-x); /* asin(|x|>1) is NaN */ + } else if (ix<0x3f000000) { /* |x|<0.5 */ + if(ix<0x32000000) { /* if |x| < 2**-27 */ + if(huge+x>one) return x;/* return x with inexact if x!=0*/ + } else + t = x*x; + p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); + q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); + w = p/q; + return x+x*w; + } + /* 1> |x|>= 0.5 */ + w = one-fabsf(x); + t = w*(float)0.5; + p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); + q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); + s = __ieee754_sqrtf(t); + if(ix>=0x3F79999A) { /* if |x| > 0.975 */ + w = p/q; + t = pio2_hi-((float)2.0*(s+s*w)-pio2_lo); + } else { + int32_t iw; + w = s; + GET_FLOAT_WORD(iw,w); + SET_FLOAT_WORD(w,iw&0xfffff000); + c = (t-w*w)/(s+w); + r = p/q; + p = (float)2.0*s*r-(pio2_lo-(float)2.0*c); + q = pio4_hi-(float)2.0*w; + t = pio4_hi-(p-q); + } + if(hx>0) return t; else return -t; +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/e_asinf.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/e_atan2f.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_atan2f.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_atan2f.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,97 @@ +/* e_atan2f.c -- float version of e_atan2.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ia...@cy.... + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: e_atan2f.c,v 1.4 1995/05/10 20:44:53 jtc Exp $"; +#endif + +#include "math.h" +#include "math_private.h" + +static const float +tiny = 1.0e-30, +zero = 0.0, +pi_o_4 = 7.8539818525e-01, /* 0x3f490fdb */ +pi_o_2 = 1.5707963705e+00, /* 0x3fc90fdb */ +pi = 3.1415925026e+00, /* 0x40490fda */ +pi_lo = 1.5099578832e-07; /* 0x34222168 */ + +float +__ieee754_atan2f(float y, float x) +{ + float z; + int32_t k,m,hx,hy,ix,iy; + + GET_FLOAT_WORD(hx,x); + ix = hx&0x7fffffff; + GET_FLOAT_WORD(hy,y); + iy = hy&0x7fffffff; + if((ix>0x7f800000)|| + (iy>0x7f800000)) /* x or y is NaN */ + return x+y; + if(hx==0x3f800000) return atanf(y); /* x=1.0 */ + m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */ + + /* when y = 0 */ + if(iy==0) { + switch(m) { + case 0: + case 1: return y; /* atan(+-0,+anything)=+-0 */ + case 2: return pi+tiny;/* atan(+0,-anything) = pi */ + case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ + } + } + /* when x = 0 */ + if(ix==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; + + /* when x is INF */ + if(ix==0x7f800000) { + if(iy==0x7f800000) { + switch(m) { + case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */ + case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */ + case 2: return (float)3.0*pi_o_4+tiny;/*atan(+INF,-INF)*/ + case 3: return (float)-3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/ + } + } else { + switch(m) { + case 0: return zero ; /* atan(+...,+INF) */ + case 1: return -zero ; /* atan(-...,+INF) */ + case 2: return pi+tiny ; /* atan(+...,-INF) */ + case 3: return -pi-tiny ; /* atan(-...,-INF) */ + } + } + } + /* when y is INF */ + if(iy==0x7f800000) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; + + /* compute y/x */ + k = (iy-ix)>>23; + if(k > 60) z=pi_o_2+(float)0.5*pi_lo; /* |y/x| > 2**60 */ + else if(hx<0&&k<-60) z=0.0; /* |y|/x < -2**60 */ + else z=atanf(fabsf(y/x)); /* safe to do y/x */ + switch (m) { + case 0: return z ; /* atan(+,+) */ + case 1: { + u_int32_t zh; + GET_FLOAT_WORD(zh,z); + SET_FLOAT_WORD(z,zh ^ 0x80000000); + } + return z ; /* atan(-,+) */ + case 2: return pi-(z-pi_lo);/* atan(+,-) */ + default: /* case 3 */ + return (z-pi_lo)-pi;/* atan(-,-) */ + } +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/e_atan2f.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/e_atanh.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_atanh.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_atanh.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,61 @@ +/* @(#)e_atanh.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: e_atanh.c,v 1.8 1995/05/10 20:44:55 jtc Exp $"; +#endif + +/* __ieee754_atanh(x) + * Method : + * 1.Reduced x to positive by atanh(-x) = -atanh(x) + * 2.For x>=0.5 + * 1 2x x + * atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------) + * 2 1 - x 1 - x + * + * For x<0.5 + * atanh(x) = 0.5*log1p(2x+2x*x/(1-x)) + * + * Special cases: + * atanh(x) is NaN if |x| > 1 with signal; + * atanh(NaN) is that NaN with no signal; + * atanh(+-1) is +-INF with signal. + * + */ + +#include "math.h" +#include "math_private.h" + +static const double one = 1.0, huge = 1e300; +static const double zero = 0.0; + +double +__ieee754_atanh(double x) +{ + double t; + int32_t hx,ix; + u_int32_t lx; + EXTRACT_WORDS(hx,lx,x); + ix = hx&0x7fffffff; + if ((ix|((lx|(-lx))>>31))>0x3ff00000) /* |x|>1 */ + return (x-x)/(x-x); + if(ix==0x3ff00000) + return x/zero; + if(ix<0x3e300000&&(huge+x)>zero) return x; /* x<2**-28 */ + SET_HIGH_WORD(x,ix); + if(ix<0x3fe00000) { /* x < 0.5 */ + t = x+x; + t = 0.5*log1p(t+t*x/(one-x)); + } else + t = 0.5*log1p((x+x)/(one-x)); + if(hx>=0) return t; else return -t; +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/e_atanh.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/e_coshf.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_coshf.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_coshf.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,64 @@ +/* e_coshf.c -- float version of e_cosh.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ia...@cy.... + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: e_coshf.c,v 1.5 1995/05/10 20:45:01 jtc Exp $"; +#endif + +#include "math.h" +#include "math_private.h" + +static const volatile float huge = 1.0e30; +static const float one = 1.0, half=0.5; + +float +__ieee754_coshf(float x) +{ + float t,w; + int32_t ix; + + GET_FLOAT_WORD(ix,x); + ix &= 0x7fffffff; + + /* x is INF or NaN */ + if(ix>=0x7f800000) return x*x; + + /* |x| in [0,0.5*ln2], return 1+expm1(|x|)^2/(2*exp(|x|)) */ + if(ix<0x3eb17218) { + t = expm1f(fabsf(x)); + w = one+t; + if (ix<0x24000000) return w; /* cosh(tiny) = 1 */ + return one+(t*t)/(w+w); + } + + /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */ + if (ix < 0x41b00000) { + t = __ieee754_expf(fabsf(x)); + return half*t+half/t; + } + + /* |x| in [22, log(maxdouble)] return half*exp(|x|) */ + if (ix < 0x42b17180) return half*__ieee754_expf(fabsf(x)); + + /* |x| in [log(maxdouble), overflowthresold] */ + if (ix<=0x42b2d4fc) { + w = __ieee754_expf(half*fabsf(x)); + t = half*w; + return t*w; + } + + /* |x| > overflowthresold, cosh(x) overflow */ + return huge*huge; +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/e_coshf.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/e_expf.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_expf.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_expf.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,96 @@ +/* e_expf.c -- float version of e_exp.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ia...@cy.... + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: e_expf.c,v 1.5 1995/05/10 20:45:05 jtc Exp $"; +#endif + +#include "math.h" +#include "math_private.h" + +static const volatile float huge = 1.0e+30; + +static const float +one = 1.0, +halF[2] = {0.5,-0.5,}, +twom100 = 7.8886090522e-31, /* 2**-100=0x0d800000 */ +o_threshold= 8.8721679688e+01, /* 0x42b17180 */ +u_threshold= -1.0397208405e+02, /* 0xc2cff1b5 */ +ln2HI[2] ={ 6.9313812256e-01, /* 0x3f317180 */ + -6.9313812256e-01,}, /* 0xbf317180 */ +ln2LO[2] ={ 9.0580006145e-06, /* 0x3717f7d1 */ + -9.0580006145e-06,}, /* 0xb717f7d1 */ +invln2 = 1.4426950216e+00, /* 0x3fb8aa3b */ +P1 = 1.6666667163e-01, /* 0x3e2aaaab */ +P2 = -2.7777778450e-03, /* 0xbb360b61 */ +P3 = 6.6137559770e-05, /* 0x388ab355 */ +P4 = -1.6533901999e-06, /* 0xb5ddea0e */ +P5 = 4.1381369442e-08; /* 0x3331bb4c */ + +float +__ieee754_expf(float x) /* default IEEE double exp */ +{ + float y,hi,lo,c,t; + int32_t k,xsb; + u_int32_t hx; + + GET_FLOAT_WORD(hx,x); + xsb = (hx>>31)&1; /* sign bit of x */ + hx &= 0x7fffffff; /* high word of |x| */ + + /* filter out non-finite argument */ + if(hx >= 0x42b17218) { /* if |x|>=88.721... */ + if(hx>0x7f800000) + return x+x; /* NaN */ + if(hx==0x7f800000) + return (xsb==0)? x:0.0; /* exp(+-inf)={inf,0} */ + if(x > o_threshold) return huge*huge; /* overflow */ + if(x < u_threshold) return twom100*twom100; /* underflow */ + } + + /* argument reduction */ + if(hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */ + if(hx < 0x3F851592) { /* and |x| < 1.5 ln2 */ + hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb; + } else { + k = invln2*x+halF[xsb]; + t = k; + hi = x - t*ln2HI[0]; /* t*ln2HI is exact here */ + lo = t*ln2LO[0]; + } + x = hi - lo; + } + else if(hx < 0x31800000) { /* when |x|<2**-28 */ + if(huge+x>one) return one+x;/* trigger inexact */ + } + else k = 0; + + /* x is now in primary range */ + t = x*x; + c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); + if(k==0) return one-((x*c)/(c-(float)2.0)-x); + else y = one-((lo-(x*c)/((float)2.0-c))-hi); + if(k >= -125) { + u_int32_t hy; + GET_FLOAT_WORD(hy,y); + SET_FLOAT_WORD(y,hy+(k<<23)); /* add k to y's exponent */ + return y; + } else { + u_int32_t hy; + GET_FLOAT_WORD(hy,y); + SET_FLOAT_WORD(y,hy+((k+100)<<23)); /* add k to y's exponent */ + return y*twom100; + } +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/e_expf.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/e_gamma_r.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_gamma_r.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_gamma_r.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,32 @@ + +/* @(#)er_gamma.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + */ + +/* __ieee754_gamma_r(x, signgamp) + * Reentrant version of the logarithm of the Gamma function + * with user provide pointer for the sign of Gamma(x). + * + * Method: See __ieee754_lgamma_r + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __MINGW32CE__ +#define __ieee754_exp exp +#endif + +double __ieee754_gamma_r(double x, int *signgamp) +{ + return __ieee754_exp (__ieee754_lgamma_r(x,signgamp)); +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/e_gamma_r.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/e_gammaf_r.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_gammaf_r.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_gammaf_r.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,34 @@ +/* erf_gamma.c -- float version of er_gamma.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ia...@cy.... + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + */ + +/* __ieee754_gammaf_r(x, signgamp) + * Reentrant version of the logarithm of the Gamma function + * with user provide pointer for the sign of Gamma(x). + * + * Method: See __ieee754_lgammaf_r + */ + +#include "fdlibm.h" + +#ifdef __STDC__ + float __ieee754_gammaf_r(float x, int *signgamp) +#else + float __ieee754_gammaf_r(x,signgamp) + float x; int *signgamp; +#endif +{ + return __ieee754_expf (__ieee754_lgammaf_r(x,signgamp)); +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/e_gammaf_r.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/e_lgamma_r.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_lgamma_r.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_lgamma_r.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,300 @@ +/* @(#)er_lgamma.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: e_lgamma_r.c,v 1.7 1995/05/10 20:45:42 jtc Exp $"; +#endif + +/* __ieee754_lgamma_r(x, signgamp) + * Reentrant version of the logarithm of the Gamma function + * with user provide pointer for the sign of Gamma(x). + * + * Method: + * 1. Argument Reduction for 0 < x <= 8 + * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may + * reduce x to a number in [1.5,2.5] by + * lgamma(1+s) = log(s) + lgamma(s) + * for example, + * lgamma(7.3) = log(6.3) + lgamma(6.3) + * = log(6.3*5.3) + lgamma(5.3) + * = log(6.3*5.3*4.3*3.3*2.3) + lgamma(2.3) + * 2. Polynomial approximation of lgamma around its + * minimun ymin=1.461632144968362245 to maintain monotonicity. + * On [ymin-0.23, ymin+0.27] (i.e., [1.23164,1.73163]), use + * Let z = x-ymin; + * lgamma(x) = -1.214862905358496078218 + z^2*poly(z) + * where + * poly(z) is a 14 degree polynomial. + * 2. Rational approximation in the primary interval [2,3] + * We use the following approximation: + * s = x-2.0; + * lgamma(x) = 0.5*s + s*P(s)/Q(s) + * with accuracy + * |P/Q - (lgamma(x)-0.5s)| < 2**-61.71 + * Our algorithms are based on the following observation + * + * zeta(2)-1 2 zeta(3)-1 3 + * lgamma(2+s) = s*(1-Euler) + --------- * s - --------- * s + ... + * 2 3 + * + * where Euler = 0.5771... is the Euler constant, which is very + * close to 0.5. + * + * 3. For x>=8, we have + * lgamma(x)~(x-0.5)log(x)-x+0.5*log(2pi)+1/(12x)-1/(360x**3)+.... + * (better formula: + * lgamma(x)~(x-0.5)*(log(x)-1)-.5*(log(2pi)-1) + ...) + * Let z = 1/x, then we approximation + * f(z) = lgamma(x) - (x-0.5)(log(x)-1) + * by + * 3 5 11 + * w = w0 + w1*z + w2*z + w3*z + ... + w6*z + * where + * |w - f(z)| < 2**-58.74 + * + * 4. For negative x, since (G is gamma function) + * -x*G(-x)*G(x) = pi/sin(pi*x), + * we have + * G(x) = pi/(sin(pi*x)*(-x)*G(-x)) + * since G(-x) is positive, sign(G(x)) = sign(sin(pi*x)) for x<0 + * Hence, for x<0, signgam = sign(sin(pi*x)) and + * lgamma(x) = log(|Gamma(x)|) + * = log(pi/(|x*sin(pi*x)|)) - lgamma(-x); + * Note: one should avoid compute pi*(-x) directly in the + * computation of sin(pi*(-x)). + * + * 5. Special Cases + * lgamma(2+s) ~ s*(1-Euler) for tiny s + * lgamma(1)=lgamma(2)=0 + * lgamma(x) ~ -log(x) for tiny x + * lgamma(0) = lgamma(inf) = inf + * lgamma(-integer) = +-inf + * + */ + +#include "math.h" +#include "math_private.h" + +static const double +two52= 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */ +half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ +one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ +pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */ +a0 = 7.72156649015328655494e-02, /* 0x3FB3C467, 0xE37DB0C8 */ +a1 = 3.22467033424113591611e-01, /* 0x3FD4A34C, 0xC4A60FAD */ +a2 = 6.73523010531292681824e-02, /* 0x3FB13E00, 0x1A5562A7 */ +a3 = 2.05808084325167332806e-02, /* 0x3F951322, 0xAC92547B */ +a4 = 7.38555086081402883957e-03, /* 0x3F7E404F, 0xB68FEFE8 */ +a5 = 2.89051383673415629091e-03, /* 0x3F67ADD8, 0xCCB7926B */ +a6 = 1.19270763183362067845e-03, /* 0x3F538A94, 0x116F3F5D */ +a7 = 5.10069792153511336608e-04, /* 0x3F40B6C6, 0x89B99C00 */ +a8 = 2.20862790713908385557e-04, /* 0x3F2CF2EC, 0xED10E54D */ +a9 = 1.08011567247583939954e-04, /* 0x3F1C5088, 0x987DFB07 */ +a10 = 2.52144565451257326939e-05, /* 0x3EFA7074, 0x428CFA52 */ +a11 = 4.48640949618915160150e-05, /* 0x3F07858E, 0x90A45837 */ +tc = 1.46163214496836224576e+00, /* 0x3FF762D8, 0x6356BE3F */ +tf = -1.21486290535849611461e-01, /* 0xBFBF19B9, 0xBCC38A42 */ +/* tt = -(tail of tf) */ +tt = -3.63867699703950536541e-18, /* 0xBC50C7CA, 0xA48A971F */ +t0 = 4.83836122723810047042e-01, /* 0x3FDEF72B, 0xC8EE38A2 */ +t1 = -1.47587722994593911752e-01, /* 0xBFC2E427, 0x8DC6C509 */ +t2 = 6.46249402391333854778e-02, /* 0x3FB08B42, 0x94D5419B */ +t3 = -3.27885410759859649565e-02, /* 0xBFA0C9A8, 0xDF35B713 */ +t4 = 1.79706750811820387126e-02, /* 0x3F9266E7, 0x970AF9EC */ +t5 = -1.03142241298341437450e-02, /* 0xBF851F9F, 0xBA91EC6A */ +t6 = 6.10053870246291332635e-03, /* 0x3F78FCE0, 0xE370E344 */ +t7 = -3.68452016781138256760e-03, /* 0xBF6E2EFF, 0xB3E914D7 */ +t8 = 2.25964780900612472250e-03, /* 0x3F6282D3, 0x2E15C915 */ +t9 = -1.40346469989232843813e-03, /* 0xBF56FE8E, 0xBF2D1AF1 */ +t10 = 8.81081882437654011382e-04, /* 0x3F4CDF0C, 0xEF61A8E9 */ +t11 = -5.38595305356740546715e-04, /* 0xBF41A610, 0x9C73E0EC */ +t12 = 3.15632070903625950361e-04, /* 0x3F34AF6D, 0x6C0EBBF7 */ +t13 = -3.12754168375120860518e-04, /* 0xBF347F24, 0xECC38C38 */ +t14 = 3.35529192635519073543e-04, /* 0x3F35FD3E, 0xE8C2D3F4 */ +u0 = -7.72156649015328655494e-02, /* 0xBFB3C467, 0xE37DB0C8 */ +u1 = 6.32827064025093366517e-01, /* 0x3FE4401E, 0x8B005DFF */ +u2 = 1.45492250137234768737e+00, /* 0x3FF7475C, 0xD119BD6F */ +u3 = 9.77717527963372745603e-01, /* 0x3FEF4976, 0x44EA8450 */ +u4 = 2.28963728064692451092e-01, /* 0x3FCD4EAE, 0xF6010924 */ +u5 = 1.33810918536787660377e-02, /* 0x3F8B678B, 0xBF2BAB09 */ +v1 = 2.45597793713041134822e+00, /* 0x4003A5D7, 0xC2BD619C */ +v2 = 2.12848976379893395361e+00, /* 0x40010725, 0xA42B18F5 */ +v3 = 7.69285150456672783825e-01, /* 0x3FE89DFB, 0xE45050AF */ +v4 = 1.04222645593369134254e-01, /* 0x3FBAAE55, 0xD6537C88 */ +v5 = 3.21709242282423911810e-03, /* 0x3F6A5ABB, 0x57D0CF61 */ +s0 = -7.72156649015328655494e-02, /* 0xBFB3C467, 0xE37DB0C8 */ +s1 = 2.14982415960608852501e-01, /* 0x3FCB848B, 0x36E20878 */ +s2 = 3.25778796408930981787e-01, /* 0x3FD4D98F, 0x4F139F59 */ +s3 = 1.46350472652464452805e-01, /* 0x3FC2BB9C, 0xBEE5F2F7 */ +s4 = 2.66422703033638609560e-02, /* 0x3F9B481C, 0x7E939961 */ +s5 = 1.84028451407337715652e-03, /* 0x3F5E26B6, 0x7368F239 */ +s6 = 3.19475326584100867617e-05, /* 0x3F00BFEC, 0xDD17E945 */ +r1 = 1.39200533467621045958e+00, /* 0x3FF645A7, 0x62C4AB74 */ +r2 = 7.21935547567138069525e-01, /* 0x3FE71A18, 0x93D3DCDC */ +r3 = 1.71933865632803078993e-01, /* 0x3FC601ED, 0xCCFBDF27 */ +r4 = 1.86459191715652901344e-02, /* 0x3F9317EA, 0x742ED475 */ +r5 = 7.77942496381893596434e-04, /* 0x3F497DDA, 0xCA41A95B */ +r6 = 7.32668430744625636189e-06, /* 0x3EDEBAF7, 0xA5B38140 */ +w0 = 4.18938533204672725052e-01, /* 0x3FDACFE3, 0x90C97D69 */ +w1 = 8.33333333333329678849e-02, /* 0x3FB55555, 0x5555553B */ +w2 = -2.77777777728775536470e-03, /* 0xBF66C16C, 0x16B02E5C */ +w3 = 7.93650558643019558500e-04, /* 0x3F4A019F, 0x98CF38B6 */ +w4 = -5.95187557450339963135e-04, /* 0xBF4380CB, 0x8C0FE741 */ +w5 = 8.36339918996282139126e-04, /* 0x3F4B67BA, 0x4CDAD5D1 */ +w6 = -1.63092934096575273989e-03; /* 0xBF5AB89D, 0x0B9E43E4 */ + +static const double zero= 0.00000000000000000000e+00; + +#ifdef __MINGW32CE__ +#define __ieee754_log log +#endif + +static double +sin_pi(double x) +{ + double y,z; + int n,ix; + + GET_HIGH_WORD(ix,x); + ix &= 0x7fffffff; + + if(ix<0x3fd00000) return __kernel_sin(pi*x,zero,0); + y = -x; /* x is assume negative */ + + /* + * argument reduction, make sure inexact flag not raised if input + * is an integer + */ + z = floor(y); + if(z!=y) { /* inexact anyway */ + y *= 0.5; + y = 2.0*(y - floor(y)); /* y = |x| mod 2.0 */ + n = (int) (y*4.0); + } else { + if(ix>=0x43400000) { + y = zero; n = 0; /* y must be even */ + } else { + if(ix<0x43300000) z = y+two52; /* exact */ + GET_LOW_WORD(n,z); + n &= 1; + y = n; + n<<= 2; + } + } + switch (n) { + case 0: y = __kernel_sin(pi*y,zero,0); break; + case 1: + case 2: y = __kernel_cos(pi*(0.5-y),zero); break; + case 3: + case 4: y = __kernel_sin(pi*(one-y),zero,0); break; + case 5: + case 6: y = -__kernel_cos(pi*(y-1.5),zero); break; + default: y = __kernel_sin(pi*(y-2.0),zero,0); break; + } + return -y; +} + + +double +__ieee754_lgamma_r(double x, int *signgamp) +{ + double t,y,z,nadj,p,p1,p2,p3,q,r,w; + int i,hx,lx,ix; + + EXTRACT_WORDS(hx,lx,x); + + /* purge off +-inf, NaN, +-0, and negative arguments */ + *signgamp = 1; + ix = hx&0x7fffffff; + if(ix>=0x7ff00000) return x*x; + if((ix|lx)==0) return one/zero; + if(ix<0x3b900000) { /* |x|<2**-70, return -log(|x|) */ + if(hx<0) { + *signgamp = -1; + return -__ieee754_log(-x); + } else return -__ieee754_log(x); + } + if(hx<0) { + if(ix>=0x43300000) /* |x|>=2**52, must be -integer */ + return one/zero; + t = sin_pi(x); + if(t==zero) return one/zero; /* -integer */ + nadj = __ieee754_log(pi/fabs(t*x)); + if(t<zero) *signgamp = -1; + x = -x; + } + + /* purge off 1 and 2 */ + if((((ix-0x3ff00000)|lx)==0)||(((ix-0x40000000)|lx)==0)) r = 0; + /* for x < 2.0 */ + else if(ix<0x40000000) { + if(ix<=0x3feccccc) { /* lgamma(x) = lgamma(x+1)-log(x) */ + r = -__ieee754_log(x); + if(ix>=0x3FE76944) {y = one-x; i= 0;} + else if(ix>=0x3FCDA661) {y= x-(tc-one); i=1;} + else {y = x; i=2;} + } else { + r = zero; + if(ix>=0x3FFBB4C3) {y=2.0-x;i=0;} /* [1.7316,2] */ + else if(ix>=0x3FF3B4C4) {y=x-tc;i=1;} /* [1.23,1.73] */ + else {y=x-one;i=2;} + } + switch(i) { + case 0: + z = y*y; + p1 = a0+z*(a2+z*(a4+z*(a6+z*(a8+z*a10)))); + p2 = z*(a1+z*(a3+z*(a5+z*(a7+z*(a9+z*a11))))); + p = y*p1+p2; + r += (p-0.5*y); break; + case 1: + z = y*y; + w = z*y; + p1 = t0+w*(t3+w*(t6+w*(t9 +w*t12))); /* parallel comp */ + p2 = t1+w*(t4+w*(t7+w*(t10+w*t13))); + p3 = t2+w*(t5+w*(t8+w*(t11+w*t14))); + p = z*p1-(tt-w*(p2+y*p3)); + r += (tf + p); break; + case 2: + p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5))))); + p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5)))); + r += (-0.5*y + p1/p2); + } + } + else if(ix<0x40200000) { /* x < 8.0 */ + i = (int)x; + t = zero; + y = x-(double)i; + p = y*(s0+y*(s1+y*(s2+y*(s3+y*(s4+y*(s5+y*s6)))))); + q = one+y*(r1+y*(r2+y*(r3+y*(r4+y*(r5+y*r6))))); + r = half*y+p/q; + z = one; /* lgamma(1+s) = log(s) + lgamma(s) */ + switch(i) { + case 7: z *= (y+6.0); /* FALLTHRU */ + case 6: z *= (y+5.0); /* FALLTHRU */ + case 5: z *= (y+4.0); /* FALLTHRU */ + case 4: z *= (y+3.0); /* FALLTHRU */ + case 3: z *= (y+2.0); /* FALLTHRU */ + r += __ieee754_log(z); break; + } + /* 8.0 <= x < 2**58 */ + } else if (ix < 0x43900000) { + t = __ieee754_log(x); + z = one/x; + y = z*z; + w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6))))); + r = (x-half)*(t-one)+w; + } else + /* 2**58 <= x <= inf */ + r = x*(__ieee754_log(x)-one); + if(hx<0) r = nadj - r; + return r; +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/e_lgamma_r.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/e_lgammaf_r.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/e_lgammaf_r.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/e_lgammaf_r.c 2007-02-04 00:29:15 UTC (rev 875) @@ -0,0 +1,232 @@ +/* e_lgammaf_r.c -- float version of e_lgamma_r.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ia...@cy.... + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: e_lgammaf_r.c,v 1.3 1995/05/10 20:45:47 jtc Exp $"; +#endif + +#include "math.h" +#include "math_private.h" + +static const float +two23= 8.3886080000e+06, /* 0x4b000000 */ +half= 5.0000000000e-01, /* 0x3f000000 */ +one = 1.0000000000e+00, /* 0x3f800000 */ +pi = 3.1415927410e+00, /* 0x40490fdb */ +a0 = 7.7215664089e-02, /* 0x3d9e233f */ +a1 = 3.2246702909e-01, /* 0x3ea51a66 */ +a2 = 6.7352302372e-02, /* 0x3d89f001 */ +a3 = 2.0580807701e-02, /* 0x3ca89915 */ +a4 = 7.3855509982e-03, /* 0x3bf2027e */ +a5 = 2.8905137442e-03, /* 0x3b3d6ec6 */ +a6 = 1.1927076848e-03, /* 0x3a9c54a1 */ +a7 = 5.1006977446e-04, /* 0x3a05b634 */ +a8 = 2.2086278477e-04, /* 0x39679767 */ +a9 = 1.0801156895e-04, /* 0x38e28445 */ +a10 = 2.5214456400e-05, /* 0x37d383a2 */ +a11 = 4.4864096708e-05, /* 0x383c2c75 */ +tc = 1.4616321325e+00, /* 0x3fbb16c3 */ +tf = -1.2148628384e-01, /* 0xbdf8cdcd */ +/* tt = -(tail of tf) */ +tt = 6.6971006518e-09, /* 0x31e61c52 */ +t0 = 4.8383611441e-01, /* 0x3ef7b95e */ +t1 = -1.4758771658e-01, /* 0xbe17213c */ +t2 = 6.4624942839e-02, /* 0x3d845a15 */ +t3 = -3.2788541168e-02, /* 0xbd064d47 */ +t4 = 1.7970675603e-02, /* 0x3c93373d */ +t5 = -1.0314224288e-02, /* 0xbc28fcfe */ +t6 = 6.1005386524e-03, /* 0x3bc7e707 */ +t7 = -3.6845202558e-03, /* 0xbb7177fe */ +t8 = 2.2596477065e-03, /* 0x3b141699 */ +t9 = -1.4034647029e-03, /* 0xbab7f476 */ +t10 = 8.8108185446e-04, /* 0x3a66f867 */ +t11 = -5.3859531181e-04, /* 0xba0d3085 */ +t12 = 3.1563205994e-04, /* 0x39a57b6b */ +t13 = -3.1275415677e-04, /* 0xb9a3f927 */ +t14 = 3.3552918467e-04, /* 0x39afe9f7 */ +u0 = -7.7215664089e-02, /* 0xbd9e233f */ +u1 = 6.3282704353e-01, /* 0x3f2200f4 */ +u2 = 1.4549225569e+00, /* 0x3fba3ae7 */ +u3 = 9.7771751881e-01, /* 0x3f7a4bb2 */ +u4 = 2.2896373272e-01, /* 0x3e6a7578 */ +u5 = 1.3381091878e-02, /* 0x3c5b3c5e */ +v1 = 2.4559779167e+00, /* 0x401d2ebe */ +v2 = 2.1284897327e+00, /* 0x4008392d */ +v3 = 7.6928514242e-01, /* 0x3f44efdf */ +v4 = 1.0422264785e-01, /* 0x3dd572af */ +v5 = 3.2170924824e-03, /* 0x3b52d5db */ +s0 = -7.7215664089e-02, /* 0xbd9e233f */ +s1 = 2.1498242021e-01, /* 0x3e5c245a */ +s2 = 3.2577878237e-01, /* 0x3ea6cc7a */ +s3 = 1.4635047317e-01, /* 0x3e15dce6 */ +s4 = 2.6642270386e-02, /* 0x3cda40e4 */ +s5 = 1.8402845599e-03, /* 0x3af135b4 */ +s6 = 3.1947532989e-05, /* 0x3805ff67 */ +r1 = 1.3920053244e+00, /* 0x3fb22d3b */ +r2 = 7.2193557024e-01, /* 0x3f38d0c5 */ +r3 = 1.7193385959e-01, /* 0x3e300f6e */ +r4 = 1.8645919859e-02, /* 0x3c98bf54 */ +r5 = 7.7794247773e-04, /* 0x3a4beed6 */ +r6 = 7.3266842264e-06, /* 0x36f5d7bd */ +w0 = 4.1893854737e-01, /* 0x3ed67f1d */ +w1 = 8.3333335817e-02, /* 0x3daaaaab */ +w2 = -2.7777778450e-03, /* 0xbb360b61 */ +w3 = 7.9365057172e-04, /* 0x3a500cfd */ +w4 = -5.9518753551e-04, /* 0xba1c065c */ +w5 = 8.3633989561e-04, /* 0x3a5b3dd2 */ +w6 = -1.6309292987e-03; /* 0xbad5c4e8 */ + +static const float zero= 0.0000000000e+00; + +static float +sin_pif(float x) +{ + float y,z; + int n,ix; + + GET_FLOAT_WORD(ix,x); + ix &= 0x7fffffff; + + if(ix<0x3e800000) return __kernel_sinf(pi*x,zero,0); + y = -x; /* x is assume negative */ + + /* + * argument reduction, make sure inexact flag not raised if input + * is an integer + */ + z = floorf(y); + if(z!=y) { /* inexact anyway */ + y *= (float)0.5; + y = (float)2.0*(y - floorf(y)); /* y = |x| mod 2.0 */ + n = (int) (y*(float)4.0); + } else { + if(ix>=0x4b800000) { + y = zero; n = 0; /* y must be even */ + } else { + if(ix<0x4b000000) z = y+two23; /* exact */ + GET_FLOAT_WORD(n,z); + n &= 1; + y = n; + n<<= 2; + } + } + switch (n) { + case 0: y = __kernel_sinf(pi*y,zero,0); break; + case 1: + case 2: y = __kernel_cosf(pi*((float)0.5-y),zero); break; + case 3: + case 4: y = __kernel_sinf(pi*(one-y),zero,0); break; + case 5: + case 6: y = -__kernel_cosf(pi*(y-(float)1.5),zero); break; + default: y = __kernel_sinf(pi*(y-(float)2.0),zero,0); break; + } + return -y; +} + + +float +__ieee754_lgammaf_r(float x, int *signgamp) +{ + float t,y,z,nadj,p,p1,p2,p3,q,r,w; + int i,hx,ix; + + GET_FLOAT_WORD(hx,x); + + /* purge off +-inf, NaN, +-0, and negative arguments */ + *signgamp = 1; + ix = hx&0x7fffffff; + if(ix>=0x7f800000) return x*x; + if(ix==0) return one/zero; + if(ix<0x1c800000) { /* |x|<2**-70, return -log(|x|) */ + if(hx<0) { + *signgamp = -1; + return -__ieee754_logf(-x); + } else return -__ieee754_logf(x); + } + if(hx<0) { + if(ix>=0x4b000000) /* |x|>=2**23, must be -integer */ + return one/zero; + t = sin_pif(x); + if(t==zero) return one/zero; /* -integer */ + nadj = __ieee754_logf(pi/fabsf(t*x)); + if(t<zero) *signgamp = -1; + x = -x; + } + + /* purge off 1 and 2 */ + if (ix==0x3f800000||ix==0x40000000) r = 0; + /* for x < 2.0 */ + else if(ix<0x40000000) { + if(ix<=0x3f666666) { /* lgamma(x) = lgamma(x+1)-log(x) */ + r = -__ieee754_logf(x); + if(ix>=0x3f3b4a20) {y = one-x; i= 0;} + else if(ix>=0x3e6d3308) {y= x-(tc-one); i=1;} + else {y = x; i=2;} + } else { + r = zero; + if(ix>=0x3fdda618) {y=(float)2.0-x;i=0;} /* [1.7316,2] */ + else if(ix>=0x3F9da620) {y=x-tc;i=1;} /* [1.23,1.73] */ + else {y=x-one;i=2;} + } + switch(i) { + case 0: + z = y*y; + p1 = a0+z*(a2+z*(a4+z*(a6+z*(a8+z*a10)))); + p2 = z*(a1+z*(a3+z*(a5+z*(a7+z*(a9+z*a11))))); + p = y*p1+p2; + r += (p-(float)0.5*y); break; + case 1: + z = y*y; + w = z*y; + p1 = t0+w*(t3+w*(t6+w*(t9 +w*t12))); /* parallel comp */ + p2 = t1+w*(t4+w*(t7+w*(t10+w*t13))); + p3 = t2+w*(t5+w*(t8+w*(t11+w*t14))); + p = z*p1-(tt-w*(p2+y*p3)); + r += (tf + p); break; + case 2: + p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5))))); + p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5)))); + r += (-(float)0.5*y + p1/p2); + } + } + else if(ix<0x41000000) { /* x < 8.0 */ + i = (int)x; + t = zero; + y = x-(float)i; + p = y*(s0+y*(s1+y*(s2+y*(s3+y*(s4+y*(s5+y*s6)))))); + q = one+y*(r1+y*(r2+y*(r3+y*(r4+y*(r5+y*r6))))); + r = half*y+p/q; + z = one; /* lgamma(1+s) = log(s) + lgamma(s) */ + switch(i) { + case 7: z *= (y+(float)6.0); /* FALLTHRU */ + case 6: z *= (y+(float)5.0); /* FALLTHRU */ + case 5: z *= (y+(float)4.0); /* FALLTHRU */ + case 4: z *= (y+(float)3.0); /* FALLTHRU */ + case 3: z *= (y+(float)2.0); /* FALLTHRU */ + r += __ieee754_logf(z); break; + } + /* 8.0 <= x < 2**58 */ + } else if (ix < 0x5... [truncated message content] |
From: <ped...@us...> - 2007-02-05 02:16:25
|
Revision: 886 http://svn.sourceforge.net/cegcc/?rev=886&view=rev Author: pedroalves Date: 2007-02-04 18:15:18 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Update from upstream. Note: Upstream version is now 3.11. * configure: Regenerate. Modified Paths: -------------- trunk/cegcc/src/mingw/CVS/Entries trunk/cegcc/src/mingw/ChangeLog trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/Makefile.in trunk/cegcc/src/mingw/aclocal.m4 trunk/cegcc/src/mingw/configure trunk/cegcc/src/mingw/configure.in trunk/cegcc/src/mingw/include/CVS/Entries trunk/cegcc/src/mingw/include/_mingw.h trunk/cegcc/src/mingw/include/ctype.h trunk/cegcc/src/mingw/include/io.h trunk/cegcc/src/mingw/include/stdio.h trunk/cegcc/src/mingw/include/stdlib.h trunk/cegcc/src/mingw/include/unistd.h trunk/cegcc/src/mingw/include/wchar.h trunk/cegcc/src/mingw/mingwex/CVS/Entries trunk/cegcc/src/mingw/mingwex/Makefile.in trunk/cegcc/src/mingw/mingwex/math/CVS/Entries trunk/cegcc/src/mingw/mingwex/mb_wc_common.h trunk/cegcc/src/mingw/mingwex/mbrtowc.c trunk/cegcc/src/mingw/mingwex/wcrtomb.c trunk/cegcc/src/mingw/mingwex/wcstold.c trunk/cegcc/src/mingw/mingwex/wctob.c trunk/cegcc/src/mingw/mingwex/wdirent.c trunk/cegcc/src/mingw/msvcrt.def.in trunk/cegcc/src/mingw/profile/CVS/Entries trunk/cegcc/src/mingw/profile/Makefile.in trunk/cegcc/src/mingw/samples/dirent/CVS/Entries trunk/cegcc/src/mingw/samples/dlltest/CVS/Entries trunk/cegcc/src/mingw/samples/filehand/CVS/Entries trunk/cegcc/src/mingw/samples/fmode/CVS/Entries trunk/cegcc/src/mingw/samples/globbing/CVS/Entries trunk/cegcc/src/mingw/samples/print/CVS/Entries trunk/cegcc/src/mingw/samples/seh/CVS/Entries trunk/cegcc/src/mingw/samples/simpledll/CVS/Entries trunk/cegcc/src/mingw/samples/test/CVS/Entries trunk/cegcc/src/mingw/samples/wintest/CVS/Entries Added Paths: ----------- trunk/cegcc/src/mingw/include/libgen.h trunk/cegcc/src/mingw/mingwex/basename.c trunk/cegcc/src/mingw/mingwex/dirname.c trunk/cegcc/src/mingw/mingwex/gdtoa/ trunk/cegcc/src/mingw/mingwex/gdtoa/CVS/ trunk/cegcc/src/mingw/mingwex/gdtoa/CVS/Entries trunk/cegcc/src/mingw/mingwex/gdtoa/CVS/Repository trunk/cegcc/src/mingw/mingwex/gdtoa/CVS/Root trunk/cegcc/src/mingw/mingwex/gdtoa/README trunk/cegcc/src/mingw/mingwex/gdtoa/arithchk.c trunk/cegcc/src/mingw/mingwex/gdtoa/dmisc.c trunk/cegcc/src/mingw/mingwex/gdtoa/dtoa.c trunk/cegcc/src/mingw/mingwex/gdtoa/g__fmt.c trunk/cegcc/src/mingw/mingwex/gdtoa/g_dfmt.c trunk/cegcc/src/mingw/mingwex/gdtoa/g_ffmt.c trunk/cegcc/src/mingw/mingwex/gdtoa/g_xfmt.c trunk/cegcc/src/mingw/mingwex/gdtoa/gd_arith.h trunk/cegcc/src/mingw/mingwex/gdtoa/gd_qnan.h trunk/cegcc/src/mingw/mingwex/gdtoa/gdtoa.c trunk/cegcc/src/mingw/mingwex/gdtoa/gdtoa.h trunk/cegcc/src/mingw/mingwex/gdtoa/gdtoaimp.h trunk/cegcc/src/mingw/mingwex/gdtoa/gethex.c trunk/cegcc/src/mingw/mingwex/gdtoa/gmisc.c trunk/cegcc/src/mingw/mingwex/gdtoa/hd_init.c trunk/cegcc/src/mingw/mingwex/gdtoa/hexnan.c trunk/cegcc/src/mingw/mingwex/gdtoa/misc.c trunk/cegcc/src/mingw/mingwex/gdtoa/qnan.c trunk/cegcc/src/mingw/mingwex/gdtoa/smisc.c trunk/cegcc/src/mingw/mingwex/gdtoa/strtodg.c trunk/cegcc/src/mingw/mingwex/gdtoa/strtodnrp.c trunk/cegcc/src/mingw/mingwex/gdtoa/strtof.c trunk/cegcc/src/mingw/mingwex/gdtoa/strtopx.c trunk/cegcc/src/mingw/mingwex/gdtoa/sum.c trunk/cegcc/src/mingw/mingwex/gdtoa/ulp.c Removed Paths: ------------- trunk/cegcc/src/mingw/mingwex/ldtoa.c trunk/cegcc/src/mingw/mingwex/math/cephes_emath.c trunk/cegcc/src/mingw/mingwex/math/cephes_emath.h trunk/cegcc/src/mingw/mingwex/strtof.c trunk/cegcc/src/mingw/mingwex/strtold.c Modified: trunk/cegcc/src/mingw/CVS/Entries =================================================================== --- trunk/cegcc/src/mingw/CVS/Entries 2007-02-04 23:30:24 UTC (rev 885) +++ trunk/cegcc/src/mingw/CVS/Entries 2007-02-05 02:15:18 UTC (rev 886) @@ -1,30 +1,20 @@ -/CONTRIBUTORS/1.1/Tue Apr 20 22:49:32 2004// /CRT_noglob.c/1.2/Tue Apr 20 22:49:32 2004/-ko/ /CRTfmode.c/1.3/Tue Apr 20 22:49:32 2004/-ko/ /CRTglob.c/1.2/Tue Apr 20 22:49:32 2004/-ko/ /CRTinit.c/1.2/Tue Apr 20 22:49:32 2004/-ko/ -/ChangeLog/1.314/Thu Aug 3 21:05:06 2006/-ko/ -/DISCLAIMER/1.2/Thu Apr 22 16:16:24 2004// /README/1.2/Thu Apr 22 16:16:26 2004// /TODO/1.1/Wed Nov 22 01:51:54 2000// -/aclocal.m4/1.1/Wed May 24 16:59:02 2006// /binmode.c/1.1/Sat Oct 19 20:26:26 2002// -/config.guess/1.2/Thu Jul 3 15:15:56 2003// /config.sub/1.2/Thu Jul 3 15:15:56 2003// /cpu_features.h/1.1/Mon Jul 3 10:32:58 2006// -/crtdll.def/1.3/Tue Apr 20 22:49:32 2004/-ko/ /crtmt.c/1.1.1.1/Thu Feb 17 19:38:32 2000/-ko/ /crtst.c/1.1.1.1/Thu Feb 17 19:38:32 2000/-ko/ /dllmain.c/1.2/Tue Apr 20 22:49:32 2004/-ko/ /gccmain.c/1.2/Tue Apr 20 22:49:32 2004/-ko/ -/install-sh/1.1/Wed Nov 22 01:51:54 2000// /isascii.c/1.2/Tue Apr 20 22:49:32 2004// /iscsym.c/1.2/Tue Apr 20 22:49:32 2004// /iscsymf.c/1.2/Tue Apr 20 22:49:32 2004// -/jamfile/1.2/Tue Apr 20 22:49:32 2004/-ko/ -/mkinstalldirs/1.1/Wed Nov 22 01:51:54 2000// /moldname.def.in/1.7/Mon Aug 8 10:22:20 2005/-ko/ -/msvcrt.def.in/1.4/Tue Apr 20 22:49:32 2004// /mthr.c/1.2/Wed Dec 5 15:01:06 2001/-ko/ /mthr_init.c/1.2/Wed Dec 5 15:01:06 2001/-ko/ /mthr_stub.c/1.3/Wed Aug 10 10:05:02 2005/-ko/ @@ -42,12 +32,22 @@ D/samples//// /CRT_fp10.c/1.2/Wed Aug 23 23:25:48 2006// /CRT_fp8.c/1.2/Wed Aug 23 23:25:48 2006// -/Makefile.in/1.63/Wed Aug 23 23:25:48 2006/-ko/ -/configure/1.16/Wed Aug 23 23:25:50 2006/-ko/ -/configure.in/1.12/Wed Aug 23 23:25:50 2006/-ko/ /cpu_features.c/1.1/Wed Aug 23 23:25:50 2006// /crt1.c/1.11/Wed Aug 23 23:25:50 2006/-ko/ /dllcrt1.c/1.4/Wed Aug 23 23:25:50 2006/-ko/ /init.c/1.2/Wed Aug 23 23:25:50 2006/-ko/ /main.c/1.2/Wed Aug 23 23:25:50 2006/-ko/ /pseudo-reloc.c/1.1/Wed Aug 23 23:25:50 2006// +/CONTRIBUTORS/1.1/Tue Apr 20 23:49:32 2004// +/DISCLAIMER/1.2/Thu Apr 22 17:16:24 2004// +/Makefile.in/1.69/Result of merge+Sun Feb 4 20:14:28 2007/-ko/ +/aclocal.m4/1.4/Sun Feb 4 20:14:28 2007// +/config.guess/1.2/Thu Jul 3 16:15:56 2003// +/configure/1.19/Result of merge+Sun Feb 4 20:14:30 2007/-ko/ +/configure.in/1.15/Result of merge+Sun Feb 4 20:14:30 2007/-ko/ +/crtdll.def/1.3/Tue Apr 20 23:49:32 2004/-ko/ +/install-sh/1.1/Wed Nov 22 02:51:54 2000// +/jamfile/1.2/Tue Apr 20 23:49:32 2004/-ko/ +/mkinstalldirs/1.1/Wed Nov 22 02:51:54 2000// +/ChangeLog/1.336/Sun Feb 4 22:12:36 2007/-ko/ +/msvcrt.def.in/1.6/Sun Feb 4 22:19:54 2007// Modified: trunk/cegcc/src/mingw/ChangeLog =================================================================== --- trunk/cegcc/src/mingw/ChangeLog 2007-02-04 23:30:24 UTC (rev 885) +++ trunk/cegcc/src/mingw/ChangeLog 2007-02-05 02:15:18 UTC (rev 886) @@ -1,3 +1,174 @@ +2007-01-27 Danny Smith <dan...@us...> + + Expose some more msvcr80.dll functions. + * include/stdio.h (_fseek_nolock. _ftell_nolock, _fseeki64, + _ftelli64, _fseeki64_nolock, _ftelli64_nolock) Add prototypes + * msvcrt.def.in (_fseek_nolock. _ftell_nolock, _fseeki64, + _ftelli64, _fseeki64_nolock, _ftelli64_nolock) Add stubs. + +2007-01-26 Danny Smith <dan...@us...> + + Expose some msvcr80.dll functions. + * include/stdlib.h (_set_abort_behavior): Add prototype. + (_WRITE_ABORT_MSG, _CALL_REPORTFAULT): Add defines for + _set_abort_behavior mask argument. + (_invalid_parameter_handler): Add typedef. + (_set_invalid_parameter_handler): Add prototype. + * include/stdio.h (_get_printf_count_output): Add prototype. + (_set_printf_count_output): Add prototype. + * msvcrt.def.in (_get_printf_count_output,_set_printf_count_output, + _set_abort_behavior, _set_invalid_parameter_handler): Add stubs. + +2007-01-26 Danny Smith <dan...@us...> + + * include/_mingw.h (CRT_INLINE): Correct typo. + +2007-01-24 Danny Smith <dan...@us...> + + * include/io.h (X_OK): Define to F_OK. + +2007-01-19 Danny Smith <dan...@us...> + + * include/stdio.h (SEEK_SET, SEEK_CUR, SEEK_END): Define + unconditionally. Change comment. + * include/unistd.h (SEEK_SET, SEEK_CUR, SEEK_END): Define + here too. + * include/io.h (rename): Declare. + (remove): Declare. + +2006-12-31 Keith Marshall <kei...@us...> + + * include/libgen.h: New file; required by... + * mingwex/basename.c, mingwex/dirname.c: New files. + * mingwex/Makefile.in (DISTFILES): Add them... + (POSIX_OBJS): ...with corresponding basename.o, dirname.o + (Dependencies): Typo; s/Dependancies/Dependencies/ + +2006-11-25 Keith Marshall <kei...@us...> + + * Makefile.in (VERSION): Let configure define it. + + * aclocal.m4 (MINGW_AC_CONFIG_SRCDIR): New macro. + * configure.in: Use it. + Correct quoting of autoconf macro arguments throughout. + (AC_INIT, AC_OUTPUT): Update to autoconf 2.5x preferred syntax. + (AR, AS, RANLIB, LD, DLLTOOL, DLLWRAP): Don't need AC_SUBST. + (AC_ALLOCA): Invalid after GCC_NO_EXECUTABLES; removed. + (AC_CONFIG_FILES): Add, to generate Makefile. + + * configure: Regenerated. + +2006-11-21 Danny Smith <dan...@us...> + + * Makefile.in: Add aclocal.m4 to source release. + * mingwex/Makefile.in: Ditto. + * profile/Makefile.in: Ditto. + +2006-11-18 Chris Sutcliffe <ir0...@us...> + + * Include/_mingw.h: Increment version to 3.11. + * Makefile.in: Ditto. + +2006-11-09 Danny Smith <dan...@us...> + + [ mingw-Bugs-1590623 ] + * include/_mingw.h (__CRT_INLINE): Use __gnu_inline__ attribute + in C99 mode. + +2006-10-04 Corinna Vinschen <co...@vi...> + + * Makefile.in: Semi-revert semi-reversion of 2006-08-30 change, now + correctly parenthesized. + +2006-09-19 Danny Smith <dan...@us...> + + * mingwex/mb_wc_common.h (get_codepage): Get it + from __lc_codepage. + +2006-09-18 Danny Smith <dan...@us...> + + * mingwex/gdtoa/g_xfmt.c (g_xfmt): Fix representation of infinity. + Use fpclassify. + * mingwex/gdtoa/strtopx (__strtopx): Avoid cast of long double* to + void*. + * mingwex/gdtoa/gdtoa.h (__g_fmt): Make declaration consistent with + others. + +2006-09-16 Danny Smith <dan...@us...> + + * mingwex/gdtoa/strtopx.c (strtopx): Fix long double representation + of infinity. + +2006-09-11 Christopher Faylor <cg...@ti...> + + * Makefile.in: Semi-revert 2006-08-30 change. + +2006-09-10 Danny Smith <dan...@us...> + + * include/_mingw.h (__MINGW_ATTRIB_DEPRECATED): Define. + (__MINGW_IMPORT): Ansify. + * include/stdlib.h (_sleep, _beep, _seterrormode): Add + __MINGW_ATTRIB_DEPRECATED. + +2006-09-10 Keith Marshall <kei...@us...> + + * aclocal.m4 (LIB_AC_PROG_CC, LIB_AC_PROG_CC_GNU, LIB_AC_PROG_CXX): + Redundant macros; deleted. + + * configure.in (LIB_AC_PROG_CC): Replaced by... + (AC_PROG_CC): ...this. + + * configure: Regenerated. + +2006-09-06 Danny Smith <dan...@us...> + + * mingwex/gdtoa/misc.c (pow5mult): Restore original code. + * mingwex/gdtoa/gdtoa.h. Add comment that files have been modified. + * mingwex/gdtoa/gdtoaimp.h: Include system headers with <> brackets. + +2006-09-01 Danny Smith <dan...@us...> + + * mingwex/gdtoa/(arithchk.c, dmisc.c, dtoa.c, g__fmt.c, g_dfmt.c, + g_ffmt.c, g_xfmt.c, gd_arith.h, gd_qnan.h, gdtoa.c, gdtoa.h, + gdtoaimp.h, gethex.c, gmisc.c, hd_init.c, hexnan.c, misc.c, qnan.c, + README, smisc.c, strtodg.c, strtodnrp.c, strtof.c, strtopx.c, sum.c, + ulp.c): New files. + * mingwex/(strtof.c, strtold.c, ldtoa.c): Remove files. + * mingwex/math/(cephes-emath.c, cephes-emath.h): Remove files. + * mingwex/mb_wc_common.h (get_cp_from_locale); Rename to get_codepage(). + * mingwex/(btowc.c, wctob.c, mbrtowc.c, wcrtomb.c): Adjust call to get_codepage(). + * mingwex/wcstold.c: Avoid using strtold internals. + * mingwex/wcstof.c: Rewrite. + * mingwex/Makefile.in (GDTOA_DISTFILES): Add to distribution. + (GDTOA_OBJS): Add to library. + (DISTFILES): Remove strtof.c strtold.c ldtoa.c cephes-emath.c cephes-emath.h. + (STDLIB_OBJS): Remove. + (STDLIB_STUB_OBJS): Remove strtof.o wcstof,o. + (Q8_OBJS): Add wcstof.o wcstold.o. + * include/stdlib.h (strtof): Remove inline definition. + (wcstof): Likewise. + * include/wchar.h (wcstof): Remove inline definition. + +2006-08-30 Corinna Vinschen <co...@vi...> + + * Makefile.in: Add with_cross_host to allow more granular checks. + Set installation directories accordingly. Override CC setting only + if building a Cygwin target. + * aclocal.m4: Regenerate. + * configure.in: Move AC_CANONICAL_SYSTEM check up. Add + GCC_NO_EXECUTABLES. Substitute with_cross_host in depending files. + Test AC_ALLOCA only if building on a native system. + * configure: Regenerate. + +2006-08-27 Chris Sutcliffe <ir0...@us...> + + * include/ctype.h: Fix typo. + +2006-08-25 Danny Smith <dan...@us...> + + * include/ctype.h: Expose iswblank if __cplusplus. + * include/wctype.h: Expose iswblank if __cplusplus. + 2006-08-03 Danny Smith <dan...@us...> * include/ctype.h: Remove stray ')'; @@ -539,7 +710,6 @@ (mainCRTStartup): Change return to void. (WinMainCRTStartup): Likewise. - 2004-08-15 Danny Smith <dan...@us...> * profile/COPYING: New file. Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-04 23:30:24 UTC (rev 885) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-05 02:15:18 UTC (rev 886) @@ -1,3 +1,8 @@ +2007-02-05 Pedro Alves <ped...@po...> + + Update from upstream. Note: Upstream version is now 3.11. + * configure: Regenerate. + 2007-02-04 Pedro Alves <ped...@po...> * Makefile.in (LIBS): Add $(LIBM_A). Modified: trunk/cegcc/src/mingw/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/Makefile.in 2007-02-04 23:30:24 UTC (rev 885) +++ trunk/cegcc/src/mingw/Makefile.in 2007-02-05 02:15:18 UTC (rev 886) @@ -18,7 +18,7 @@ # This makefile requires GNU make. PACKAGE = mingw-runtime -VERSION = 3.10 +VERSION = @PACKAGE_VERSION@ CYGRELEASE = 1 VPATH = @srcdir@ @@ -28,6 +28,7 @@ host_alias = @host_alias@ build_alias = @build_alias@ target_alias = @target_alias@ +with_cross_host = @with_cross_host@ prefix = @prefix@ conf_prefix = @prefix@ @@ -59,12 +60,19 @@ inst_libdir:=$(tooldir)/lib inst_docdir:=$(prefix)/share/doc/mingw-runtime else +ifneq (,$(with_cross_host)) +inst_bindir:=$(tooldir)/bin +inst_includedir:=$(tooldir)/include +inst_libdir:=$(tooldir)/lib +inst_docdir:=$(tooldir)/share/doc/mingw-runtime +else inst_bindir:=$(bindir) inst_includedir:=$(includedir) inst_libdir:=$(libdir) inst_docdir:=$(prefix)/doc/mingw-runtime endif endif +endif # The Mingw headers are installed under a subdirectory of # $(tooldir)/include when configuring in Cygwin. @@ -78,7 +86,9 @@ mkinstalldirs = $(SHELL) @MKINSTALLDIRS@ CC := @CC@ +ifneq (,$(findstring cygwin,$(target_alias))) override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}} +endif # FIXME: Which is it, CC or CC_FOR_TARGET? CC_FOR_TARGET = $(CC) AS_FOR_TARGET = $(AS) @@ -205,14 +215,14 @@ SRCDIST_FILES = CRT_noglob.c CRTfmode.c CRTglob.c CRTinit.c ChangeLog \ Makefile.in README TODO config.guess config.sub configure configure.in \ -crt1.c crtdll.def crtmt.c crtst.c dllcrt1.c dllmain.c \ +aclocal.m4 crt1.c crtdll.def crtmt.c crtst.c dllcrt1.c dllmain.c \ gccmain.c init.c install-sh jamfile main.c mkinstalldirs \ moldname.def.in msvcrt.def.in \ mthr.c mthr_init.c mthr_stub.c readme.txt \ isascii.c iscsym.c iscsymf.c toascii.c \ strcasecmp.c strncasecmp.c wcscmpi.c \ CRT_fp8.c CRT_fp10.c test_headers.c txtmode.c binmode.c pseudo-reloc.c \ -pseudo-reloc-list.c cpu_features.c cpu_features.h\ +pseudo-reloc-list.c cpu_features.c cpu_features.h \ DISCLAIMER CONTRIBUTORS Modified: trunk/cegcc/src/mingw/aclocal.m4 =================================================================== --- trunk/cegcc/src/mingw/aclocal.m4 2007-02-04 23:30:24 UTC (rev 885) +++ trunk/cegcc/src/mingw/aclocal.m4 2007-02-05 02:15:18 UTC (rev 886) @@ -1,875 +1,97 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p6 +# aclocal.m4 for MinGW Runtime package. -*- Autoconf -*- +# +# This provides configure definitions used by all the winsup +# configure.in files. -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. +# MINGW_AC_CONFIG_SRCDIR( VERSION_TAG, UNIQUE_FILE ) +# -------------------------------------------------- +# Wrapper for AC_CONFIG_SRCDIR; in addition to checking for a +# unique file reference within the source tree, it resolves the +# definition for PACKAGE_VERSION, based on a tagged definition +# within that file, and adjusts PACKAGE_TARNAME to match. +# +AC_DEFUN([MINGW_AC_CONFIG_SRCDIR], +[AC_CONFIG_SRCDIR([$2]) + AC_MSG_CHECKING([package version]) + PACKAGE_VERSION=`awk '$[2] == "'"$1"'" { print $[3] }' ${srcdir}/$2` + PACKAGE_TARNAME=${PACKAGE_NAME}-${PACKAGE_VERSION} + AC_MSG_RESULT([$PACKAGE_VERSION])dnl +]) #MINGW_AC_CONFIG_SRCDIR -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. +# The following is copied from `no-executables.m4', in the top +# `src/config' directory. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# lib-prefix.m4 serial 4 (gettext-0.14.2) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. -dnl From Bruno Haible. +# GCC_NO_EXECUTABLES +# ----------------- +# FIXME: The GCC team has specific needs which the current Autoconf +# framework cannot solve elegantly. This macro implements a dirty +# hack until Autoconf is able to provide the services its users +# need. +# +# Several of the support libraries that are often built with GCC can't +# assume the tool-chain is already capable of linking a program: the +# compiler often expects to be able to link with some of such +# libraries. +# +# In several of these libraries, workarounds have been introduced to +# avoid the AC_PROG_CC_WORKS test, that would just abort their +# configuration. The introduction of AC_EXEEXT, enabled either by +# libtool or by CVS autoconf, have just made matters worse. +# +# Unlike the previous AC_NO_EXECUTABLES, this test does not +# disable link tests at autoconf time, but at configure time. +# This allows AC_NO_EXECUTABLES to be invoked conditionally. +AC_DEFUN_ONCE([GCC_NO_EXECUTABLES], +[m4_divert_push([KILL]) -dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and -dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't -dnl require excessive bracketing. -ifdef([AC_HELP_STRING], -[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], -[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) +AC_BEFORE([$0], [_AC_COMPILER_EXEEXT]) +AC_BEFORE([$0], [AC_LINK_IFELSE]) -dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed -dnl to access previously installed libraries. The basic assumption is that -dnl a user will want packages to use other packages he previously installed -dnl with the same --prefix option. -dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate -dnl libraries, but is otherwise very convenient. -AC_DEFUN([AC_LIB_PREFIX], -[ - AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib-prefix], -[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib - --without-lib-prefix don't search for libraries in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - if test $use_additional = yes; then - dnl Potentially add $additional_includedir to $CPPFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's already present in $CPPFLAGS, - dnl 3. if it's /usr/local/include and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - for x in $CPPFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $CPPFLAGS. - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" - fi - fi - fi - fi - dnl Potentially add $additional_libdir to $LDFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's already present in $LDFLAGS, - dnl 3. if it's /usr/local/lib and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - for x in $LDFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LDFLAGS. - LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" - fi - fi - fi - fi - fi -]) - -dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, -dnl acl_final_exec_prefix, containing the values to which $prefix and -dnl $exec_prefix will expand at the end of the configure script. -AC_DEFUN([AC_LIB_PREPARE_PREFIX], -[ - dnl Unfortunately, prefix and exec_prefix get only finally determined - dnl at the end of configure. - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" -]) - -dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the -dnl variables prefix and exec_prefix bound to the values they will have -dnl at the end of the configure script. -AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], -[ - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - $1 - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" -]) - -# lib-link.m4 serial 6 (gettext-0.14.3) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_PREREQ(2.50) - -dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and -dnl augments the CPPFLAGS variable. -AC_DEFUN([AC_LIB_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - ac_cv_lib[]Name[]_libs="$LIB[]NAME" - ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" - ac_cv_lib[]Name[]_cppflags="$INC[]NAME" - ]) - LIB[]NAME="$ac_cv_lib[]Name[]_libs" - LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" - INC[]NAME="$ac_cv_lib[]Name[]_cppflags" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the - dnl results of this search when this library appears as a dependency. - HAVE_LIB[]NAME=yes - undefine([Name]) - undefine([NAME]) -]) - -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) -dnl searches for libname and the libraries corresponding to explicit and -dnl implicit dependencies, together with the specified include files and -dnl the ability to compile and link the specified testcode. If found, it -dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and -dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and -dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs -dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. -AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - - dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - - dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, - dnl because if the user has installed lib[]Name and not disabled its use - dnl via --without-lib[]Name-prefix, he wants to use it. - ac_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - - AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ - ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIB[]NAME" - AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) - LIBS="$ac_save_LIBS" - ]) - if test "$ac_cv_lib[]Name" = yes; then - HAVE_LIB[]NAME=yes - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) - AC_MSG_CHECKING([how to link with lib[]$1]) - AC_MSG_RESULT([$LIB[]NAME]) - else - HAVE_LIB[]NAME=no - dnl If $LIB[]NAME didn't lead to a usable library, we don't need - dnl $INC[]NAME either. - CPPFLAGS="$ac_save_CPPFLAGS" - LIB[]NAME= - LTLIB[]NAME= - fi - AC_SUBST([HAVE_LIB]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - undefine([Name]) - undefine([NAME]) -]) - -dnl Determine the platform dependent parameters needed to use rpath: -dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -dnl hardcode_direct, hardcode_minus_L. -AC_DEFUN([AC_LIB_RPATH], -[ - dnl Tell automake >= 1.10 to complain if config.rpath is missing. - m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) - AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS - AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld - AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host - AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - ]) - wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" - dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE(rpath, - [ --disable-rpath do not hardcode runtime library paths], - :, enable_rpath=yes) -]) - -dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. -AC_DEFUN([AC_LIB_LINKFLAGS_BODY], -[ - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib$1-prefix], -[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib - --without-lib$1-prefix don't search for lib$1 in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - dnl Search the library and its dependencies in $additional_libdir and - dnl $LDFLAGS. Using breadth-first-seach. - LIB[]NAME= - LTLIB[]NAME= - INC[]NAME= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='$1 $2' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - dnl See if it was already located by an earlier AC_LIB_LINKFLAGS - dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" - else - dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined - dnl that this library doesn't exist. So just drop it. - : - fi - else - dnl Search the library lib$name in $additional_libdir and $LDFLAGS - dnl and the already constructed $LIBNAME/$LTLIBNAME. - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - dnl Found the library. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - dnl Linking with a shared library. We attempt to hardcode its - dnl directory into the executable's runpath, unless it's the - dnl standard /usr/lib. - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then - dnl No hardcoding is needed. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - dnl The hardcoding into $LIBNAME is system dependent. - if test "$hardcode_direct" = yes; then - dnl Using DIR/libNAME.so during linking hardcodes DIR into the - dnl resulting binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - dnl Rely on "-L$found_dir". - dnl But don't add it if it's already contained in the LDFLAGS - dnl or the already constructed $LIBNAME - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH - dnl here, because this doesn't fit in flags passed to the - dnl compiler. So give up. No hardcoding. This affects only - dnl very old systems. - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - dnl Linking with a static library. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" - else - dnl We shouldn't come here, but anyway it's good to have a - dnl fallback. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" - fi - fi - dnl Assume the include files are nearby. - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - dnl Potentially add $additional_includedir to $INCNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's /usr/local/include and we are using GCC on Linux, - dnl 3. if it's already present in $CPPFLAGS or the already - dnl constructed $INCNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INC[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $INCNAME. - INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - dnl Look for dependencies. - if test -n "$found_la"; then - dnl Read the .la file. It defines the variables - dnl dlname, library_names, old_library, dependency_libs, current, - dnl age, revision, installed, dlopen, dlpreopen, libdir. - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - dnl We use only dependency_libs. - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's /usr/local/lib and we are using GCC on Linux, - dnl 3. if it's already present in $LDFLAGS or the already - dnl constructed $LIBNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LIBNAME. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LTLIBNAME. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - dnl Handle this in the next round. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - dnl Handle this in the next round. Throw away the .la's - dnl directory; it is already contained in a preceding -L - dnl option. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - dnl Most likely an immediate library name. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" - ;; - esac - done - fi - else - dnl Didn't find the library; assume it is in the system directories - dnl known to the linker and runtime loader. (All the system - dnl directories known to the linker should also be known to the - dnl runtime loader, otherwise the system is severely misconfigured.) - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then - dnl Weird platform: only the last -rpath option counts, the user must - dnl pass all path elements in one option. We can arrange that for a - dnl single library, but not when more than one $LIBNAMEs are used. - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - else - dnl The -rpath options are cumulative. - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - dnl When using libtool, the option that works for both libraries and - dnl executables is -R. The -R options are cumulative. - for found_dir in $ltrpathdirs; do - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" - done - fi -]) - -dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, -dnl unless already present in VAR. -dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes -dnl contains two or three consecutive elements that belong together. -AC_DEFUN([AC_LIB_APPENDTOVAR], -[ - for element in [$2]; do - haveit= - for x in $[$1]; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - [$1]="${[$1]}${[$1]:+ }$element" - fi - done -]) - -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. - -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. -AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - acl_cv_prog_gnu_ld=yes ;; -*) - acl_cv_prog_gnu_ld=no ;; -esac]) -with_gnu_ld=$acl_cv_prog_gnu_ld -]) - -dnl From libtool-1.4. Sets the variable LD. -AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) +m4_define([_AC_COMPILER_EXEEXT], +AC_LANG_CONFTEST([AC_LANG_PROGRAM()]) +# FIXME: Cleanup? +AS_IF([AC_TRY_EVAL(ac_link)], [gcc_no_link=no], [gcc_no_link=yes]) +if test x$gcc_no_link = xyes; then + # Setting cross_compile will disable run tests; it will + # also disable AC_CHECK_FILE but that's generally + # correct if we can't link. + cross_compiling=yes + EXEEXT= else - AC_MSG_CHECKING([for non-GNU ld]) + m4_defn([_AC_COMPILER_EXEEXT])dnl fi -AC_CACHE_VAL(acl_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$acl_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) +) + +m4_define([AC_LINK_IFELSE], +if test x$gcc_no_link = xyes; then + AC_MSG_ERROR([Link tests are not allowed after [[$0]].]) fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_LIB_PROG_LD_GNU -]) +m4_defn([AC_LINK_IFELSE])) -dnl This provides configure definitions used by all the winsup -dnl configure.in files. - -# FIXME: We temporarily define our own version of AC_PROG_CC. This is -# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We -# are probably using a cross compiler, which will not be able to fully -# link an executable. This should really be fixed in autoconf -# itself. - -AC_DEFUN([LIB_AC_PROG_CC_GNU], -[AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc, -[dnl The semicolon is to pacify NeXT's syntax-checking cpp. -cat > conftest.c <<EOF -#ifdef __GNUC__ - yes; -#endif -EOF -if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi])]) - -AC_DEFUN([LIB_AC_PROG_CC], -[AC_BEFORE([$0], [AC_PROG_CPP])dnl -AC_CHECK_TOOL(CC, gcc, gcc) -: ${CC:=gcc} -AC_PROG_CC -test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -]) - -AC_DEFUN([LIB_AC_PROG_CXX], -[AC_BEFORE([$0], [AC_PROG_CPP])dnl -AC_CHECK_TOOL(CXX, g++, g++) -if test -z "$CXX"; then - AC_CHECK_TOOL(CXX, g++, c++, , , ) - : ${CXX:=g++} - AC_PROG_CXX - test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +dnl This is a shame. We have to provide a default for some link tests, +dnl similar to the default for run tests. +m4_define([AC_FUNC_MMAP], +if test x$gcc_no_link = xyes; then + if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then + ac_cv_func_mmap_fixed_mapped=no + fi fi +if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then + m4_defn([AC_FUNC_MMAP]) +fi) -CXXFLAGS='$(CFLAGS)' -]) +m4_divert_pop()dnl +])# GCC_NO_EXECUTABLES +# $RCSfile: aclocal.m4,v $: end of file: vim: ft=config Modified: trunk/cegcc/src/mingw/configure =================================================================== --- trunk/cegcc/src/mingw/configure 2007-02-04 23:30:24 UTC (rev 885) +++ trunk/cegcc/src/mingw/configure 2007-02-05 02:15:18 UTC (rev 886) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. +# Generated by GNU Autoconf 2.59 for mingw-runtime __MINGW32_VERSION. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -265,15 +265,15 @@ : ${ac_max_here_lines=38} # Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= +PACKAGE_NAME='mingw-runtime' +PACKAGE_TARNAME='mingw-runtime' +PACKAGE_VERSION='__MINGW32_VERSION' +PACKAGE_STRING='mingw-runtime __MINGW32_VERSION' +PACKAGE_BUGREPORT='' -ac_unique_file="dllmain.c" -ac_subdirs_all="$ac_subdirs_all profile mingwex" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC ac_ct_CC CFLAGS LDFLAGS CPPFLAGS EXEEXT OBJEXT all_dlls_host install_dlls_host AR ac_ct_AR AS ac_ct_AS RANLIB ac_ct_RANLIB LD ac_ct_LD DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP WINDRES ac_ct_WINDRES ALLOCA CPP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os subdirs MKINSTALLDIRS MNO_CYGWIN THREAD_DLL LIBM_A LIBGMON_A HEADER_SUBDIR W32API_INCLUDE DLL_ENTRY MINGWEX_DIR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LIBOBJS LTLIBOBJS' +ac_unique_file="include/_mingw.h" +ac_subdirs_all="$ac_subdirs_all mingwex" +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT with_cross_host all_dlls_host install_dlls_host AR ac_ct_AR AS ac_ct_AS RANLIB ac_ct_RANLIB LD ac_ct_LD DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP WINDRES ac_ct_WINDRES subdirs THREAD_DLL MKINSTALLDIRS MNO_CYGWIN LIBM_A LIBGMON_A HEADER_SUBDIR W32API_INCLUDE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -730,10 +730,6 @@ ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP # # Report the --help message. @@ -742,7 +738,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. +\`configure' configures mingw-runtime __MINGW32_VERSION to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -803,7 +799,9 @@ fi if test -n "$ac_init_help"; then - + case $ac_init_help in + short | recursive ) echo "Configuration of mingw-runtime __MINGW32_VERSION:";; + esac cat <<\_ACEOF Some influential environment variables: @@ -813,7 +811,6 @@ nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> - CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -906,13 +903,15 @@ else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd "$ac_popdir" + cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF +mingw-runtime configure __MINGW32_VERSION +generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -925,7 +924,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by $as_me, which was +It was created by mingw-runtime $as_me __MINGW32_VERSION, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1254,87 +1253,129 @@ -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + + + + + + + + + echo "$as_me:$LINENO: checking package version" >&5 +echo $ECHO_N "checking package version... $ECHO_C... [truncated message content] |
From: <ped...@us...> - 2007-03-26 22:55:47
|
Revision: 912 http://svn.sourceforge.net/cegcc/?rev=912&view=rev Author: pedroalves Date: 2007-03-26 15:55:45 -0700 (Mon, 26 Mar 2007) Log Message: ----------- * mingwex/Makefile.in (LIBS): Add libcoredll.a. (libcoredll.a): Add dependencies rule. * coredll.def: Add 'keep in sync' warning. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/Makefile.in Added Paths: ----------- trunk/cegcc/src/mingw/coredll.def Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-03-26 22:29:14 UTC (rev 911) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-03-26 22:55:45 UTC (rev 912) @@ -1,3 +1,9 @@ +2007-03-26 Pedro Alves <ped...@po...> + + * mingwex/Makefile.in (LIBS): Add libcoredll.a. + (libcoredll.a): Add dependencies rule. + * coredll.def: Add 'keep in sync' warning. + 2007-02-24 Pedro Alves <ped...@po...> * mingwex/Makefile.in (STDIO_OBJS_CE): New. Modified: trunk/cegcc/src/mingw/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/Makefile.in 2007-03-26 22:29:14 UTC (rev 911) +++ trunk/cegcc/src/mingw/Makefile.in 2007-03-26 22:55:45 UTC (rev 912) @@ -190,7 +190,8 @@ strcasecmp.o strncasecmp.o wcscmpi.o ifneq (,$(findstring wince,$(target_alias))) -LIBS = libmingw32.a \ +LIBS = libcoredll.a \ + libmingw32.a \ libceoldname.a \ $(LIBM_A) \ libmingwthrd.a @@ -494,6 +495,7 @@ # # Dependancies # +libcoredll.a: coredll.def libcrtdll.a: crtdll.def libmsvcrt.a: msvcrt.def libmsvcrtd.a: msvcrtd.def Copied: trunk/cegcc/src/mingw/coredll.def (from rev 885, trunk/cegcc/src/w32api/libce/coredll.def) =================================================================== --- trunk/cegcc/src/mingw/coredll.def (rev 0) +++ trunk/cegcc/src/mingw/coredll.def 2007-03-26 22:55:45 UTC (rev 912) @@ -0,0 +1,1659 @@ +; PLEASE KEEP THE MINGW/COREDLL.DEF AND W32API/LIBCE/COREDLL.DEF +; FILES IN SYNC. + +LIBRARY COREDLL +EXPORTS +AFS_CloseAllFileHandles +AFS_CreateDirectoryW +AFS_CreateFileW +AFS_DeleteFileW +AFS_FindFirstChangeNotificationW +AFS_FindFirstFileW +AFS_GetDiskFreeSpace +AFS_GetFileAttributesW +AFS_MoveFileW +AFS_NotifyMountedFS +AFS_PrestoChangoFileName +AFS_RegisterFileSystemFunction +AFS_RemoveDirectoryW +AFS_SetFileAttributesW +AFS_Unmount +A_SHAFinal +A_SHAInit +A_SHAUpdate +AbortDoc +AccessibilitySoundSentryEvent +ActivateDevice +ActivateDeviceEx +ActivateKeyboardLayout +ActivateService +AddEventAccess +AddFontResourceW +AddTrackedItem +AdjustWindowRectEx +AdvertiseInterface +AllKeys +AllocPhysMem +AppendMenuW +AttachDebugger +AudioUpdateFromRegistry +BatteryDrvrGetLevels +BatteryDrvrSupportsChangeNotification +BatteryGetLifeTimeInfo +BatteryNotifyOfTimeChange +BeginDeferWindowPos +BeginPaint +BinaryCompress +BinaryDecompress +BitBlt +BringWindowToTop +CacheRangeFlush +CacheSync +CallNextHookEx +CallWindowProcW +CeChangeDatabaseLCID +CeClearReplChangeBitsEx +CeClearUserNotification +CeCreateDatabase +CeCreateDatabaseEx +CeCreateDatabaseEx2 +CeDeleteDatabase +CeDeleteDatabaseEx +CeDeleteRecord +CeEnumDBVolumes +CeEventHasOccurred +CeFindFirstDatabase +CeFindFirstDatabaseEx +CeFindNextDatabase +CeFindNextDatabaseEx +CeFlushDBVol +CeFreeNotification +CeGenRandom +CeGetCallerTrust +CeGetCurrentTrust +CeGetDBInformationByHandle +CeGetFileNotificationInfo +CeGetRandomSeed +CeGetReplChangeBitsEx +CeGetReplChangeMask +CeGetReplOtherBitsEx +CeGetThreadPriority +CeGetThreadQuantum +CeGetUserNotification +CeGetUserNotificationHandles +CeGetUserNotificationPreferences +CeHandleAppNotifications +CeLogData +CeLogGetZones +CeLogReSync +CeLogSetZones +CeMapArgumentArray +CeModuleJit +CeMountDBVol +CeOidGetInfo +CeOidGetInfoEx +CeOidGetInfoEx2 +CeOpenDatabase +CeOpenDatabaseEx +CeOpenDatabaseEx2 +CeReadRecordProps +CeReadRecordPropsEx +CeRegisterFileSystemNotification +CeRegisterReplNotification +CeRemoveFontResource +CeResyncFilesys +CeRunAppAtEvent +CeRunAppAtTime +CeSeekDatabase +CeSeekDatabaseEx +CeSetDatabaseInfo +CeSetDatabaseInfoEx +CeSetDatabaseInfoEx2 +CeSetExtendedPdata +CeSetPowerOnEvent +CeSetProcessVersion +CeSetReplChangeBitsEx +CeSetReplChangeMask +CeSetReplOtherBitsEx +CeSetThreadPriority +CeSetThreadQuantum +CeSetUserNotification +CeSetUserNotificationEx +CeUnmountDBVol +CeWriteRecordProps +CeZeroPointer +ChangeDisplaySettingsEx +CharLowerBuffW +CharLowerW +CharNextW +CharPrevW +CharUpperBuffW +CharUpperW +CheckMenuItem +CheckMenuRadioItem +CheckPassword +CheckRadioButton +ChildWindowFromPoint +ClearCommBreak +ClearCommError +ClientToScreen +ClipCursor +CloseAllDeviceHandles +CloseAllFileHandles +CloseAllServiceHandles +CloseClipboard +CloseEnhMetaFile +CloseHandle +CloseMsgQueue +CloseProcOE +ComThreadBaseFunc +CombineRgn +CompactAllHeaps +CompareFileTime +CompareStringW +ConnectDebugger +ContinueDebugEvent +ConvertDefaultLocale +CopyFileW +CopyRect +CountClipboardFormats +CreateAPIHandle +CreateAPISet +CreateAcceleratorTableW +CreateBitmap +CreateBitmapFromPointer +CreateCaret +CreateCompatibleBitmap +CreateCompatibleDC +CreateCrit +CreateDCW +CreateDIBPatternBrushPt +CreateDIBSection +CreateDeviceHandle +CreateDialogIndirectParamW +CreateDirectoryW +CreateEnhMetaFileW +CreateEventW +CreateFileForMapping +CreateFileForMappingW +CreateFileMappingW +CreateFileW +CreateFontIndirectW +CreateIconIndirect +CreateLocaleView +CreateMenu +CreateMsgQueue +CreateMutexW +CreatePalette +CreatePatternBrush +CreatePen +CreatePenIndirect +CreatePopupMenu +CreateProcessW +CreateRectRgn +CreateRectRgnIndirect +CreateSemaphoreW +CreateServiceHandle +CreateSolidBrush +CreateStaticMapping +CreateThread +CreateWindowExW +CryptAcquireContextW +CryptContextAddRef +CryptCreateHash +CryptDecrypt +CryptDeriveKey +CryptDestroyHash +CryptDestroyKey +CryptDuplicateHash +CryptDuplicateKey +CryptEncrypt +CryptEnumProviderTypesW +CryptEnumProvidersW +CryptExportKey +CryptGenKey +CryptGenRandom +CryptGetDefaultProviderW +CryptGetHashParam +CryptGetKeyParam +CryptGetProvParam +CryptGetUserKey +CryptHashData +CryptHashSessionKey +CryptImportKey +CryptProtectData +CryptReleaseContext +CryptSetHashParam +CryptSetKeyParam +CryptSetProvParam +CryptSetProviderExW +CryptSetProviderW +CryptSignHashW +CryptUnprotectData +CryptVerifySignatureW +DBCanonicalize +DDKReg_GetIsrInfo +DDKReg_GetPciInfo +DDKReg_GetWindowInfo +DeactivateDevice +DebugActiveProcess +DebugNotify +DecompressBinaryBlock +DefDlgProcW +DefWindowProcW +DeferWindowPos +DeleteAndRenameFile +DeleteCriticalSection +DeleteDC +DeleteEnhMetaFile +DeleteFileW +DeleteMenu +DeleteObject +DeleteTrackedItem +DeregisterAFS +DeregisterAFSName +DeregisterDevice +DeregisterService +DestroyAcceleratorTable +DestroyCaret +DestroyIcon +DestroyMenu +DestroyWindow +DeviceIoControl +DevicePowerNotify +DialogBoxIndirectParamW +DisableCaretSystemWide +DisableThreadLibraryCalls +DispatchMessageW +DrawEdge +DrawFocusRect +DrawFrameControl +DrawIconEx +DrawMenuBar +DrawTextW +DumpFileSystemHeap +DumpKCallProfile +DuplicateHandle +Ellipse +EmptyClipboard +EnableCaretSystemWide +EnableEUDC +EnableHardwareKeyboard +EnableMenuItem +EnableWindow +EndDeferWindowPos +EndDialog +EndDoc +EndPage +EndPaint +EnterCriticalSection +EnumCalendarInfoW +EnumClipboardFormats +EnumDateFormatsW +EnumDevices +EnumDisplayDevices +EnumDisplayMonitors +EnumDisplaySettings +EnumFontFamiliesW +EnumFontsW +EnumPnpIds +EnumPropsEx +EnumServices +EnumSystemCodePagesW +EnumSystemLocalesW +EnumTimeFormatsW +EnumUILanguagesW +EnumWindows +EqualRect +EqualRgn +EscapeCommFunction +EventModify +ExcludeClipRect +ExitThread +ExtCreateRegion +ExtEscape +ExtTextOutW +ExtractIconExW +ExtractResource +FileSystemPowerFunction +FileTimeToLocalFileTime +FileTimeToSystemTime +FillRect +FillRgn +FilterTrackedItem +FindClose +FindCloseChangeNotification +FindFirstChangeNotificationW +FindFirstFileExW +FindFirstFileW +FindNextChangeNotification +FindNextFileW +FindResource +FindResourceW +FindWindowW +FlushFileBuffers +FlushInstructionCache +FlushViewOfFile +FlushViewOfFileMaybe +FoldStringW +ForcePageout +FormatMessageW +FreeIntChainHandler +FreeLibrary +FreeLibraryAndExitThread +FreePhysMem +GetACP +GetAPIAddress +GetActiveWindow +GetAssociatedMenu +GetAsyncKeyState +GetAsyncShiftFlags +GetBkColor +GetBkMode +GetCPInfo +GetCRTFlags +GetCRTStorageEx +GetCallStackSnapshot +GetCallerProcess +GetCallerProcessIndex +GetCapture +GetCaretBlinkTime +GetCaretPos +GetCharABCWidths +GetCharWidth32 +GetClassInfoW +GetClassLong +GetClassLongW +GetClassNameW +GetClientRect +GetClipBox +GetClipCursor +GetClipRgn +GetClipboardData +GetClipboardDataAlloc +GetClipboardFormatNameW +GetClipboardOwner +GetCommMask +GetCommModemStatus +GetCommProperties +GetCommState +GetCommTimeouts +GetCommandLineW +GetCurrencyFormatW +GetCurrentFT +GetCurrentObject +GetCurrentPermissions +GetCurrentPositionEx +GetCursor +GetCursorPos +GetDC +GetDCEx +GetDIBColorTable +GetDateFormatW +GetDesktopWindow +GetDeviceByIndex +GetDeviceCaps +GetDeviceKeys +GetDevicePower +GetDialogBaseUnits +GetDiskFreeSpaceExW +GetDlgCtrlID +GetDlgItem +GetDlgItemInt +GetDlgItemTextW +GetDoubleClickTime +GetEventData +GetExitCodeProcess +GetExitCodeThread +GetFSHeapInfo +GetFileAttributesExW +GetFileAttributesW +GetFileInformationByHandle +GetFileSize +GetFileTime +GetFileVersionInfoSizeW +GetFileVersionInfoW +GetFocus +GetForegroundInfo +GetForegroundKeyboardLayoutHandle +GetForegroundKeyboardTarget +GetForegroundWindow +GetHeapSnapshot +GetIdleTime +GetKPhys +GetKeyState +GetKeyboardLayout +GetKeyboardLayoutList +GetKeyboardLayoutNameW +GetKeyboardStatus +GetKeyboardTarget +GetKeyboardType +GetLastError +GetLocalTime +GetLocaleInfoW +GetMenuItemInfoW +GetMessagePos +GetMessageQueueReadyTimeStamp +GetMessageSource +GetMessageW +GetMessageWNoWait +GetModuleFileNameW +GetModuleHandleW +GetModuleInformation +GetMonitorInfo +GetMouseMovePoints +GetMsgQueueInfo +GetNearestColor +GetNearestPaletteIndex +GetNextDlgGroupItem +GetNextDlgTabItem +GetNumberFormatW +GetOEMCP +GetObjectType +GetObjectW +GetOpenClipboardWindow +GetOpenFileNameW +GetOwnerProcess +GetPaletteEntries +GetParent +GetPasswordActive +GetPasswordStatus +GetPixel +GetPriorityClipboardFormat +GetPrivateCallbacks +GetProcAddrBits +GetProcAddressA +GetProcAddressW +GetProcFromPtr +GetProcName +GetProcessHeap +GetProcessIDFromIndex +GetProcessIndexFromID +GetProcessVersion +GetProp +GetQueueStatus +GetRealTime +GetRegionData +GetRgnBox +GetRomFileBytes +GetRomFileInfo +GetSaveFileNameW +GetScrollInfo +GetServiceByIndex +GetServiceHandle +GetStdioPathW +GetStockObject +GetStoreInformation +GetStringTypeExW +GetStringTypeW +GetSubMenu +GetSysColor +GetSysColorBrush +GetSystemDefaultLCID +GetSystemDefaultLangID +GetSystemDefaultUILanguage +GetSystemInfo +GetSystemMemoryDivision +GetSystemMetrics +GetSystemPaletteEntries +GetSystemPowerState +GetSystemPowerStatusEx +GetSystemPowerStatusEx2 +GetSystemTime +GetTempFileNameW +GetTempPathW +GetTextAlign +GetTextColor +GetTextExtentExPointW +GetTextFaceW +GetTextMetricsW +GetThreadContext +GetThreadPriority +GetThreadTimes +GetTickCount +GetTimeFormatW +GetTimeZoneInformation +GetUpdateRect +GetUpdateRgn +GetUserDefaultLCID +GetUserDefaultLangID +GetUserDefaultUILanguage +GetUserDirectory +GetUserNameExW +GetVersionEx +GetVersionExW +GetWindow +GetWindowDC +GetWindowLongW +GetWindowRect +GetWindowRgn +GetWindowTextLengthW +GetWindowTextW +GetWindowTextWDirect +GetWindowThreadProcessId +GiveKPhys +GlobalAddAtomW +GlobalDeleteAtom +GlobalFindAtomW +GlobalMemoryStatus +GradientFill +GwesPowerDown +GwesPowerOffSystem +GwesPowerUp +HeapAlloc +HeapAllocTrace +HeapCreate +HeapDestroy +HeapFree +HeapReAlloc +HeapSize +HeapValidate +HideCaret +ImageList_Add +ImageList_AddMasked +ImageList_BeginDrag +ImageList_Copy +ImageList_CopyDitherImage +ImageList_Create +ImageList_Destroy +ImageList_DragEnter +ImageList_DragLeave +ImageList_DragMove +ImageList_DragShowNolock +ImageList_Draw +ImageList_DrawEx +ImageList_DrawIndirect +ImageList_Duplicate +ImageList_EndDrag +ImageList_GetBkColor +ImageList_GetDragImage +ImageList_GetIcon +ImageList_GetIconSize +ImageList_GetImageCount +ImageList_GetImageInfo +ImageList_LoadImage +ImageList_Merge +ImageList_Remove +ImageList_Replace +ImageList_ReplaceIcon +ImageList_SetBkColor +ImageList_SetDragCursorImage +ImageList_SetIconSize +ImageList_SetImageCount +ImageList_SetOverlayImage +ImmAssociateContext +ImmAssociateContextEx +ImmConfigureIMEW +ImmCreateContext +ImmCreateIMCC +ImmDestroyContext +ImmDestroyIMCC +ImmDisableIME +ImmEnableIME +ImmEnumRegisterWordW +ImmEscapeW +ImmGenerateMessage +ImmGetCandidateListCountW +ImmGetCandidateListW +ImmGetCandidateWindow +ImmGetCompositionFontW +ImmGetCompositionStringW +ImmGetCompositionWindow +ImmGetContext +ImmGetConversionListW +ImmGetConversionStatus +ImmGetDefaultIMEWnd +ImmGetDescriptionW +ImmGetGuideLineW +ImmGetHotKey +ImmGetIMCCLockCount +ImmGetIMCCSize +ImmGetIMCLockCount +ImmGetIMEFileNameW +ImmGetImeMenuItemsW +ImmGetKeyboardLayout +ImmGetOpenStatus +ImmGetProperty +ImmGetRegisterWordStyleW +ImmGetStatusWindowPos +ImmGetVirtualKey +ImmIsIME +ImmIsUIMessageW +ImmLockIMC +ImmLockIMCC +ImmNotifyIME +ImmReSizeIMCC +ImmRegisterWordW +ImmReleaseContext +ImmRequestMessageW +ImmSIPanelState +ImmSetCandidateWindow +ImmSetCompositionFontW +ImmSetCompositionStringW +ImmSetCompositionWindow +ImmSetConversionStatus +ImmSetHotKey +ImmSetImeWndIMC +ImmSetOpenStatus +ImmSetStatusWindowPos +ImmSimulateHotKey +ImmUnlockIMC +ImmUnlockIMCC +ImmUnregisterWordW +InSendMessage +InflateRect +InitLocale +InitializeCriticalSection +InputDebugCharW +InsertMenuW +Int_CloseHandle +Int_CreateEventW +Int_HeapAlloc +Int_HeapCreate +Int_HeapDestroy +Int_HeapFree +Int_HeapReAlloc +Int_HeapSize +InterlockedCompareExchange +InterlockedDecrement +InterlockedExchange +InterlockedExchangeAdd +InterlockedIncrement +InterlockedTestExchange +InterruptDisable +InterruptDone +InterruptInitialize +InterruptMask +IntersectClipRect +IntersectRect +InvalidateRect +InvalidateRgn +InvertRect +IsAPIReady +IsBadCodePtr +IsBadPtr +IsBadReadPtr +IsBadWritePtr +IsChild +IsClipboardFormatAvailable +IsDBCSLeadByte +IsDBCSLeadByteEx +IsDialogMessageW +IsEncryptionPermitted +IsExiting +IsPrimaryThread +IsProcessDying +IsProcessorFeaturePresent +IsRectEmpty +IsSystemFile +IsValidCodePage +IsValidLocale +IsWindow +IsWindowEnabled +IsWindowVisible +KernExtractIcons +KernelIoControl +KernelLibIoControl +KeybdGetDeviceInfo +KeybdInitStates +KeybdVKeyToUnicode +KillAllOtherThreads +KillTimer +LCMapStringW +LeaveCritSec +LeaveCriticalSection +LineTo +LoadAcceleratorsW +LoadAnimatedCursor +LoadBitmapW +LoadCursorW +LoadDriver +LoadFSD +LoadFSDEx +LoadIconW +LoadImageW +LoadIntChainHandler +LoadKernelLibrary +LoadKeyboardLayoutW +LoadLibraryExW +LoadLibraryW +LoadMenuW +LoadResource +LoadStringW +LocalAlloc +LocalAllocInProcess +LocalAllocTrace +LocalFileTimeToFileTime +LocalFree +LocalFreeInProcess +LocalReAlloc +LocalSize +LocalSizeInProcess +LockPages +MD5Final +MD5Init +MD5Update +MainThreadBaseFunc +MapCallerPtr +MapDialogRect +MapPtrToProcWithSize +MapPtrToProcess +MapPtrUnsecure +MapViewOfFile +MapVirtualKeyW +MapWindowPoints +MaskBlt +MessageBeep +MessageBoxW +MonitorFromPoint +MonitorFromRect +MonitorFromWindow +MoveFileW +MoveToEx +MoveWindow +MsgWaitForMultipleObjectsEx +MultiByteToWideChar +NKDbgPrintfW +NKTerminateThread +NKvDbgPrintfW +NLedGetDeviceInfo +NLedSetDevice +NotifyForceCleanboot +NotifyWinUserSystem +OffsetRect +OffsetRgn +OpenClipboard +OpenDeviceKey +OpenEventW +OpenMsgQueue +OpenProcess +OtherThreadsRunning +OutputDebugStringW +PPSHRestart +PSLNotify +PageOutModule +PatBlt +PeekMessageW +PegClearUserNotification +PegCreateDatabase +PegDeleteDatabase +PegDeleteRecord +PegFindFirstDatabase +PegFindNextDatabase +PegGetUserNotificationPreferences +PegHandleAppNotifications +PegOidGetInfo +PegOpenDatabase +PegReadRecordProps +PegRemoveFontResource +PegRunAppAtEvent +PegRunAppAtTime +PegSeekDatabase +PegSetDatabaseInfo +PegSetUserNotification +PegWriteRecordProps +PerformCallBack4 +PlayEnhMetaFile +PlaySoundW +Polygon +Polyline +PostKeybdMessage +PostMessageW +PostQuitMessage +PostThreadMessageW +PowerOffSystem +PowerPolicyNotify +PrintTrackedItem +ProcessDetachAllDLLs +ProfileCaptureStatus +ProfileStart +ProfileStartEx +ProfileStop +ProfileSyscall +PtInRect +PtInRegion +PurgeComm +QASetWindowsJournalHook +QAUnhookWindowsJournalHook +QueryAPISetID +QueryInstructionSet +QueryPerformanceCounter +QueryPerformanceFrequency +RaiseException +Random +RasDeleteEntry +RasDevConfigDialogEditW +RasDial +RasEnumConnections +RasEnumDevicesW +RasEnumEntries +RasGetConnectStatus +RasGetDispPhoneNumW +RasGetEapConnectionData +RasGetEapUserData +RasGetEntryDevConfig +RasGetEntryDialParams +RasGetEntryProperties +RasGetLinkStatistics +RasGetProjectionInfoW +RasHangUp +RasHangup +RasIOControl +RasRenameEntry +RasSetEapConnectionData +RasSetEapUserData +RasSetEntryDevConfig +RasSetEntryDialParams +RasSetEntryProperties +RasValidateEntryName +ReadFile +ReadFileWithSeek +ReadMsgQueue +ReadProcessMemory +ReadRegistryFromOEM +RealizePalette +RectInRegion +RectVisible +Rectangle +RectangleAnimation +RedrawWindow +RefreshKernelAlarm +RegCloseKey +RegCopyFile +RegCreateKeyExW +RegDeleteKeyW +RegDeleteValueW +RegEnumKeyExW +RegEnumValueW +RegFlushKey +RegOpenKeyExW +RegOpenProcessKey +RegQueryInfoKeyW +RegQueryValueExW +RegReplaceKey +RegRestoreFile +RegSaveKey +RegSetValueExW +RegisterAFSEx +RegisterAFSName +RegisterAPISet +RegisterClassW +RegisterClipboardFormatW +RegisterDbgZones +RegisterDesktop +RegisterDevice +RegisterHotKey +RegisterPowerRelationship +RegisterSIPanel +RegisterService +RegisterTaskBar +RegisterTaskBarEx +RegisterTrackedItem +RegisterWindowMessageW +ReinitLocale +ReleaseCapture +ReleaseDC +ReleaseMutex +ReleasePowerRelationship +ReleasePowerRequirement +ReleaseSemaphore +RemoteHeapAlloc +RemoteHeapFree +RemoteHeapReAlloc +RemoteHeapSize +RemoteLocalAlloc +RemoteLocalFree +RemoteLocalReAlloc +RemoteLocalSize +RemoveDirectoryW +RemoveFontResourceW +RemoveMenu +RemoveProp +RequestDeviceNotifications +RequestPowerNotifications +ResourceCreateList +ResourceRelease +ResourceRequest +RestoreDC +ResumeThread +RoundRect +SHAddToRecentDocs +SHCreateExplorerInstance +SHCreateShortcut +SHCreateShortcutEx +SHGetFileInfo +SHGetShortcutTarget +SHGetSpecialFolderPath +SHLoadDIBitmap +SHShowOutOfMemory +SaveDC +ScreenToClient +ScrollDC +ScrollWindowEx +SelectClipRgn +SelectObject +SelectPalette +SendDlgItemMessageW +SendInput +SendMessageTimeout +SendMessageW +SendNotifyMessageW +ServiceAddPort +ServiceClosePort +ServiceIoControl +ServiceUnbindPorts +SetACP +SetAbortProc +SetActiveWindow +SetAssociatedMenu +SetBitmapBits +SetBkColor +SetBkMode +SetBrushOrgEx +SetCapture +SetCaretBlinkTime +SetCaretPos +SetClassLong +SetClassLongW +SetCleanRebootFlag +SetClipboardData +SetCommBreak +SetCommMask +SetCommState +SetCommTimeouts +SetCurrentUser +SetCursor +SetCursorPos +SetDIBColorTable +SetDIBitsToDevice +SetDaylightTime +SetDbgZone +SetDevicePower +SetDlgItemInt +SetDlgItemTextW +SetEndOfFile +SetEventData +SetExceptionHandler +SetFileAttributesW +SetFilePointer +SetFileTime +SetFocus +SetForegroundWindow +SetGwesOOMEvent +SetGwesPowerHandler +SetHandleOwner +SetHardwareWatch +SetInterruptEvent +SetKMode +SetKernelAlarm +SetKeyboardTarget +SetLastError +SetLocalTime +SetLocaleInfoW +SetLowestScheduledPriority +SetMenuItemInfoW +SetOEMCP +SetOOMEvent +SetObjectOwner +SetPaletteEntries +SetParent +SetPassword +SetPasswordActive +SetPasswordStatus +SetPixel +SetPowerOffHandler +SetPowerRequirement +SetProcPermissions +SetProp +SetROP2 +SetRealTime +SetRect +SetRectEmpty +SetRectRgn +SetScrollInfo +SetScrollPos +SetScrollRange +SetStdioPathW +SetSysColors +SetSystemDefaultLCID +SetSystemMemoryDivision +SetSystemPowerState +SetSystemTime +SetTextAlign +SetTextColor +SetThreadContext +SetThreadPriority +SetTimeZoneBias +SetTimeZoneInformation +SetTimer +SetUserData +SetUserDefaultLCID +SetUserDefaultUILanguage +SetViewportOrgEx +SetWDevicePowerHandler +SetWindowLongW +SetWindowPos +SetWindowRgn +SetWindowTextW +SetWindowsHookExW +SetupComm +ShellExecuteEx +ShellModalEnd +Shell_NotifyIcon +ShowCaret +ShowCursor +ShowStartupWindow +ShowWindow +SignalStarted +SipEnumIM +SipGetCurrentIM +SipGetInfo +SipRegisterNotification +SipSetCurrentIM +SipSetDefaultRect +SipSetInfo +SipShowIM +SipStatus +SizeofResource +Sleep +SleepTillTick +StartDocW +StartPage +StopDeviceNotifications +StopPowerNotifications +StretchBlt +StretchDIBits +StringCbCatA +StringCbCatExA +StringCbCatExW +StringCbCatNA +StringCbCatNExA +StringCbCatNExW +StringCbCatNW +StringCbCatW +StringCbCopyA +StringCbCopyExA +StringCbCopyExW +StringCbCopyNA +StringCbCopyNW +StringCbCopyW +StringCbLengthA +StringCbLengthW +StringCbPrintfA +StringCbPrintfExA +StringCbPrintfExW +StringCbPrintfW +StringCbVPrintfA +StringCbVPrintfExA +StringCbVPrintfExW +StringCbVPrintfW +StringCchCatA +StringCchCatExA +StringCchCatExW +StringCchCatNA +StringCchCatNExA +StringCchCatNExW +StringCchCatNW +StringCchCatW +StringCchCopyA +StringCchCopyExA +StringCchCopyExW +StringCchCopyNA +StringCchCopyNW +StringCchCopyW +StringCchLengthA +StringCchLengthW +StringCchPrintfA +StringCchPrintfExA +StringCchPrintfExW +StringCchPrintfW +StringCchVPrintfA +StringCchVPrintfExA +StringCchVPrintfExW +StringCchVPrintfW +StringCompress +StringDecompress +SubtractRect +SuspendThread +SystemIdleTimerReset +SystemMemoryLow +SystemParametersInfoW +SystemStarted +SystemTimeToFileTime +THCreateSnapshot +THGrow +TakeCritSec +TerminateProcess +TerminateThread +ThreadAttachAllDLLs +ThreadBaseFunc +ThreadDetachAllDLLs +ThreadExceptionExit +TlsCall +TlsGetValue +TlsSetValue +TouchCalibrate +TrackPopupMenuEx +TranslateAcceleratorW +TranslateCharsetInfo +TranslateMessage +TransmitCommChar +TransparentImage +TryEnterCriticalSection +TurnOffProfiling +TurnOnProfiling +U_rclose +U_rlseek +U_ropen +U_rread +U_rwrite +UnhookWindowsHookEx +UnionRect +UnlockPages +UnmapViewOfFile +UnregisterClassW +UnregisterFunc1 +UnregisterHotKey +UpdateNLSInfo +UpdateNLSInfoEx +UpdateWindow +ValidateRect +ValidateRgn +VerQueryValueW +VerifyAPIHandle +VirtualAlloc +VirtualCopy +VirtualFree +VirtualProtect +VirtualQuery +VirtualSetAttributes +WNetAddConnection3W +WNetCancelConnection2W +WNetCloseEnum +WNetConnectionDialog1W +WNetDisconnectDialog +WNetDisconnectDialog1W +WNetEnumResourceW +WNetGetConnectionW +WNetGetUniversalNameW +WNetGetUserW +WNetOpenEnumW +WaitCommEvent +WaitForDebugEvent +WaitForMultipleObjects +WaitForSingleObject +WideCharToMultiByte +WindowFromPoint +WriteDebugLED +WriteFile +WriteFileWithSeek +WriteMsgQueue +WriteProcessMemory +WriteRegistryToOEM +_CountLeadingOnes +_CountLeadingOnes64 +_CountLeadingSigns +_CountLeadingSigns64 +_CountLeadingZeros +_CountLeadingZeros64 +_CountOneBits +_CountOneBits64 +_HUGE +_InitStdioLib +_MulHigh +_MulUnsignedHigh +_XcptFilter +__C_specific_handler +__CxxFrameHandler +__CxxThrowException +__addd +__adds +__cmpd +__cmps +__divd +__divs +__dtoi +__dtoi64 +__dtos +__dtou +__dtou64 +__eqd +__eqs +__ged +__ges +__gtd +__gts +__i64tod +__i64tos +__itod +__itos +__led +__les +__ltd +__lts +__muld +__muls +__ned +__negd +__negs +__nes +__rt_sdiv +__rt_sdiv10 +__rt_sdiv64by64 +__rt_srem64by64 +__rt_srsh +__rt_udiv +__rt_udiv10 +__rt_udiv64by64 +__rt_urem64by64 +__rt_ursh +__stod +__stoi +__stoi64 +__stou +__stou64 +__strgtold12 +__subd +__subs +__u64tod +__u64tos +__utod +__utos +_abs64 +_atodbl +_atoflt +_atoi64 +_byteswap_uint64 +_byteswap_ulong +_byteswap_ushort +_cabs +_chgsign +_clearfp +_controlfp +_copysign +_ecvt +_fcloseall +_fcvt +_fileno +_finite +_fltused +_flushall +_fpclass +_fpieee_flt +_fpreset +_frnd +_fsqrt +_gcvt +_getstdfilex +_getws +_hypot +_isctype +_isnan +_isnanf +_isunordered +_isunorderedf +_itoa +_itow +_j0 +_j1 +_jn +_ld12tod +_ld12tof +_logb +_lrotl +_lrotr +_ltoa +_ltow +_mbmemset +_memccpy +_memicmp +_msize +_nextafter +_purecall +_putws +_rotl +_rotl64 +_rotr +_rotr64 +_scalb +_setmode +_snprintf +_snwprintf +_statusfp +_strdup +_stricmp +_strlwr +_strnicmp +_strnset +_strrev +_strset +_strupr +_swab +_ultoa +_ultow +_vsnprintf +_vsnwprintf +_wcsdup +_wcsicmp +_wcslwr +_wcsnicmp +_wcsnset +_wcsrev +_wcsset +_wcsupr +_wfdopen +_wfopen +_wfreopen +_wtol +_wtoll +_y0 +_y1 +_yn +abs +acmDriverAdd +acmDriverClose +acmDriverDetails +acmDriverEnum +acmDriverID +acmDriverMessage +acmDriverOpen +acmDriverPriority +acmDriverRemove +acmFilterChoose +acmFilterDetails +acmFilterEnum +acmFilterTagDetails +acmFilterTagEnum +acmFormatChoose +acmFormatDetails +acmFormatEnum +acmFormatSuggest +acmFormatTagDetails +acmFormatTagEnum +acmGetVersion +acmMetrics +acmStreamClose +acmStreamConvert +acmStreamMessage +acmStreamOpen +acmStreamPrepareHeader +acmStreamReset +acmStreamSize +acmStreamUnprepareHeader +acos +asin +atan +atan2 +atof +atoi +atol +calloc +ceil +ceilf +clearerr +cos +cosh +difftime +div +exp +fabs +fabsf +fclose +feof +ferror +fflush +fgetc +fgetpos +fgets +fgetwc +fgetws +floor +floorf +fmod +fmodf +fopen +fprintf +fputc +fputs +fputwc +fputws +fread +free +frexp +fscanf +fseek +fsetpos +ftell +fwprintf +fwrite +fwscanf +getchar +gets +getwchar +iswctype +keybd_event +labs +ldexp +ldiv +lineAccept +lineAddProvider +lineAddToConference +lineAnswer +lineBlindTransfer +lineClose +lineCompleteTransfer +lineConfigDialogEdit +lineDeallocateCall +lineDevSpecific +lineDial +lineDrop +lineForward +lineGenerateDigits +lineGenerateTone +lineGetAddressCaps +lineGetAddressID +lineGetAddressStatus +lineGetAppPriority +lineGetCallInfo +lineGetCallStatus +lineGetConfRelatedCalls +lineGetDevCaps +lineGetDevConfig +lineGetID +lineGetIcon +lineGetLineDevStatus +lineGetMessage +lineGetNewCalls +lineGetNumRings +lineGetProviderList +lineGetStatusMessages +lineGetTranslateCaps +lineHandoff +lineHold +lineInitialize +lineInitializeEx +lineMakeCall +lineMonitorDigits +lineMonitorMedia +lineNegotiateAPIVersion +lineNegotiateExtVersion +lineOpen +linePickup +linePrepareAddToConference +lineRedirect +lineReleaseUserUserInfo +lineRemoveFromConference +lineSendUserUserInfo +lineSetAppPriority +lineSetCallParams +lineSetCallPrivilege +lineSetCurrentLocation +lineSetDevConfig +lineSetMediaMode +lineSetNumRings +lineSetStatusMessages +lineSetTerminal +lineSetTollList +lineSetupConference +lineSetupTransfer +lineShutdown +lineSwapHold +lineTranslateAddress +lineTranslateDialog +lineUnhold +log +log10 +longjmp +lstrcmpW +lstrcmpiW +malloc +mbstowcs +memchr +memcmp +memcpy +memmove +memset +mixerClose +mixerGetControlDetails +mixerGetDevCaps +mixerGetID +mixerGetLineControls +mixerGetLineInfo +mixerGetNumDevs +mixerMessage +mixerOpen +mixerSetControlDetails +modf +mouse_event +phoneClose +phoneConfigDialog +phoneDevSpecific +phoneGetDevCaps +phoneGetGain +phoneGetHookSwitch +phoneGetID +phoneGetIcon +phoneGetMessage +phoneGetRing +phoneGetStatus +phoneGetStatusMessages +phoneGetVolume +phoneInitializeEx +phoneNegotiateAPIVersion +phoneNegotiateExtVersion +phoneOpen +phoneSetGain +phoneSetHookSwitch +phoneSetRing +phoneSetStatusMessages +phoneSetVolume +phoneShutdown +pow +printf +putchar +puts +putwchar +qsort +rand +realloc +scanf +setjmp +setvbuf +sin +sinh +sndPlaySoundW +sprintf +sqrt +sqrtf +srand +sscanf +strcat +strchr +strcmp +strcpy +strcspn +strlen +strncat +strncmp +strncpy +strpbrk +strrchr +strspn +strstr +strtod +strtok +strtol +strtoul +swprintf +swscanf +tan +tanh +tolower +toupper +towlower +towupper +ungetc +ungetwc +vfprintf +vfwprintf +vprintf +vsprintf +vswprintf +vwprintf +waveInAddBuffer +waveInClose +waveInGetDevCaps +waveInGetErrorText +waveInGetID +waveInGetNumDevs +waveInGetPosition +waveInMessage +waveInOpen +waveInPrepareHeader +waveInReset +waveInStart +waveInStop +waveInUnprepareHeader +waveOutBreakLoop +waveOutClose +waveOutGetDevCaps +waveOutGetErrorText +waveOutGetID +waveOutGetNumDevs +waveOutGetPitch +waveOutGetPlaybackRate +waveOutGetPosition +waveOutGetVolume +waveOutMessage +waveOutOpen +waveOutPause +waveOutPrepareHeader +waveOutReset +waveOutRestart +waveOutSetPitch +waveOutSetPlaybackRate +waveOutSetVolume +waveOutUnprepareHeader +waveOutWrite +wcscat +wcschr +wcscmp +wcscpy +wcscspn +wcslen +wcsncat +wcsncmp +wcsncpy +wcspbrk +wcsrchr +wcsspn +wcsstr +wcstod +wcstok +wcstol +wcstombs +wcstoul +wprintf +wscanf +wsprintfW +wvsprintfW This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-04-19 19:07:40
|
Revision: 916 http://svn.sourceforge.net/cegcc/?rev=916&view=rev Author: pedroalves Date: 2007-04-19 12:07:39 -0700 (Thu, 19 Apr 2007) Log Message: ----------- * moldname.def.in (tempnam): Don't export on coredll.dll. * mingwex/wince/tempnam.c (tempnam): New. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wince/tempnam.c trunk/cegcc/src/mingw/moldname.def.in Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-03-26 23:20:42 UTC (rev 915) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-04-19 19:07:39 UTC (rev 916) @@ -1,3 +1,9 @@ +2007-04-19 Pedro Alves <ped...@po...> + + * moldname.def.in (tempnam): Don't export on + coredll.dll. + * mingwex/wince/tempnam.c (tempnam): New. + 2007-03-26 Pedro Alves <ped...@po...> * mingwex/Makefile.in (LIBS): Add libcoredll.a. Modified: trunk/cegcc/src/mingw/mingwex/wince/tempnam.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/tempnam.c 2007-03-26 23:20:42 UTC (rev 915) +++ trunk/cegcc/src/mingw/mingwex/wince/tempnam.c 2007-04-19 19:07:39 UTC (rev 916) @@ -52,3 +52,9 @@ mbstowcs (wprefix, prefix, MAX_PATH); return tempnam_imp (wdir, wprefix, wcstombs_dup); } + +char * +tempnam (const char *dir, const char *prefix) +{ + return _tempnam (dir, prefix); +} Modified: trunk/cegcc/src/mingw/moldname.def.in =================================================================== --- trunk/cegcc/src/mingw/moldname.def.in 2007-03-26 23:20:42 UTC (rev 915) +++ trunk/cegcc/src/mingw/moldname.def.in 2007-04-19 19:07:39 UTC (rev 916) @@ -130,8 +130,8 @@ swab #ifndef __COREDLL__ tell +tempnam #endif /* __COREDLL__ */ -tempnam #if (__MSVCRT__) timezone DATA #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-05-28 00:22:19
|
Revision: 919 http://svn.sourceforge.net/cegcc/?rev=919&view=rev Author: pedroalves Date: 2007-05-27 17:22:18 -0700 (Sun, 27 May 2007) Log Message: ----------- * moldname.def.in (unlink): Don't export from coredll.dll. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/moldname.def.in Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-05-28 00:21:09 UTC (rev 918) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-05-28 00:22:18 UTC (rev 919) @@ -1,3 +1,7 @@ +2007-05-28 Pedro Alves <ped...@po...> + + * moldname.def.in (unlink): Don't export from coredll.dll. + 2007-04-19 Pedro Alves <ped...@po...> * moldname.def.in (tempnam): Don't export from coredll.dll. Modified: trunk/cegcc/src/mingw/moldname.def.in =================================================================== --- trunk/cegcc/src/mingw/moldname.def.in 2007-05-28 00:21:09 UTC (rev 918) +++ trunk/cegcc/src/mingw/moldname.def.in 2007-05-28 00:22:18 UTC (rev 919) @@ -141,9 +141,6 @@ tzset umask ungetch -#endif /* __COREDLL__ */ -unlink -#ifndef __COREDLL__ utime #endif /* __COREDLL__ */ wcsdup This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-10 13:47:49
|
Revision: 932 http://svn.sourceforge.net/cegcc/?rev=932&view=rev Author: pedroalves Date: 2007-06-09 07:37:30 -0700 (Sat, 09 Jun 2007) Log Message: ----------- * mingwex/wince/time.c (time): Handle NULL input. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wince/time.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-05 21:28:31 UTC (rev 931) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-09 14:37:30 UTC (rev 932) @@ -1,3 +1,7 @@ +2007-06-09 Pedro Alves <ped...@po...> + + * mingwex/wince/time.c (time): Handle NULL input. + 2007-05-28 Pedro Alves <ped...@po...> * moldname.def.in (unlink): Don't export from coredll.dll. Modified: trunk/cegcc/src/mingw/mingwex/wince/time.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/time.c 2007-06-05 21:28:31 UTC (rev 931) +++ trunk/cegcc/src/mingw/mingwex/wince/time.c 2007-06-09 14:37:30 UTC (rev 932) @@ -5,9 +5,10 @@ { SYSTEMTIME s; FILETIME f; + time_t t; if (timer == NULL) - return 0; + timer = &t; GetSystemTime (&s); SystemTimeToFileTime (&s, &f); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-15 00:17:23
|
Revision: 950 http://svn.sourceforge.net/cegcc/?rev=950&view=rev Author: pedroalves Date: 2007-06-14 17:15:47 -0700 (Thu, 14 Jun 2007) Log Message: ----------- * include/stdlib.h [__COREDLL__]: Include stdio.h. * include/stdio.h [__COREDLL__]: Include stdlib.h. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/stdio.h trunk/cegcc/src/mingw/include/stdlib.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-13 20:17:55 UTC (rev 949) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-15 00:15:47 UTC (rev 950) @@ -1,3 +1,8 @@ +2007-06-15 Pedro Alves <ped...@po...> + + * include/stdlib.h [__COREDLL__]: Include stdio.h. + * include/stdio.h [__COREDLL__]: Include stdlib.h. + 2007-06-09 Pedro Alves <ped...@po...> * mingwex/wince/time.c (time): Handle NULL input. Modified: trunk/cegcc/src/mingw/include/stdio.h =================================================================== --- trunk/cegcc/src/mingw/include/stdio.h 2007-06-13 20:17:55 UTC (rev 949) +++ trunk/cegcc/src/mingw/include/stdio.h 2007-06-15 00:15:47 UTC (rev 950) @@ -28,6 +28,12 @@ #include <stdarg.h> #endif /* Not RC_INVOKED */ +#ifdef __COREDLL__ +/* + * On Windows CE, including stdio.h or stdlib.h has the same result. + */ +#include <stdlib.h> +#endif /* Flags for the iobuf structure */ #define _IOREAD 1 /* currently reading */ Modified: trunk/cegcc/src/mingw/include/stdlib.h =================================================================== --- trunk/cegcc/src/mingw/include/stdlib.h 2007-06-13 20:17:55 UTC (rev 949) +++ trunk/cegcc/src/mingw/include/stdlib.h 2007-06-15 00:15:47 UTC (rev 950) @@ -14,6 +14,13 @@ /* All the headers include this file. */ #include <_mingw.h> +#ifdef __COREDLL__ +/* + * On Windows CE, including stdio.h or stdlib.h has the same result. + */ +#include <stdio.h> +#endif + #define __need_size_t #define __need_wchar_t #define __need_NULL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-16 19:52:12
|
Revision: 963 http://svn.sourceforge.net/cegcc/?rev=963&view=rev Author: pedroalves Date: 2007-06-16 12:52:10 -0700 (Sat, 16 Jun 2007) Log Message: ----------- * mingwex/wince/stat.c: Fix whitespacing and formatting throught. (__stat_by_file_info): Don't set _S_IFREG on directories. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wince/stat.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-16 19:18:29 UTC (rev 962) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-16 19:52:10 UTC (rev 963) @@ -1,3 +1,8 @@ +2007-06-16 Pedro Alves <ped...@po...> + + * mingwex/wince/stat.c: Fix whitespacing and formatting throught. + (__stat_by_file_info): Don't set _S_IFREG on directories. + 2007-06-15 Pedro Alves <ped...@po...> * include/stdlib.h [__COREDLL__]: Include stdio.h. Modified: trunk/cegcc/src/mingw/mingwex/wince/stat.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/stat.c 2007-06-16 19:18:29 UTC (rev 962) +++ trunk/cegcc/src/mingw/mingwex/wince/stat.c 2007-06-16 19:52:10 UTC (rev 963) @@ -6,7 +6,7 @@ * No warranty is given; refer to the file DISCLAIMER within the package. * * Written by Pedro Alves <ped...@po...> 10 Feb 2007 - * + * */ #include <windows.h> @@ -42,7 +42,7 @@ } while (0) static int -__stat_by_file_info (struct stat_file_info_t *fi, struct stat* st, int exec) +__stat_by_file_info (struct stat_file_info_t *fi, struct stat *st, int exec) { int permission = _S_IREAD; @@ -52,7 +52,7 @@ st->st_mode = _S_IFREG; if((fi->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) - st->st_mode |= _S_IFDIR | _S_IEXEC; + st->st_mode = _S_IFDIR | _S_IEXEC; else if (exec) permission |= _S_IEXEC; @@ -62,21 +62,21 @@ st->st_mode |= permission | (permission >> 3) | (permission >> 6); st->st_nlink = 1; /* always 1? */ - st->st_rdev = 1; /* Where to get drive info? */ + st->st_rdev = 1; /* Where to get drive info? */ st->st_ino = 0; /* always 0 on Windows */ st->st_mtime = __FILETIME_to_time_t (&fi->ftLastWriteTime); st->st_ctime = __FILETIME_to_time_t (&fi->ftCreationTime); st->st_atime = __FILETIME_to_time_t (&fi->ftLastAccessTime); - /* Looks like the code below is never triggered. + /* Looks like the code below is never triggered. Windows CE always only keeps the LastWriteTime, and copies it to the CreationTime and LastAccessTime fields. */ - if (st->st_ctime == 0) + if (st->st_ctime == 0) st->st_ctime = st->st_mtime; - if (st->st_atime == 0) + if (st->st_atime == 0) { - /* On XP, at least, the st_atime is always set to the same + /* On XP, at least, the st_atime is always set to the same as the st_mtime, except the hour/min/sec == 00:00:00. */ SYSTEMTIME s; FILETIME f = fi->ftLastWriteTime; @@ -90,18 +90,18 @@ return 0; } -int +int fstat (int fd, struct stat *st) { BY_HANDLE_FILE_INFORMATION fi; struct stat_file_info_t sfi; - + GetFileInformationByHandle ((HANDLE)fd, &fi); TO_STAT_FILE_INFO (&sfi, &fi); return __stat_by_file_info (&sfi, st, 0); } -int +int _stat (const char *path, struct _stat *st) { WIN32_FIND_DATAW fd; @@ -125,14 +125,14 @@ TO_STAT_FILE_INFO (&sfi, &fd); len = strlen (path); - exec = (len >= 4 + exec = (len >= 4 && strcasecmp (path + len - 4, ".exe") == 0); ret = __stat_by_file_info (&sfi, (struct stat*)st, exec); FindClose (h); return ret; } -int +int stat (const char *path, struct stat *st) { return _stat (path, (struct _stat *)st); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-24 19:19:18
|
Revision: 990 http://svn.sourceforge.net/cegcc/?rev=990&view=rev Author: pedroalves Date: 2007-06-24 12:19:17 -0700 (Sun, 24 Jun 2007) Log Message: ----------- * mingwex/wince/stat.c (_stat_by_file_info): Change ST param type to struct _stat*. (fstat): Rename to ... (_fstat): ... this. (fstat): New as wrapper around _fstat. (_stat): Remove cast to struct stat*. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wince/stat.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-22 17:15:42 UTC (rev 989) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 19:19:17 UTC (rev 990) @@ -1,3 +1,12 @@ +2007-06-24 Pedro Alves <ped...@po...> + + * mingwex/wince/stat.c (_stat_by_file_info): Change ST param type to + struct _stat*. + (fstat): Rename to ... + (_fstat): ... this. + (fstat): New as wrapper around _fstat. + (_stat): Remove cast to struct stat*. + 2007-06-16 Pedro Alves <ped...@po...> * mingwex/wince/stat.c: Fix whitespacing and formatting throughout. Modified: trunk/cegcc/src/mingw/mingwex/wince/stat.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/stat.c 2007-06-22 17:15:42 UTC (rev 989) +++ trunk/cegcc/src/mingw/mingwex/wince/stat.c 2007-06-24 19:19:17 UTC (rev 990) @@ -42,7 +42,7 @@ } while (0) static int -__stat_by_file_info (struct stat_file_info_t *fi, struct stat *st, int exec) +__stat_by_file_info (struct stat_file_info_t *fi, struct _stat *st, int exec) { int permission = _S_IREAD; @@ -91,7 +91,7 @@ } int -fstat (int fd, struct stat *st) +_fstat (int fd, struct _stat *st) { BY_HANDLE_FILE_INFORMATION fi; struct stat_file_info_t sfi; @@ -102,6 +102,12 @@ } int +fstat (int fd, struct stat *st) +{ + return _fstat (fd, (struct _stat *)st); +} + +int _stat (const char *path, struct _stat *st) { WIN32_FIND_DATAW fd; @@ -127,7 +133,7 @@ len = strlen (path); exec = (len >= 4 && strcasecmp (path + len - 4, ".exe") == 0); - ret = __stat_by_file_info (&sfi, (struct stat*)st, exec); + ret = __stat_by_file_info (&sfi, st, exec); FindClose (h); return ret; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-24 19:31:00
|
Revision: 991 http://svn.sourceforge.net/cegcc/?rev=991&view=rev Author: pedroalves Date: 2007-06-24 12:30:58 -0700 (Sun, 24 Jun 2007) Log Message: ----------- * mingwex/wince/bsearch.c: New file. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/bsearch.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 19:19:17 UTC (rev 990) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 19:30:58 UTC (rev 991) @@ -1,5 +1,9 @@ 2007-06-24 Pedro Alves <ped...@po...> + * mingwex/wince/bsearch.c: New file. + +2007-06-24 Pedro Alves <ped...@po...> + * mingwex/wince/stat.c (_stat_by_file_info): Change ST param type to struct _stat*. (fstat): Rename to ... Added: trunk/cegcc/src/mingw/mingwex/wince/bsearch.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/bsearch.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/bsearch.c 2007-06-24 19:30:58 UTC (rev 991) @@ -0,0 +1,81 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* <wince> */ + +/* bsearch is in both stdlib.h and search.h. We include both + to catch possible differences. */ +#include <stdlib.h> +#include <search.h> +#include <stdint.h> + +/* </wince> */ + + +/* + * Perform a binary search. + * + * The code below is a bit sneaky. After a comparison fails, we + * divide the work in half by moving either left or right. If lim + * is odd, moving left simply involves halving lim: e.g., when lim + * is 5 we look at item 2, so we change lim to 2 so that we will + * look at items 0 & 1. If lim is even, the same applies. If lim + * is odd, moving right again involes halving lim, this time moving + * the base up one item past p: e.g., when lim is 5 we change base + * to item 3 and make lim 2 so that we will look at items 3 and 4. + * If lim is even, however, we have to shrink it by one before + * halving: e.g., when lim is 4, we still looked at item 2, so we + * have to make lim 3, then halve, obtaining 1, so that we will only + * look at item 3. + */ +void * +bsearch(key, base0, nmemb, size, compar) + const void *key; + const void *base0; + size_t nmemb; + size_t size; + int (*compar)(const void *, const void *); +{ + const char *base = base0; + size_t lim; + int cmp; + const void *p; + + for (lim = nmemb; lim != 0; lim >>= 1) { + p = base + (lim >> 1) * size; + cmp = (*compar)(key, p); + if (cmp == 0) + return ((void *)(uintptr_t)p); + if (cmp > 0) { /* key > p: move right */ + base = (const char *)p + size; + lim--; + } /* else move left */ + } + return (NULL); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/bsearch.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-24 19:42:32
|
Revision: 992 http://svn.sourceforge.net/cegcc/?rev=992&view=rev Author: pedroalves Date: 2007-06-24 12:42:31 -0700 (Sun, 24 Jun 2007) Log Message: ----------- * mingwex/wince/findfile.c: New file. * mingwex/wince/chsize.c: New file. * mingwex/wince/access.c: New file. * mingwex/wince/mkdir.c: New file. * mingwex/wince/rmdir.c: New file. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/access.c trunk/cegcc/src/mingw/mingwex/wince/chsize.c trunk/cegcc/src/mingw/mingwex/wince/findfile.c trunk/cegcc/src/mingw/mingwex/wince/mkdir.c trunk/cegcc/src/mingw/mingwex/wince/rmdir.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 19:30:58 UTC (rev 991) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 19:42:31 UTC (rev 992) @@ -1,5 +1,13 @@ 2007-06-24 Pedro Alves <ped...@po...> + * mingwex/wince/findfile.c: New file. + * mingwex/wince/chsize.c: New file. + * mingwex/wince/access.c: New file. + * mingwex/wince/mkdir.c: New file. + * mingwex/wince/rmdir.c: New file. + +2007-06-24 Pedro Alves <ped...@po...> + * mingwex/wince/bsearch.c: New file. 2007-06-24 Pedro Alves <ped...@po...> Added: trunk/cegcc/src/mingw/mingwex/wince/access.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/access.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/access.c 2007-06-24 19:42:31 UTC (rev 992) @@ -0,0 +1,43 @@ +/* This is file ACCESS.C */ +/* + * Copyright (C) 1993 DJ Delorie + * All rights reserved. + * + * Redistribution and use in source and binary forms is permitted + * provided that the above copyright notice and following paragraph are + * duplicated in all such forms. + * + * This file is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* PAlves: + Renamed access to _access, and made a new access + that calls _access. */ + +#include <fcntl.h> +#include <sys/stat.h> +#include <unistd.h> + +int +_access(const char *fn, int flags) +{ + struct stat s; + if (stat(fn, &s)) + return -1; + if (s.st_mode & S_IFDIR) + return 0; + if (flags & W_OK) + { + if (s.st_mode & S_IWRITE) + return 0; + return -1; + } + return 0; +} + +int +access(const char *fn, int flags) +{ + return _access(fn, flags); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/access.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/chsize.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/chsize.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/chsize.c 2007-06-24 19:42:31 UTC (rev 992) @@ -0,0 +1,51 @@ +/* + * chsize.c: _chsize and chsize implementations for WinCE. + * + * This file has no copyright assigned and is placed in the Public + * Domain. This file is a part of the mingw32ce package. No + * warranty is given; refer to the file DISCLAIMER within the package. + * + * Written by Pedro Alves <ped...@po...> 24 Jun 2007 + * + */ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +int +_chsize (int fd, long size) +{ + DWORD cur; + DWORD new; + HANDLE h; + BOOL ret; + + h = (HANDLE) fd; + if (h == INVALID_HANDLE_VALUE) + { + SetLastError (ERROR_INVALID_PARAMETER); + return -1; + } + + cur = SetFilePointer (h, 0, NULL, FILE_CURRENT); + if (cur == 0xffffffff) + return -1; + + /* Move to where we want it. */ + new = SetFilePointer (h, size, NULL, FILE_BEGIN); + if (new == 0xffffffff) + return -1; + + /* And commit it as eof, effectivelly growing or shrinking. */ + ret = SetEndOfFile (h); + + SetFilePointer (h, cur, NULL, FILE_BEGIN); + + return ret ? 0 : -1; +} + +int +chsize (int fd, long size) +{ + return _chsize (fd, size); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/chsize.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/findfile.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/findfile.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/findfile.c 2007-06-24 19:42:31 UTC (rev 992) @@ -0,0 +1,128 @@ +/* + * findfind.c: _findfirst, _findnext, _findclose and the wide + * counterparts implementations for WinCE. + * + * This file has no copyright assigned and is placed in the Public + * Domain. This file is a part of the mingw32ce package. No + * warranty is given; refer to the file DISCLAIMER within the package. + * + * Written by Pedro Alves <ped...@po...> 24 Jun 2007 + * + */ + +#include <stdarg.h> +#include <time.h> +#include <windows.h> +#include <io.h> +#include "timeutil.h" + +static void +wfd_to_fd (const WIN32_FIND_DATAW *wfd, struct _wfinddata_t *fd) +{ + /* Map win32 file attributes to _finddata_t types. The constants + are numerically equal, meaning we could also: + fd->attrib = wfd->dwFileAttributes; + But that would copy too much. + TODO: _A_VOLID isn't mapped. */ + + fd->attrib = 0; + if (wfd->dwFileAttributes & FILE_ATTRIBUTE_NORMAL) + fd->attrib |= _A_NORMAL; + if (wfd->dwFileAttributes & FILE_ATTRIBUTE_READONLY) + fd->attrib |= _A_RDONLY; + if (wfd->dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) + fd->attrib |= _A_HIDDEN; + if (wfd->dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) + fd->attrib |= _A_SYSTEM; + if (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + fd->attrib |= _A_SUBDIR; + if (wfd->dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE) + fd->attrib |= _A_ARCH; + + fd->size = wfd->nFileSizeLow; + wcscpy (fd->name, wfd->cFileName); + + fd->time_access = __FILETIME_to_time_t (&wfd->ftLastAccessTime); + fd->time_create = __FILETIME_to_time_t (&wfd->ftCreationTime); + fd->time_write = __FILETIME_to_time_t (&wfd->ftLastWriteTime); +} + +static void +tofinddataa (struct _finddata_t *fda, const struct _wfinddata_t *fdw) +{ +#define COPY_MEMBER(MEM) do { fda->MEM = fdw->MEM; } while (0) + COPY_MEMBER (attrib); + COPY_MEMBER (time_create); + COPY_MEMBER (time_access); + COPY_MEMBER (time_write); + COPY_MEMBER (size); +#undef COPY_MEMBER + wcstombs (fda->name, fdw->name, FILENAME_MAX); +}; + +int +_findclose (long h) +{ + if (!FindClose ((HANDLE) h)) + return -1; + return 0; +} + +long +_wfindfirst (const wchar_t *filespec, struct _wfinddata_t *f) +{ + WIN32_FIND_DATAW find_data; + HANDLE h; + + h = FindFirstFileW (filespec, &find_data); + if (h == INVALID_HANDLE_VALUE) + return -1; + + wfd_to_fd (&find_data, f); + return (long) h; +} + +long +_findfirst (const char *filespec, struct _finddata_t *f) +{ + wchar_t wfilespec[MAX_PATH]; + struct _wfinddata_t wf; + long h; + + mbstowcs (wfilespec, filespec, MAX_PATH); + + h = _wfindfirst (wfilespec, &wf); + + if (h == -1) + return -1; + + tofinddataa (f, &wf); + return h; +} + +int +_wfindnext (long h, struct _wfinddata_t *f) +{ + WIN32_FIND_DATAW find_data; + + if (!FindNextFileW ((HANDLE) h, &find_data)) + return -1; + + wfd_to_fd (&find_data, f); + return 0; +} + +int +_findnext (long h, struct _finddata_t * f) +{ + struct _wfinddata_t wf; + int ret; + + ret = _wfindnext (h, &wf); + + if (ret == -1) + return -1; + + tofinddataa (f, &wf); + return h; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/findfile.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/mkdir.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/mkdir.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/mkdir.c 2007-06-24 19:42:31 UTC (rev 992) @@ -0,0 +1,29 @@ +/* + * mkdir.c: mkdir implementation for WinCE. + * + * This file has no copyright assigned and is placed in the Public + * Domain. This file is a part of the mingw32ce package. No + * warranty is given; refer to the file DISCLAIMER within the package. + * + * Written by Pedro Alves <ped...@po...> 24 Jun 2007 + * + */ + +#include <windows.h> +#include <io.h> + +int +_mkdir (const char *dirname) +{ + wchar_t dirnamew[MAX_PATH]; + mbstowcs (dirnamew, dirname, MAX_PATH); + if (!CreateDirectoryW (dirnamew, NULL)) + return -1; + return 0; +} + +int +mkdir (const char *dirname) +{ + return _mkdir (dirname); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/mkdir.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/rmdir.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/rmdir.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/rmdir.c 2007-06-24 19:42:31 UTC (rev 992) @@ -0,0 +1,31 @@ +/* + * rmdir.c: rmdir implementation for WinCE. + * + * This file has no copyright assigned and is placed in the Public + * Domain. This file is a part of the mingw32ce package. No + * warranty is given; refer to the file DISCLAIMER within the package. + * + * Written by Pedro Alves <ped...@po...> 24 Jun 2007 + * + */ + +#include <windows.h> +#include <io.h> + +int +rmdir (const char *dirname) +{ + wchar_t dirnamew[MAX_PATH + 1]; + + if (dirname == NULL) + { + SetLastError (ERROR_INVALID_ADDRESS); + return -1; + } + + mbstowcs (dirnamew, dirname, MAX_PATH); + if (!RemoveDirectoryW (dirnamew)) + return -1; + + return 0; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/rmdir.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-24 21:30:38
|
Revision: 993 http://svn.sourceforge.net/cegcc/?rev=993&view=rev Author: pedroalves Date: 2007-06-24 14:30:34 -0700 (Sun, 24 Jun 2007) Log Message: ----------- * mingwex/dirname.c (dirname) [__COREDLL__]: Don't handle drive names. * mingwex/basename.c (basename) [__COREDLL__]: Likewise. * mingwex/wdirent.c (UNICODE_DIRENT): New define. * mingwex/dirent.c [__COREDLL__]: Don't include errno.h or direct.h. (__set_errno): New. (ENOTDIR, EFAULT, EINVAL): Define. (_TDIR, _TCHAR, _T, _topendir, _treaddir, _tclosedir, _trewinddir, _ttelldir, tseekdir, _tfindfirst, _tfindnext, _tcscat, _tcsncpy, _tcslen, _tcscpy, _tcsrchr, _tdirent) [!UNICODE_DIRENT]: Redefine to the non-wide counterparts. (_tGetFileAttributes) [__COREDLL__]: Reimplement for Windows CE. (_topendir): Use __set_errno. Avoid _tfullpath. (_treaddir, _closedir, _trewinddir, _ttelldir, _tseekdir): Use __set_errno. * mingwex/wcstold.c: Don't compile on WinCE. * mingwex/getopt.c [__COREDLL__]: Don't include errno.h. (IS_POSIXLY_CORRECT) [__MINGW32CE__]: Hardcode to 0. * mingwex/gettimeofday.c (gettimeofday) [__COREDLL__]: Replace the GetSystemTimeAsFileTime call with GetSystemTime and SystemTimeToFileTime. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/basename.c trunk/cegcc/src/mingw/mingwex/dirent.c trunk/cegcc/src/mingw/mingwex/dirname.c trunk/cegcc/src/mingw/mingwex/getopt.c trunk/cegcc/src/mingw/mingwex/gettimeofday.c trunk/cegcc/src/mingw/mingwex/wcstold.c trunk/cegcc/src/mingw/mingwex/wdirent.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 19:42:31 UTC (rev 992) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 21:30:34 UTC (rev 993) @@ -1,5 +1,28 @@ 2007-06-24 Pedro Alves <ped...@po...> + * mingwex/dirname.c (dirname) [__COREDLL__]: Don't handle drive names. + * mingwex/basename.c (basename) [__COREDLL__]: Likewise. + * mingwex/wdirent.c (UNICODE_DIRENT): New define. + * mingwex/dirent.c [__COREDLL__]: Don't include errno.h or direct.h. + (__set_errno): New. + (ENOTDIR, EFAULT, EINVAL): Define. + (_TDIR, _TCHAR, _T, _topendir, _treaddir, _tclosedir, _trewinddir, + _ttelldir, tseekdir, _tfindfirst, _tfindnext, _tcscat, _tcsncpy, + _tcslen, _tcscpy, _tcsrchr, _tdirent) [!UNICODE_DIRENT]: Redefine to + the non-wide counterparts. + (_tGetFileAttributes) [__COREDLL__]: Reimplement for Windows CE. + (_topendir): Use __set_errno. Avoid _tfullpath. + (_treaddir, _closedir, _trewinddir, _ttelldir, _tseekdir): Use + __set_errno. + * mingwex/wcstold.c: Don't compile on WinCE. + * mingwex/getopt.c [__COREDLL__]: Don't include errno.h. + (IS_POSIXLY_CORRECT) [__MINGW32CE__]: Hardcode to 0. + * mingwex/gettimeofday.c (gettimeofday) [__COREDLL__]: Replace + the GetSystemTimeAsFileTime call with GetSystemTime and + SystemTimeToFileTime. + +2007-06-24 Pedro Alves <ped...@po...> + * mingwex/wince/findfile.c: New file. * mingwex/wince/chsize.c: New file. * mingwex/wince/access.c: New file. Modified: trunk/cegcc/src/mingw/mingwex/basename.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/basename.c 2007-06-24 19:42:31 UTC (rev 992) +++ trunk/cegcc/src/mingw/mingwex/basename.c 2007-06-24 21:30:34 UTC (rev 993) @@ -37,9 +37,10 @@ /* step over the drive designator, if present ... * (FIXME: maybe should confirm *path is a valid drive designator). */ - +#ifndef __COREDLL__ if( path[1] == ':' ) path += 2; +#endif /* check again, just to ensure we still have a non-empty path name ... */ Modified: trunk/cegcc/src/mingw/mingwex/dirent.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/dirent.c 2007-06-24 19:42:31 UTC (rev 992) +++ trunk/cegcc/src/mingw/mingwex/dirent.c 2007-06-24 21:30:34 UTC (rev 993) @@ -4,35 +4,106 @@ * This file is a part of the mingw-runtime package. * No warranty is given; refer to the file DISCLAIMER within the package. * - * Derived from DIRLIB.C by Matt J. Weinstein + * Derived from DIRLIB.C by Matt J. Weinstein * This note appears in the DIRLIB.H * DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89 * * Updated by Jeremy Bettis <je...@hk...> * Significantly revised and rewinddir, seekdir and telldir added by Colin * Peters <co...@fu...> - * + * */ #include <stdlib.h> +#ifndef __COREDLL__ #include <errno.h> +#endif #include <string.h> #include <io.h> +#ifndef __COREDLL__ #include <direct.h> +#endif #include <dirent.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> /* for GetFileAttributes */ #include <tchar.h> + #define SUFFIX _T("*") #define SLASH _T("\\") +#ifdef __COREDLL__ +/* Pretty safe in this file, since we are only setting errno, and never + reading it. */ +#define __set_errno(ERR) SetLastError (ERR) + +#define ENOTDIR ERROR_DIRECTORY +#define EFAULT ERROR_INVALID_ADDRESS +#define EINVAL ERROR_INVALID_PARAMETER + +#ifndef UNICODE_DIRENT + +/* Windows CE is always UNICODE - work around it. */ +#undef _TDIR +#undef _TCHAR + +#undef _T + +#undef _topendir +#undef _treaddir +#undef _tclosedir +#undef _trewinddir +#undef _ttelldir +#undef _tseekdir + +#undef _tfindfirst +#undef _tfindnext + +#undef _tcscat +#undef _tcsncpy +#undef _tcslen +#undef _tcscpy +#undef _tcsrchr + +#undef _tdirent + +#define _TDIR DIR +#define _TCHAR CHAR + +#define _T(S) S + +#define _topendir opendir +#define _treaddir readdir +#define _tclosedir closedir +#define _trewinddir rewinddir +#define _ttelldir telldir +#define _tseekdir seekdir + +#define _tfindfirst _findfirst +#define _tfindnext _findnext + +#define _tcscat strcat +#define _tcsncpy strncpy +#define _tcslen strlen +#define _tcscpy strcpy +#define _tcsrchr strrchr + +#define _tdirent dirent + +#endif + +#else +#define __set_errno(ERR) do { errno = (ERR); } while (0) +#endif + +#if !defined (__COREDLL__) + /* Helper for opendir(). */ static inline unsigned _tGetFileAttributes (const _TCHAR * tPath) { -#ifdef _UNICODE +#ifdef (_UNICODE) /* GetFileAttributesW does not work on W9x, so convert to ANSI */ if (_osver & 0x8000) { @@ -42,35 +113,51 @@ return GetFileAttributesA (aPath); } return GetFileAttributesW (tPath); -#else +#else /* _UNICODE */ return GetFileAttributesA (tPath); #endif } +#else /* __COREDLL__ */ + +/* Helper for opendir(). */ +static inline unsigned _tGetFileAttributes (const _TCHAR * tPath) +{ +#ifdef UNICODE_DIRENT + return GetFileAttributesW (tPath); +#else + WCHAR wpath[MAX_PATH]; + mbstowcs (wpath, tPath, MAX_PATH); + return GetFileAttributesW (wpath); +#endif +} + +#endif + /* * opendir * * Returns a pointer to a DIR structure appropriately filled in to begin * searching a directory. */ -_TDIR * +_TDIR * _topendir (const _TCHAR *szPath) { _TDIR *nd; unsigned int rc; _TCHAR szFullPath[MAX_PATH]; - - errno = 0; + __set_errno (0); + if (!szPath) { - errno = EFAULT; + __set_errno (EFAULT); return (_TDIR *) 0; } if (szPath[0] == _T('\0')) { - errno = ENOTDIR; + __set_errno (ENOTDIR); return (_TDIR *) 0; } @@ -79,18 +166,31 @@ if (rc == (unsigned int)-1) { /* call GetLastError for more error info */ +#ifdef __COREDLL__ + /* GetFileAttributes already sets LastError. */ +#else errno = ENOENT; +#endif return (_TDIR *) 0; } if (!(rc & FILE_ATTRIBUTE_DIRECTORY)) { /* Error, entry exists but not a directory. */ +#ifdef __COREDLL__ + /* GetFileAttributes already sets LastError. */ +#else errno = ENOTDIR; +#endif return (_TDIR *) 0; } +#ifdef __COREDLL__ + /* On Windows CE paths must always be absolute. */ + _tcsncpy (szFullPath, szPath, MAX_PATH); +#else /* Make an absolute pathname. */ _tfullpath (szFullPath, szPath, MAX_PATH); +#endif /* Allocate enough space to store DIR structure and the complete * directory path given. */ @@ -102,7 +202,9 @@ if (!nd) { /* Error, out of memory. */ +#ifndef __COREDLL__ errno = ENOMEM; +#endif return (_TDIR *) 0; } @@ -150,12 +252,12 @@ struct _tdirent * _treaddir (_TDIR * dirp) { - errno = 0; + __set_errno (0); /* Check for valid DIR struct. */ if (!dirp) { - errno = EFAULT; + __set_errno (EFAULT); return (struct _tdirent *) 0; } @@ -187,12 +289,12 @@ /* Get the next search entry. */ if (_tfindnext (dirp->dd_handle, &(dirp->dd_dta))) { - /* We are off the end or otherwise error. + /* We are off the end or otherwise error. _findnext sets errno to ENOENT if no more file - Undo this. */ + Undo this. */ DWORD winerr = GetLastError (); if (winerr == ERROR_NO_MORE_FILES) - errno = 0; + __set_errno (0); _findclose (dirp->dd_handle); dirp->dd_handle = -1; dirp->dd_stat = -1; @@ -229,12 +331,12 @@ { int rc; - errno = 0; + __set_errno (0); rc = 0; if (!dirp) { - errno = EFAULT; + __set_errno (EFAULT); return -1; } @@ -258,11 +360,11 @@ void _trewinddir (_TDIR * dirp) { - errno = 0; + __set_errno (0); if (!dirp) { - errno = EFAULT; + __set_errno (EFAULT); return; } @@ -284,11 +386,11 @@ long _ttelldir (_TDIR * dirp) { - errno = 0; + __set_errno (0); if (!dirp) { - errno = EFAULT; + __set_errno (EFAULT); return -1; } return dirp->dd_stat; @@ -306,18 +408,18 @@ void _tseekdir (_TDIR * dirp, long lPos) { - errno = 0; + __set_errno (0); if (!dirp) { - errno = EFAULT; + __set_errno (EFAULT); return; } if (lPos < -1) { /* Seeking to an invalid position. */ - errno = EINVAL; + __set_errno (EINVAL); return; } else if (lPos == -1) Modified: trunk/cegcc/src/mingw/mingwex/dirname.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/dirname.c 2007-06-24 19:42:31 UTC (rev 992) +++ trunk/cegcc/src/mingw/mingwex/dirname.c 2007-06-24 21:30:34 UTC (rev 993) @@ -49,7 +49,7 @@ if( (path[1] == *retname) && (path[2] == '\0') ) return retname; } - +#ifndef __COREDLL__ /* For all other cases ... * step over the drive designator, if present, copying it to retfail ... * (FIXME: maybe should confirm *path is a valid drive designator). @@ -60,6 +60,7 @@ *copyptr++ = *path++; *copyptr++ = *path++; } +#endif if( *path ) { Modified: trunk/cegcc/src/mingw/mingwex/getopt.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/getopt.c 2007-06-24 19:42:31 UTC (rev 992) +++ trunk/cegcc/src/mingw/mingwex/getopt.c 2007-06-24 21:30:34 UTC (rev 993) @@ -37,7 +37,9 @@ */ #include <assert.h> +#ifndef __COREDLL__ #include <errno.h> +#endif #include <stdlib.h> #include <string.h> #include <getopt.h> @@ -69,6 +71,10 @@ extern char __declspec(dllimport) *__progname; #endif +#ifdef __MINGW32CE__ +#define IS_POSIXLY_CORRECT 0 +#endif + #define IGNORE_FIRST (*options == '-' || *options == '+') #define PRINT_ERROR ((opterr) && ((*options != ':') \ || (IGNORE_FIRST && options[1] != ':'))) Modified: trunk/cegcc/src/mingw/mingwex/gettimeofday.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/gettimeofday.c 2007-06-24 19:42:31 UTC (rev 992) +++ trunk/cegcc/src/mingw/mingwex/gettimeofday.c 2007-06-24 21:30:34 UTC (rev 993) @@ -38,7 +38,13 @@ if(tp) { +#ifndef __COREDLL__ GetSystemTimeAsFileTime (&_now.ft); +#else + SYSTEMTIME st; + GetSystemTime (&st); + SystemTimeToFileTime (&st, &_now.ft); +#endif tp->tv_usec=(long)((_now.ns100 / 10ULL) % 1000000ULL ); tp->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000ULL); } Modified: trunk/cegcc/src/mingw/mingwex/wcstold.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wcstold.c 2007-06-24 19:42:31 UTC (rev 992) +++ trunk/cegcc/src/mingw/mingwex/wcstold.c 2007-06-24 21:30:34 UTC (rev 993) @@ -8,11 +8,13 @@ /* This routine has been placed in the public domain.*/ +#ifdef __COREDLL__ +/* coredll.dll doesn't export strtold. */ +#else + #define WIN32_LEAN_AND_MEAN #include <windows.h> -#ifndef __COREDLL__ #include <locale.h> -#endif #include <wchar.h> #include <stdlib.h> #include <string.h> @@ -51,15 +53,15 @@ char * cse; unsigned int i; long double ret; - const unsigned int cp = get_codepage (); - + const unsigned int cp = get_codepage (); + /* Allocate enough room for (possibly) mb chars */ cs = (char *) malloc ((wcslen(wcs)+1) * MB_CUR_MAX); if (cp == 0) /* C locale */ { for (i = 0; (wcs[i] != 0) && wcs[i] <= 255; i++) - cs[i] = (char) wcs[i]; + cs[i] = (char) wcs[i]; cs[i] = '\0'; } else @@ -90,3 +92,5 @@ return ret; } + +#endif /* __COREDLL__ */ Modified: trunk/cegcc/src/mingw/mingwex/wdirent.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wdirent.c 2007-06-24 19:42:31 UTC (rev 992) +++ trunk/cegcc/src/mingw/mingwex/wdirent.c 2007-06-24 21:30:34 UTC (rev 993) @@ -1,5 +1,7 @@ #define _UNICODE 1 #define UNICODE 1 +#define UNICODE_DIRENT 1 + #include <wchar.h> #include "dirent.c" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-24 21:41:10
|
Revision: 994 http://svn.sourceforge.net/cegcc/?rev=994&view=rev Author: pedroalves Date: 2007-06-24 14:41:02 -0700 (Sun, 24 Jun 2007) Log Message: ----------- * include/getopt.h [__COREDLL__]: Expose contents. * include/io.h (_finddata_t, _wfinddata_t, _findfirst, _findnext) (_findclose, _rmdir, _mkdir, _chmod, chdir, getcwd, mkdir, mktemp) (rmdir, chmod, _wfindfirst, _wfindnext, access, chsize, isatty) [__COREDLL__]: Expose. * include/stdlib.h (__argc, __argv) [__COREDLL__]: Declare. (bsearch) [__COREDLL__]: Expose. * include/dirent.h [__COREDLL__]: Expose contents. * include/wchar.h (_wfindfirst, _wfindnext) [__COREDLL__]: Expose. * include/search.h (bsearch) [__COREDLL__]: Expose. * include/unistd.h (ftruncate) [__COREDLL__]: Expose. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/dirent.h trunk/cegcc/src/mingw/include/getopt.h trunk/cegcc/src/mingw/include/io.h trunk/cegcc/src/mingw/include/search.h trunk/cegcc/src/mingw/include/stdlib.h trunk/cegcc/src/mingw/include/unistd.h trunk/cegcc/src/mingw/include/wchar.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 21:30:34 UTC (rev 993) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 21:41:02 UTC (rev 994) @@ -1,5 +1,19 @@ 2007-06-24 Pedro Alves <ped...@po...> + * include/getopt.h [__COREDLL__]: Expose contents. + * include/io.h (_finddata_t, _wfinddata_t, _findfirst, _findnext) + (_findclose, _rmdir, _mkdir, _chmod, chdir, getcwd, mkdir, mktemp) + (rmdir, chmod, _wfindfirst, _wfindnext, access, chsize, isatty) + [__COREDLL__]: Expose. + * include/stdlib.h (__argc, __argv) [__COREDLL__]: Declare. + (bsearch) [__COREDLL__]: Expose. + * include/dirent.h [__COREDLL__]: Expose contents. + * include/wchar.h (_wfindfirst, _wfindnext) [__COREDLL__]: Expose. + * include/search.h (bsearch) [__COREDLL__]: Expose. + * include/unistd.h (ftruncate) [__COREDLL__]: Expose. + +2007-06-24 Pedro Alves <ped...@po...> + * mingwex/dirname.c (dirname) [__COREDLL__]: Don't handle drive names. * mingwex/basename.c (basename) [__COREDLL__]: Likewise. * mingwex/wdirent.c (UNICODE_DIRENT): New define. Modified: trunk/cegcc/src/mingw/include/dirent.h =================================================================== --- trunk/cegcc/src/mingw/include/dirent.h 2007-06-24 21:30:34 UTC (rev 993) +++ trunk/cegcc/src/mingw/include/dirent.h 2007-06-24 21:41:02 UTC (rev 994) @@ -19,8 +19,6 @@ extern "C" { #endif -#ifndef __COREDLL__ - struct dirent { long d_ino; /* Always zero. */ @@ -115,8 +113,6 @@ long __cdecl _wtelldir (_WDIR*); void __cdecl _wseekdir (_WDIR*, long); -#endif /* Not __COREDLL__ */ - #ifdef __cplusplus } #endif Modified: trunk/cegcc/src/mingw/include/getopt.h =================================================================== --- trunk/cegcc/src/mingw/include/getopt.h 2007-06-24 21:30:34 UTC (rev 993) +++ trunk/cegcc/src/mingw/include/getopt.h 2007-06-24 21:41:02 UTC (rev 994) @@ -34,8 +34,6 @@ #ifndef __GETOPT_H__ #define __GETOPT_H__ -#ifndef __COREDLL__ - #ifdef __cplusplus extern "C" { #endif @@ -83,7 +81,5 @@ } #endif -#endif /* __COREDLL__ */ - #endif /* __GETOPT_LONG_H__ */ #endif /* __UNISTD_GETOPT__ */ Modified: trunk/cegcc/src/mingw/include/io.h =================================================================== --- trunk/cegcc/src/mingw/include/io.h 2007-06-24 21:30:34 UTC (rev 993) +++ trunk/cegcc/src/mingw/include/io.h 2007-06-24 21:41:02 UTC (rev 994) @@ -20,8 +20,6 @@ #include <sys/types.h> /* To get time_t. */ #include <stdint.h> /* For intptr_t. */ -#ifndef __COREDLL__ - /* * Attributes of files as returned by _findfirst et al. */ @@ -64,6 +62,8 @@ char name[FILENAME_MAX]; /* may include spaces. */ }; +#ifndef __COREDLL__ + struct _finddatai64_t { unsigned attrib; time_t time_create; @@ -82,6 +82,8 @@ char name[FILENAME_MAX]; }; +#endif + #ifndef _WFINDDATA_T_DEFINED struct _wfinddata_t { unsigned attrib; @@ -92,6 +94,8 @@ wchar_t name[FILENAME_MAX]; /* may include spaces. */ }; +#ifndef __COREDLL__ + struct _wfinddatai64_t { unsigned attrib; time_t time_create; @@ -110,10 +114,11 @@ wchar_t name[FILENAME_MAX]; }; +#endif /* __COREDLL__ */ + #define _WFINDDATA_T_DEFINED #endif -#endif /* __COREDLL__ */ #ifdef __cplusplus extern "C" { @@ -127,8 +132,6 @@ */ /* FIXME: Should these all use intptr_t, as per recent MSDN docs? */ -#ifndef __COREDLL__ - _CRTIMP long __cdecl _findfirst (const char*, struct _finddata_t*); _CRTIMP int __cdecl _findnext (long, struct _finddata_t*); _CRTIMP int __cdecl _findclose (long); @@ -140,8 +143,6 @@ _CRTIMP int __cdecl _rmdir (const char*); _CRTIMP int __cdecl _chmod (const char*, int); -#endif /* __COREDLL__ */ - #ifdef __MSVCRT__ _CRTIMP __int64 __cdecl _filelengthi64(int); _CRTIMP long __cdecl _findfirsti64(const char*, struct _finddatai64_t*); @@ -165,14 +166,14 @@ #ifndef _NO_OLDNAMES -#if !defined (_UWIN) && !defined (__COREDLL__) +#if !defined (_UWIN) _CRTIMP int __cdecl chdir (const char*); _CRTIMP char* __cdecl getcwd (char*, int); _CRTIMP int __cdecl mkdir (const char*); _CRTIMP char* __cdecl mktemp (char*); _CRTIMP int __cdecl rmdir (const char*); _CRTIMP int __cdecl chmod (const char*, int); -#endif /* _UWIN && __COREDLL__ */ +#endif /* _UWIN */ #endif /* Not _NO_OLDNAMES */ @@ -201,12 +202,9 @@ extern "C" { #endif -#ifndef __COREDLL__ _CRTIMP int __cdecl _access (const char*, int); _CRTIMP int __cdecl _chsize (int, long); -#endif /* __COREDLL__ */ _CRTIMP int __cdecl _close (int); -#ifndef __COREDLL__ _CRTIMP int __cdecl _commit(int); /* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80), @@ -230,7 +228,6 @@ /* LK_... locking commands defined in sys/locking.h. */ _CRTIMP int __cdecl _locking (int, int, long); -#endif /* __COREDLL__ */ _CRTIMP long __cdecl _lseek (int, long, int); @@ -268,8 +265,12 @@ _CRTIMP int __cdecl _waccess(const wchar_t*, int); _CRTIMP int __cdecl _wchmod(const wchar_t*, int); _CRTIMP int __cdecl _wcreat(const wchar_t*, int); +#endif +#if defined (__MSVCRT__) || defined (__COREDLL__) _CRTIMP long __cdecl _wfindfirst(const wchar_t*, struct _wfinddata_t*); _CRTIMP int __cdecl _wfindnext(long, struct _wfinddata_t *); +#endif +#if defined (__MSVCRT__) _CRTIMP int __cdecl _wunlink(const wchar_t*); _CRTIMP int __cdecl _wopen(const wchar_t*, int, ...); _CRTIMP int __cdecl _wsopen(const wchar_t*, int, int, ...); @@ -291,10 +292,8 @@ */ #ifndef _UWIN -#ifndef __COREDLL__ _CRTIMP int __cdecl access (const char*, int); _CRTIMP int __cdecl chsize (int, long ); -#endif /* __COREDLL__ */ _CRTIMP int __cdecl close (int); #ifndef __COREDLL__ _CRTIMP int __cdecl creat (const char*, int); @@ -302,8 +301,8 @@ _CRTIMP int __cdecl dup2 (int, int); _CRTIMP int __cdecl eof (int); _CRTIMP long __cdecl filelength (int); -_CRTIMP int __cdecl isatty (int); #endif /* __COREDLL__ */ +_CRTIMP int __cdecl isatty (int); _CRTIMP long __cdecl lseek (int, long, int); _CRTIMP int __cdecl open (const char*, int, ...); _CRTIMP int __cdecl read (int, void*, unsigned int); Modified: trunk/cegcc/src/mingw/include/search.h =================================================================== --- trunk/cegcc/src/mingw/include/search.h 2007-06-24 21:30:34 UTC (rev 993) +++ trunk/cegcc/src/mingw/include/search.h 2007-06-24 21:41:02 UTC (rev 994) @@ -40,10 +40,10 @@ _CRTIMP void __cdecl qsort (void*, size_t, size_t, int (*)(const void*, const void*)); -#ifndef __COREDLL__ /* bsearch and qsort are also declared in stdlib.h */ _CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, int (*)(const void*, const void*)); +#ifndef __COREDLL__ _CRTIMP void* __cdecl _lfind (const void*, const void*, unsigned int*, unsigned int, int (*)(const void*, const void*)); _CRTIMP void* __cdecl _lsearch (const void*, void*, unsigned int*, unsigned int, Modified: trunk/cegcc/src/mingw/include/stdlib.h =================================================================== --- trunk/cegcc/src/mingw/include/stdlib.h 2007-06-24 21:30:34 UTC (rev 993) +++ trunk/cegcc/src/mingw/include/stdlib.h 2007-06-24 21:41:02 UTC (rev 994) @@ -109,7 +109,12 @@ #endif /* __DECLSPEC_SUPPORTED */ -#endif /* __MSVCRT, __CRTDLL__ */ +#elif defined (__COREDLL__) + +extern int __argc; +extern char** __argv; + +#endif /* __MSVCRT, __CRTDLL__, __COREDLL__ */ #endif /* __STRICT_ANSI__ */ /* * Also defined in ctype.h. @@ -381,10 +386,8 @@ #endif /* bsearch and qsort are also in non-ANSI header search.h */ -#ifndef __COREDLL__ _CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, int (*)(const void*, const void*)); -#endif _CRTIMP void __cdecl qsort (void*, size_t, size_t, int (*)(const void*, const void*)); Modified: trunk/cegcc/src/mingw/include/unistd.h =================================================================== --- trunk/cegcc/src/mingw/include/unistd.h 2007-06-24 21:30:34 UTC (rev 993) +++ trunk/cegcc/src/mingw/include/unistd.h 2007-06-24 21:41:02 UTC (rev 994) @@ -31,7 +31,6 @@ extern "C" { #endif -#ifndef __COREDLL__ /* This is defined as a real library function to allow autoconf to verify its existence. */ int ftruncate(int, off_t); @@ -39,7 +38,6 @@ { return _chsize (__fd, __length); } -#endif #ifdef __cplusplus } Modified: trunk/cegcc/src/mingw/include/wchar.h =================================================================== --- trunk/cegcc/src/mingw/include/wchar.h 2007-06-24 21:30:34 UTC (rev 993) +++ trunk/cegcc/src/mingw/include/wchar.h 2007-06-24 21:41:02 UTC (rev 994) @@ -361,8 +361,12 @@ _CRTIMP int __cdecl _waccess (const wchar_t*, int); _CRTIMP int __cdecl _wchmod (const wchar_t*, int); _CRTIMP int __cdecl _wcreat (const wchar_t*, int); +#endif +#if defined (__MSVCRT__) || defined (__COREDLL__) _CRTIMP long __cdecl _wfindfirst (const wchar_t*, struct _wfinddata_t *); _CRTIMP int __cdecl _wfindnext (long, struct _wfinddata_t *); +#endif +#if defined (__MSVCRT__) _CRTIMP int __cdecl _wunlink (const wchar_t*); _CRTIMP int __cdecl _wopen (const wchar_t*, int, ...); _CRTIMP int __cdecl _wsopen (const wchar_t*, int, int, ...); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-24 21:45:16
|
Revision: 995 http://svn.sourceforge.net/cegcc/?rev=995&view=rev Author: pedroalves Date: 2007-06-24 14:45:10 -0700 (Sun, 24 Jun 2007) Log Message: ----------- * winmain_ce.c (_argc, _argv): Rename to ... (__argc, __argv): ... this. (main): Declare. (WinMain): Convert C++ comments into C style comments. Use __argc and __argv instead of _argc nad _argv. Pass NULL as third parameter to main. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/winmain_ce.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 21:41:02 UTC (rev 994) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 21:45:10 UTC (rev 995) @@ -1,5 +1,14 @@ 2007-06-24 Pedro Alves <ped...@po...> + * winmain_ce.c (_argc, _argv): Rename to ... + (__argc, __argv): ... this. + (main): Declare. + (WinMain): Convert C++ comments into C style comments. + Use __argc and __argv instead of _argc nad _argv. Pass NULL as third + parameter to main. + +2007-06-24 Pedro Alves <ped...@po...> + * include/getopt.h [__COREDLL__]: Expose contents. * include/io.h (_finddata_t, _wfinddata_t, _findfirst, _findnext) (_findclose, _rmdir, _mkdir, _chmod, chdir, getcwd, mkdir, mktemp) Modified: trunk/cegcc/src/mingw/winmain_ce.c =================================================================== --- trunk/cegcc/src/mingw/winmain_ce.c 2007-06-24 21:41:02 UTC (rev 994) +++ trunk/cegcc/src/mingw/winmain_ce.c 2007-06-24 21:45:10 UTC (rev 995) @@ -18,9 +18,11 @@ * Access to a standard 'main'-like argument count and list. Also included * is a table of environment variables. */ -int _argc = 0; -char **_argv = 0; +int __argc = 0; +char **__argv = 0; +extern int main (int, char **, char **); + static int _parse_tokens(char* string, char*** tokens, int length) { @@ -131,17 +133,20 @@ return; } -// Normally, the application will define a WinMain function. However, -// if the main application does not, this dummy WinMain will call a -// main() function instead. -extern int __cdecl -WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, - LPWSTR szCmdLine, int nShow) +/* Normally, the application will define a WinMain function. However, + * if the main application does not, this dummy WinMain will call a + * main() function instead. + */ +int +WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, + LPWSTR szCmdLine, int nShow) { /* * Set up __argc, __argv. */ - __mainArgs(&_argc, &_argv, szCmdLine); + __mainArgs(&__argc, &__argv, szCmdLine); - return main(_argc, _argv); + /* Pass in a NULL environ for those apps that expect it. Better + than stack garbage. */ + return main(__argc, __argv, NULL); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-24 21:49:21
|
Revision: 997 http://svn.sourceforge.net/cegcc/?rev=997&view=rev Author: pedroalves Date: 2007-06-24 14:49:20 -0700 (Sun, 24 Jun 2007) Log Message: ----------- * mingwex/Makefile.in (WINCE_OBJS): Add chsize.o, findfile.o, bsearch.o, access.o, mkdir.o and rmdir.o. (LIBOBJS): Also add $(POSIX_OBJS) for wince. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/Makefile.in Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 21:45:45 UTC (rev 996) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-06-24 21:49:20 UTC (rev 997) @@ -1,5 +1,11 @@ 2007-06-24 Pedro Alves <ped...@po...> + * mingwex/Makefile.in (WINCE_OBJS): Add chsize.o, findfile.o, + bsearch.o, access.o, mkdir.o and rmdir.o. + (LIBOBJS): Also add $(POSIX_OBJS) for wince. + +2007-06-24 Pedro Alves <ped...@po...> + * winmain_ce.c (_argc, _argv): Rename to ... (__argc, __argv): ... this. (main): Declare. Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-06-24 21:45:45 UTC (rev 996) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-06-24 21:49:20 UTC (rev 997) @@ -217,7 +217,7 @@ close.o isalnum.o isalpha.o iscntrl.o isgraph.o islower.o isprint.o \ ispunct.o isspace.o isupper.o isxdigit.o _tolower.o _toupper.o \ mb_cur_max.o rename.o stat.o chmod.o utime.o futime.o timeutil.o \ - ctime.o + ctime.o chsize.o findfile.o bsearch.o access.o mkdir.o rmdir.o MATHCE_OBJS = \ e_acosf.o e_acosh.o e_acoshf.o e_asinf.o e_atan2f.o e_atanh.o e_coshf.o \ e_expf.o e_gamma_r.o e_gammaf_r.o e_lgamma_r.o e_lgammaf_r.o e_log10f.o \ @@ -241,7 +241,8 @@ MATHCE_FLAGS= ifneq (,$(findstring wince,$(target_alias))) -LIB_OBJS = $(WINCE_OBJS) $(MATHCE_OBJS) $(Q8_OBJS) $(STDIO_OBJS_CE) +LIB_OBJS = $(WINCE_OBJS) $(MATHCE_OBJS) $(Q8_OBJS) $(STDIO_OBJS_CE) \ + $(POSIX_OBJS) MATHCE_FLAGS=-D_IEEE_LIBM MATHDIR=mathce else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-08-06 22:28:46
|
Revision: 1047 http://cegcc.svn.sourceforge.net/cegcc/?rev=1047&view=rev Author: pedroalves Date: 2007-08-06 15:28:44 -0700 (Mon, 06 Aug 2007) Log Message: ----------- * mingwex/Makefile.in (WINCE_DISTFILES): Add lfind.c. (WINCE_OBJS): Add lfind.o. * mingwex/wince/lfind.c: New file. * include/search.h (_lfind, lfind): Expose. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/search.h trunk/cegcc/src/mingw/mingwex/Makefile.in Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/lfind.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-08-06 22:20:14 UTC (rev 1046) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-08-06 22:28:44 UTC (rev 1047) @@ -1,3 +1,10 @@ +2007-08-06 Pedro Alves <ped...@po...> + + * mingwex/Makefile.in (WINCE_DISTFILES): Add lfind.c. + (WINCE_OBJS): Add lfind.o. + * mingwex/wince/lfind.c: New file. + * include/search.h (_lfind, lfind): Expose. + 2007-06-24 Pedro Alves <ped...@po...> * mingwex/Makefile.in (WINCE_OBJS): Add chsize.o, findfile.o, Modified: trunk/cegcc/src/mingw/include/search.h =================================================================== --- trunk/cegcc/src/mingw/include/search.h 2007-08-06 22:20:14 UTC (rev 1046) +++ trunk/cegcc/src/mingw/include/search.h 2007-08-06 22:28:44 UTC (rev 1047) @@ -43,7 +43,6 @@ /* bsearch and qsort are also declared in stdlib.h */ _CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, int (*)(const void*, const void*)); -#ifndef __COREDLL__ _CRTIMP void* __cdecl _lfind (const void*, const void*, unsigned int*, unsigned int, int (*)(const void*, const void*)); _CRTIMP void* __cdecl _lsearch (const void*, void*, unsigned int*, unsigned int, @@ -54,7 +53,6 @@ _CRTIMP void* __cdecl lsearch (const void*, void*, unsigned int*, unsigned int, int (*)(const void*, const void*)); #endif -#endif /* Not __COREDLL__ */ #ifdef __cplusplus } Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-08-06 22:20:14 UTC (rev 1046) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-08-06 22:28:44 UTC (rev 1047) @@ -88,7 +88,7 @@ asctime.c freopen.c gmtime.c localtime.c mktime.c strftime.c time.c \ tempnam.c unlink.c wcsftime.c fdopen.c read.c write.c open.c lseek.c \ close.c isalnum.c isalpha.c iscntrl.c isgraph.c islower.c isprint.c \ - ispunct.c isspace.c isupper.c isxdigit.c _tolower.c _toupper.c + ispunct.c isspace.c isupper.c isxdigit.c _tolower.c _toupper.c lfind.c MATHCE_DISTFILES = \ e_acosf.c e_acosh.c e_acoshf.c e_asinf.c e_atan2f.c e_atanh.c e_coshf.c \ @@ -217,7 +217,7 @@ close.o isalnum.o isalpha.o iscntrl.o isgraph.o islower.o isprint.o \ ispunct.o isspace.o isupper.o isxdigit.o _tolower.o _toupper.o \ mb_cur_max.o rename.o stat.o chmod.o utime.o futime.o timeutil.o \ - ctime.o chsize.o findfile.o bsearch.o access.o mkdir.o rmdir.o + ctime.o chsize.o findfile.o bsearch.o access.o mkdir.o rmdir.o lfind.o MATHCE_OBJS = \ e_acosf.o e_acosh.o e_acoshf.o e_asinf.o e_atan2f.o e_atanh.o e_coshf.o \ e_expf.o e_gamma_r.o e_gammaf_r.o e_lgamma_r.o e_lgammaf_r.o e_log10f.o \ Added: trunk/cegcc/src/mingw/mingwex/wince/lfind.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/lfind.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/lfind.c 2007-08-06 22:28:44 UTC (rev 1047) @@ -0,0 +1,65 @@ +/* $Id: lfind.c,v 1.3 2005/12/27 15:08:22 dron Exp $ */ + +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Roger L. Snyder. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93"; +__RCSID("$NetBSD: lsearch.c,v 1.2 2005/07/06 15:47:15 drochner Exp $"); +#endif + +#include <sys/types.h> + +#ifndef NULL +# define NULL 0 +#endif + +void * +_lfind(const void *key, const void *base, size_t *nmemb, size_t size, + int(*compar)(const void *, const void *)) +{ + char *element, *end; + + end = (char *)base + *nmemb * size; + for (element = (char *)base; element < end; element += size) + if (!compar(element, key)) /* key found */ + return element; + + return NULL; +} + +void * +lfind(const void *key, const void *base, size_t *nmemb, size_t size, + int(*compar)(const void *, const void *)) +{ + return _lfind(key, base, nmemb, size, compar); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/lfind.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-09-02 23:23:31
|
Revision: 1056 http://cegcc.svn.sourceforge.net/cegcc/?rev=1056&view=rev Author: pedroalves Date: 2007-09-02 16:23:28 -0700 (Sun, 02 Sep 2007) Log Message: ----------- * mingwex/wince/stat.c (_stat): Set last error to ERROR_FILE_NOT_FOUND when file is not found. Fix indenting. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wince/stat.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-09-02 23:20:11 UTC (rev 1055) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-09-02 23:23:28 UTC (rev 1056) @@ -1,5 +1,10 @@ 2007-09-03 Pedro Alves <ped...@po...> + * mingwex/wince/stat.c (_stat): Set last error to + ERROR_FILE_NOT_FOUND when file is not found. Fix indenting. + +2007-09-03 Pedro Alves <ped...@po...> + * include/stdio.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Define as fileno(stdin), fileno(stdout) and fileno(stderr). Modified: trunk/cegcc/src/mingw/mingwex/wince/stat.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/stat.c 2007-09-02 23:20:11 UTC (rev 1055) +++ trunk/cegcc/src/mingw/mingwex/wince/stat.c 2007-09-02 23:23:28 UTC (rev 1056) @@ -123,8 +123,8 @@ { DWORD dwError = GetLastError (); if(dwError == ERROR_NO_MORE_FILES) - /* Convert error to something more sensible. */ - SetLastError (ERROR_FILE_NOT_FOUND); + /* Convert error to something more sensible. */ + SetLastError (ERROR_FILE_NOT_FOUND); return -1; } @@ -132,7 +132,7 @@ len = strlen (path); exec = (len >= 4 - && strcasecmp (path + len - 4, ".exe") == 0); + && strcasecmp (path + len - 4, ".exe") == 0); ret = __stat_by_file_info (&sfi, st, exec); FindClose (h); return ret; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-09-02 23:52:34
|
Revision: 1057 http://cegcc.svn.sourceforge.net/cegcc/?rev=1057&view=rev Author: pedroalves Date: 2007-09-02 16:52:29 -0700 (Sun, 02 Sep 2007) Log Message: ----------- * mingwex/wince/open: Include sys/stat.h. (vopen): Implement PMODE parameter support. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wince/open.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-09-02 23:23:28 UTC (rev 1056) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-09-02 23:52:29 UTC (rev 1057) @@ -1,5 +1,10 @@ 2007-09-03 Pedro Alves <ped...@po...> + * mingwex/wince/open: Include sys/stat.h. + (vopen): Implement PMODE parameter support. + +2007-09-03 Pedro Alves <ped...@po...> + * mingwex/wince/stat.c (_stat): Set last error to ERROR_FILE_NOT_FOUND when file is not found. Fix indenting. Modified: trunk/cegcc/src/mingw/mingwex/wince/open.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/open.c 2007-09-02 23:23:28 UTC (rev 1056) +++ trunk/cegcc/src/mingw/mingwex/wince/open.c 2007-09-02 23:52:29 UTC (rev 1057) @@ -1,6 +1,7 @@ #include <windows.h> #include <unistd.h> #include <fcntl.h> +#include <sys/stat.h> static int vopen (const char *path, int oflag, va_list ap) @@ -59,7 +60,16 @@ mbstowcs (wpath, path, path_len + 1); - fileshare = FILE_SHARE_READ | FILE_SHARE_WRITE; + fileshare = 0; + if (oflag & O_CREAT) + { + int pmode = va_arg (ap, int); + if ((pmode & S_IREAD) == S_IREAD) + fileshare |= FILE_SHARE_READ; + if ((pmode & S_IWRITE) == S_IWRITE) + fileshare |= FILE_SHARE_WRITE; + } + fileattrib = FILE_ATTRIBUTE_NORMAL; hnd = CreateFileW (wpath, fileaccess, fileshare, NULL, filecreate, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-10-16 22:03:27
|
Revision: 1063 http://cegcc.svn.sourceforge.net/cegcc/?rev=1063&view=rev Author: pedroalves Date: 2007-10-16 13:52:57 -0700 (Tue, 16 Oct 2007) Log Message: ----------- 2007-10-16 Erik van Pienbroek <er...@va...> * include/sys/time.h (gettimeofday): Expose on __COREDLL__. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/sys/time.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-09-19 18:51:06 UTC (rev 1062) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-10-16 20:52:57 UTC (rev 1063) @@ -1,7 +1,6 @@ -2007-09-03 Pedro Alves <ped...@po...> +2007-10-16 Erik van Pienbroek <er...@va...> - * mingwex/wince/open: Include sys/stat.h. - (vopen): Implement PMODE parameter support. + * include/sys/time.h (gettimeofday): Expose on __COREDLL__. 2007-09-03 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/include/sys/time.h =================================================================== --- trunk/cegcc/src/mingw/include/sys/time.h 2007-09-19 18:51:06 UTC (rev 1062) +++ trunk/cegcc/src/mingw/include/sys/time.h 2007-10-16 20:52:57 UTC (rev 1063) @@ -36,10 +36,8 @@ The timezone pointer arg is ignored. Errors are ignored. */ -#ifndef __COREDLL__ int __cdecl gettimeofday(struct timeval *__restrict__, void *__restrict__ /* tzp (unused) */); -#endif #ifdef __cplusplus } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |