From stdcxx-dev-return-2272-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Fri Oct 13 15:56:55 2006 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 39161 invoked from network); 13 Oct 2006 15:56:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Oct 2006 15:56:55 -0000 Received: (qmail 50758 invoked by uid 500); 13 Oct 2006 15:56:54 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 50747 invoked by uid 500); 13 Oct 2006 15:56:54 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 50736 invoked by uid 99); 13 Oct 2006 15:56:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Oct 2006 08:56:54 -0700 X-ASF-Spam-Status: No, hits=3.0 required=10.0 tests=LONGWORDS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [212.82.213.172] (HELO exkiv.kyiv.vdiweb.com) (212.82.213.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Oct 2006 08:56:50 -0700 Received: from [10.11.37.198] ([10.11.37.198]) by exkiv.kyiv.vdiweb.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 13 Oct 2006 18:56:22 +0300 Message-ID: <452FB723.8020105@kyiv.vdiweb.com> Date: Fri, 13 Oct 2006 18:56:19 +0300 From: Farid Zaripov User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: [PATCH] RE: svn commit: r454781 - /incubator/stdcxx/trunk/etc/config/windows/configure.wsf Content-Type: multipart/mixed; boundary="------------050101080908040709030703" X-OriginalArrivalTime: 13 Oct 2006 15:56:22.0365 (UTC) FILETIME=[213208D0:01C6EEE0] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------------050101080908040709030703 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit > -----Original Message----- > From: Martin Sebor [mailto:sebor@roguewave.com] > Sent: Wednesday, October 11, 2006 7:36 PM > To: stdcxx-dev@incubator.apache.org > Subject: Re: svn commit: r454781 - > /incubator/stdcxx/trunk/etc/config/windows/configure.wsf > > > Sure. If someone will make changes to the libc_decl.sh I > will port > > the changes to configure.wsf. I'm not so familiar with sh > scripting to > > make useful format of file with functions. > > I was hoping we could automate it. I mean if someone will make changes to the libc_decl.sh to use the external file with functions list, then I'll port the changes to the configure.wsf. :) But I had read the bash-scripting guide and found nothing hard :) The proposed patch is attached. Farid. --------------050101080908040709030703 Content-Type: text/plain; name="etc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="etc.diff" Index: config/src/headers.inc =================================================================== --- config/src/headers.inc (revision 0) +++ config/src/headers.inc (revision 0) @@ -0,0 +1,78 @@ +# list of headers +hdrs="assert ctype errno float iso646 limits locale math setjmp signal \ + stdarg stddef stdio stdlib string time wchar wctype new typeinfo" +hdrs="$hdrs ieeefp.h pthread.h" + + +# math functions +c90_funs="acos(0.0) asin(0.0) atan(0.0) atan2(0.0,0.0) ceil(0.0) cos(0.0) \ + cosh(0.0) exp(0.0) fabs(0.0) floor(0.0) fmod(0.0,0.0) frexp(0.0,0) \ + ldexp(0.0,0) log(0.0) log10(0.0) modf(0.0,0) pow(0.0,0.0) sin(0.0) \ + sinh(0.0) sqrt(0.0) tan(0.0) tanh(0.0) acosf asinf atanf atan2f \ + ceilf cosf coshf expf fabsf floorf fmodf frexpf ldexpf logf log10f \ + modff powf sinf sinhf sqrtf tanf tanhf acosl asinl atanl atan2l \ + ceill cosl coshl expl fabsl floorl fmodl frexpl ldexpl logl log10l \ + modfl powl sinl sinhl sqrtl tanl tanhl" +c99_funs="cbrtf copysignf erfcf erff expm1f exp2f fdimf fmaf fmaxf fminf \ + hypotf ilogbf lgammaf logbf log1pf log2f llrintf lrintf lroundf \ + llroundf nanf nearbyintf nextafterf nexttowardf remainderf remquof \ + rintf roundf scalbnf scalblnf tgammaf cbrt copysign erf erfc expm1 \ + exp2 fdim fma fmax fmin hypot ilogb lgamma logb log1p log2 llrint \ + lrint lround llround nan nearbyint nextafter nexttoward remainder \ + remquo rint round scalbn scalbln tgamma cbrtl copysignl erfcl erfl \ + expm1l exp2l fdiml fmal fmaxl fminl hypotl ilogbl lgammal logbl \ + log1pl log2l llrintl lrintl lroundl llroundl nanl nearbyintl \ + nextafterl nexttowardl remainderl remquol rintl roundl scalbnl \ + scalblnl tgammal" + +# ignore C99 functions for now +math="$c90_funs" + + +# stdio functions +c90_funs="clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen \ + fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell \ + fwrite getc getchar gets perror printf putc putchar puts remove \ + rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam \ + ungetc vfprintf vprintf vsprintf" +c99_funs="snprintf vsnprintf" +posix_funs="fileno" + +stdio="$c90_funs $c99_funs $posix_funs" + + +# stdlib functions +c90_funs="abort abs atexit atof atoi atol atoll bsearch calloc div exit free \ + getenv labs ldiv llabs lldiv malloc mblen mbstowcs mbtowc qsort \ + rand realloc srand strtod strtol strtoul system wcstombs wctomb" +c99_funs="strtof strtold strtoll strtoull" +posix_funs="mkstemp putenv setenv unsetenv" + +stdlib="$c90_funs $c99_funs $posix_funs" + + +# string functions +string="memchr((void*)0,0,0) memcmp memcpy memmove memset strcat \ + strchr((char*)0,0) strcmp strcoll strcpy strcspn strerror strlen \ + strncat strncmp strncpy strpbrk((char*)0,(char*)0) \ + strrchr((char*)0,0) strspn strstr((char*)0,(char*)0) strtok strxfrm" + + +# wchar functions +wchar="btowc fgetwc fgetws fputwc fputws fwide fwprintf fwscanf getwc \ + getwchar mbrlen mbrtowc mbsinit mbsrtowcs putwc putwchar swprintf \ + swscanf ungetwc vfwprintf vswprintf vwprintf vwscanf wcrtomb wcscat \ + wcschr((wchar_t*)0,0) wcscmp wcscoll wcscpy wcscspn wcsftime wcslen \ + wcsncat wcsncmp wcsncpy wcspbrk((wchar_t*)0,(wchar_t*)0) \ + wcsrchr((wchar_t*)0,0) wcsrtombs wcsspn \ + wcsstr((wchar_t*)0,(wchar_t*)0) wcstod wcstod wcstof wcstok wcstol \ + wcstold wcstoll wcstoul wcstoull wcsxfrm wctob \ + wmemchr((wchar_t*)0,0,0) wmemcmp wmemcpy wmemmove wmemset wprintf \ + wscanf" + + +# wctype functions +# 7.15 of ISO/IEC 9899:1990/Amendment 1:1995 +wctype="iswalpha iswalnum iswcntrl iswdigit iswgraph iswlower iswprint \ + iswpunct iswspace iswupper iswxdigit wctype iswctype towlower \ + towupper wctrans towctrans" Property changes on: config\src\headers.inc ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Index: config/src/libc_decl.sh =================================================================== --- config/src/libc_decl.sh (revision 463143) +++ config/src/libc_decl.sh (working copy) @@ -66,12 +66,12 @@ function="$3" fi +# include headers.inc file +inc="`echo $0 | sed 's/libc_decl.sh/headers.inc/'`" +. $inc + if [ ! -z "$4" ]; then hdrs="$4" -else - hdrs="assert ctype errno float iso646 limits locale math setjmp signal stdarg stddef stdio stdlib string time wchar wctype new typeinfo" - - hdrs="$hdrs ieeefp.h pthread.h" fi @@ -269,58 +269,19 @@ for h in $hdrs ; do - case $h in - math) - # provide arguments for functions that may be overloaded - c90_funs="acos(0.0) asin(0.0) atan(0.0) atan2(0.0,0.0) ceil(0.0) cos(0.0) cosh(0.0) exp(0.0) fabs(0.0) floor(0.0) fmod(0.0,0.0) frexp(0.0,0) ldexp(0.0,0) log(0.0) log10(0.0) modf(0.0,0) pow(0.0,0.0) sin(0.0) sinh(0.0) sqrt(0.0) tan(0.0) tanh(0.0) acosf asinf atanf atan2f ceilf cosf coshf expf fabsf floorf fmodf frexpf ldexpf logf log10f modff powf sinf sinhf sqrtf tanf tanhf acosl asinl atanl atan2l ceill cosl coshl expl fabsl floorl fmodl frexpl ldexpl logl log10l modfl powl sinl sinhl sqrtl tanl tanhl" - c99_funs="cbrtf copysignf erfcf erff expm1f exp2f fdimf fmaf fmaxf fminf hypotf ilogbf lgammaf logbf log1pf log2f llrintf lrintf lroundf llroundf nanf nearbyintf nextafterf nexttowardf remainderf remquof rintf roundf scalbnf scalblnf tgammaf cbrt copysign erf erfc expm1 exp2 fdim fma fmax fmin hypot ilogb lgamma logb log1p log2 llrint lrint lround llround nan nearbyint nextafter nexttoward remainder remquo rint round scalbn scalbln tgamma cbrtl copysignl erfcl erfl expm1l exp2l fdiml fmal fmaxl fminl hypotl ilogbl lgammal logbl log1pl log2l llrintl lrintl lroundl llroundl nanl nearbyintl nextafterl nexttowardl remainderl remquol rintl roundl scalbnl scalblnl tgammal" + hdr_base=`${basename} $h \.h` + eval funs=\$$hdr_base - # ignore C99 functions for now - funs="$c90_funs" - lib=m - ;; + if [ -z "$funs" ] ; then + continue + fi - stdio) - c90_funs="clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell fwrite getc getchar gets perror printf putc putchar puts remove rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ungetc vfprintf vprintf vsprintf" - c99_funs="snprintf vsnprintf" - posix_funs="fileno" - - funs="$c90_funs $c99_funs $posix_funs" + if [ "$hdr_base" == math ] ; then + lib=m + else lib=c - ;; + fi - stdlib) - c90_funs="abort abs atexit atof atoi atol atoll bsearch calloc div exit free getenv labs ldiv llabs lldiv malloc mblen mbstowcs mbtowc qsort rand realloc srand strtod strtol strtoul system wcstombs wctomb" - c99_funs="strtof strtold strtoll strtoull" - posix_funs="mkstemp putenv setenv unsetenv" - - funs="$c90_funs $c99_funs $posix_funs" - lib=c - ;; - - string) - funs="memchr((void*)0,0,0) memcmp memcpy memmove memset strcat strchr((char*)0,0) strcmp strcoll strcpy strcspn strerror strlen strncat strncmp strncpy strpbrk((char*)0,(char*)0) strrchr((char*)0,0) strspn strstr((char*)0,(char*)0) strtok strxfrm" - lib=c - ;; - - wchar) - funs="btowc fgetwc fgetws fputwc fputws fwide fwprintf fwscanf getwc getwchar mbrlen mbrtowc mbsinit mbsrtowcs putwc putwchar swprintf swscanf ungetwc vfwprintf vswprintf vwprintf vwscanf wcrtomb wcscat wcschr((wchar_t*)0,0) wcscmp wcscoll wcscpy wcscspn wcsftime wcslen wcsncat wcsncmp wcsncpy wcspbrk((wchar_t*)0,(wchar_t*)0) wcsrchr((wchar_t*)0,0) wcsrtombs wcsspn wcsstr((wchar_t*)0,(wchar_t*)0) wcstod wcstod wcstof wcstok wcstol wcstold wcstoll wcstoul wcstoull wcsxfrm wctob wmemchr((wchar_t*)0,0,0) wmemcmp wmemcpy wmemmove wmemset wprintf wscanf" - lib=c - ;; - - wctype) - # 7.15 of ISO/IEC 9899:1990/Amendment 1:1995 - funs="iswalpha iswalnum iswcntrl iswdigit iswgraph iswlower iswprint iswpunct iswspace iswupper iswxdigit wctype iswctype towlower towupper wctrans towctrans" - lib=c - ;; - - *) - unset funs - continue - ;; - - esac - # float and long double versions of functions # are not expected to be declared in or in std use_libc_header=0 Index: config/windows/configure.wsf =================================================================== --- config/windows/configure.wsf (revision 463143) +++ config/windows/configure.wsf (working copy) @@ -405,10 +405,44 @@ // or do another strange things var useStarInDefines = (currentCfg != "icc-9.0"); - var hdrs = "assert ctype errno float iso646 limits locale math setjmp"; - hdrs += " signal stdarg stddef stdio stdlib string time wchar wctype"; - hdrs += " new typeinfo"; - hdrs += " ieeefp.h pthread.h"; + inc = fso.OpenTextFile(srcDir + "\\headers.inc", 1, false); + code = ""; + var rx = /^([A-Za-z]\w*)=(.*)"([^\$]*)\$([A-Za-z]\w*)(.*)"$/; + + while (!inc.AtEndOfStream) + { + var line = inc.ReadLine(); + if (line.length && '#' != line.charAt(0)) + { + var arr; + while (null != (arr = rx.exec(line))) + { + line = arr[1] + "="; + if (arr[2].length) + { + line += arr[2]; + if ('+' != arr[2].charAt(arr[2].length - 1)) + line += "+"; + } + if (arr[3].length) + line += "\"" + arr[3] + "\"+"; + line += arr[4]; + if (arr[5].length) + line += "+\"" + arr[5] + "\""; + } + + code += line; + + if ('\\' != line.charAt(line.length - 1)) + code += ";"; + + code += "\n"; + } + } + + eval(code); + + hdrs = hdrs.replace(/ +/g, " "); var headers = hdrs.split(" "); WScript.StdOut.WriteLine("Checking for headers... "); @@ -517,141 +551,23 @@ { var fun_params = ""; var hdr_base = headers[i]; - switch (hdr_base) + + try { - case "math": - var c90_funs = "acos(0.0) asin(0.0) atan(0.0) atan2(0.0,0.0)"; - c90_funs += " ceil(0.0) cos(0.0) cosh(0.0) exp(0.0) fabs(0.0)"; - c90_funs += - " floor(0.0) fmod(0.0,0.0) frexp(0.0,0) ldexp(0.0,0)"; - c90_funs += " log(0.0) log10(0.0) modf(0.0,0) pow(0.0,0.0)"; - c90_funs += " sin(0.0) sinh(0.0) sqrt(0.0) tan(0.0) tanh(0.0)"; - c90_funs += " acosf asinf atanf atan2f ceilf cosf coshf expf"; - c90_funs += " fabsf floorf fmodf frexpf ldexpf logf log10f"; - c90_funs += " modff powf sinf sinhf sqrtf tanf tanhf acosl"; - c90_funs += " asinl atanl atan2l ceill cosl coshl expl fabsl"; - c90_funs += " floorl fmodl frexpl ldexpl logl log10l modfl"; - c90_funs += " powl sinl sinhl sqrtl tanl tanhl"; - c90_funs = c90_funs.split(" "); - - // ignore C99 functions for now - // var c99_funs = - // "cbrtf copysignf erfcf erff expm1f exp2f fdimf"; - // c99_funs += " fmaf fmaxf fminf hypotf ilogbf lgammaf logbf"; - // c99_funs += - // " log1pf log2f llrintf lrintf lroundf llroundf nanf"; - // c99_funs += " nearbyintf nextafterf nexttowardf remainderf"; - // c99_funs += " remquof rintf roundf scalbnf scalblnf tgammaf"; - // c99_funs += " cbrt copysign erf erfc expm1 exp2 fdim fma"; - // c99_funs += " fmax fmin hypot ilogb lgamma logb log1p log2"; - // c99_funs += - // " llrint lrint lround llround nan nearbyint nextafter"; - // c99_funs += " nexttoward remainder remquo rint round scalbn"; - // c99_funs += - // " scalbln tgamma cbrtl copysignl erfcl erfl expm1l"; - // c99_funs += - // " exp2l fdiml fmal fmaxl fminl hypotl ilogbl lgammal"; - // c99_funs += - // " logbl log1pl log2l llrintl lrintl lroundl llroundl nanl"; - // c99_funs += " nearbyintl nextafterl nexttowardl remainderl"; - // c99_funs += " remquol rintl roundl scalbnl scalblnl tgammal"; - // c99_funs = c99_funs.split(" "); - - funs = c90_funs; - // that seems to be useless on Windows since there is no libm - lib = "m"; - break; - case "stdio": - var c90_funs = - "clearerr fclose feof ferror fflush fgetc fgetpos"; - c90_funs += " fgets fopen fprintf fputc fputs fread freopen"; - c90_funs += " fscanf fseek fsetpos ftell fwrite getc getchar"; - c90_funs += " gets perror printf putc putchar puts remove"; - c90_funs += " rename rewind scanf setbuf setvbuf sprintf"; - c90_funs += " sscanf tmpfile tmpnam ungetc vfprintf vprintf"; - c90_funs += " vsprintf"; - c90_funs = c90_funs.split(" "); - - var c99_funs = "snprintf vsnprintf".split(" "); - var posix_funs = "fileno".split(" "); - funs = c90_funs.concat(c99_funs, posix_funs); - lib = "c"; - break; - case "stdlib": - var c90_funs = - "abort abs atexit atof atoi atol atoll bsearch calloc"; - c90_funs += " div exit free getenv labs ldiv llabs lldiv malloc"; - c90_funs += " mblen mbstowcs mbtowc qsort rand realloc srand"; - c90_funs += " strtod strtol strtoul system wcstombs wctomb"; - c90_funs = c90_funs.split(" "); - - var c99_funs = "strtof strtold strtoll strtoull".split(" "); - var posix_funs = "mkstemp putenv setenv unsetenv".split(" "); - funs = c90_funs.concat(c99_funs, posix_funs); - lib = "c"; - break; - case "string": - funs = - useStarInDefines ? "memchr((char*)0,0,0)" : "memchr(0,0,0)"; - funs += " memcmp memcpy memmove memset strcat"; - funs += - useStarInDefines ? " strchr((char*)0,0)" : " strchr(0,0)"; - funs += - " strcmp strcoll strcpy strcspn strerror strlen"; - funs += " strncat strncmp strncpy"; - funs += useStarInDefines ? - " strpbrk((char*)0,(char*)0)" : " strpbrk(0,0)"; - funs += - useStarInDefines ? " strrchr((char*)0,0)" : " strrchr(0,0)"; - funs += " strspn"; - funs += useStarInDefines ? - " strstr((char*)0,(char*)0)" : " strstr(0,0)"; - funs += " strtok strxfrm"; - funs = funs.split(" "); - lib = "c"; - break; - case "wchar": - fun_params = "wchar_t t[] = {'a'}"; - funs = - "btowc fgetwc fgetws fputwc fputws fwide fwprintf fwscanf"; - funs += " getwc getwchar mbrlen mbrtowc mbsinit mbsrtowcs putwc"; - funs += " putwchar swprintf swscanf ungetwc vfwprintf vswprintf"; - funs += " vwprintf vwscanf wcrtomb wcscat"; - funs += - useStarInDefines ? " wcschr((wchar_t*)0,0)" : " wcschr(t,0)"; - funs += " wcscmp wcscoll wcscpy wcscspn wcsftime wcslen wcsncat"; - funs += " wcsncmp wcsncpy"; - funs += useStarInDefines ? - " wcspbrk((wchar_t*)0,(wchar_t*)0)" : " wcspbrk(t,0)"; - funs += useStarInDefines ? - " wcsrchr((wchar_t*)0,0)" : " wcsrchr(t,0)"; - funs += " wcsrtombs wcsspn"; - funs += useStarInDefines ? - " wcsstr((wchar_t*)0,(wchar_t*)0)" : " wcsstr(t,0)"; - funs += - " wcstod wcstod wcstof wcstok"; - funs += - " wcstol wcstold wcstoll wcstoul wcstoull wcsxfrm"; - funs += " wctob"; - funs += useStarInDefines ? - " wmemchr((wchar_t*)0,0,0)" : " wmemchr(t,0,0)"; - funs += " wmemcmp wmemcpy"; - funs += " wmemmove wmemset wprintf wscanf"; - funs = funs.split(" "); - lib = "c"; - break; - case "wctype": - // 7.15 of ISO/IEC 9899:1990/Amendment 1:1995 - funs = "iswalpha iswalnum iswcntrl iswdigit iswgraph iswlower"; - funs += " iswprint iswpunct iswspace iswupper iswxdigit wctype"; - funs += " iswctype towlower towupper wctrans towctrans"; - funs = funs.split(" "); - lib = "c"; - break; - default: - continue; + eval("funs=" + hdr_base); } + catch (e) + { + funs = ""; + } + if (0 == funs.length) + continue; + + funs = funs.replace(/ +/g, " ").split(" "); + + lib = ("math" == hdr_base) ? "m" : "c"; + var useCHeader = false; for (j in funs) { --------------050101080908040709030703--