Changeset 3892 for trunk


Ignore:
Timestamp:
Jun 29, 2014, 6:12:30 PM (11 years ago)
Author:
bird
Message:

Made msun compile with watcom.

Location:
trunk/libc
Files:
20 added
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/libc/Config.kmk

    r3891 r3892  
    178178# Only permit #include <include/emx/bigint.h>.
    179179TEMPLATE_bldprog = Build programs
    180 TEMPLATE_bldprog_DEFS = __LIBC_BUILD_PROGRAM__
     180TEMPLATE_bldprog_DEFS = __LIBC_BUILD_PROGRAM__ __KLIBC_BUILD_PROGRAM__
    181181TEMPLATE_bldprog_LIBSUFF = .a
    182182if defined(CFG_LIBC_USE_WATCOM)
     
    184184 TEMPLATE_bldprog_INCS = $(TOOL_OPENWATCOM_CXXINCS) $(PATH_LIBC_ROOT)
    185185 TEMPLATE_bldprog_BLD_TRG_ARCH = x86
    186  TEMPLATE_bldprog_CFLAGS = -za99 -aa -ecc
     186 TEMPLATE_bldprog_CFLAGS = -za99 -aa -ecc -d2
     187 TEMPLATE_bldprog_CFLAGS.win = -hc
     188 TEMPLATE_bldprog_LDFLAGS = -d2
     189 TEMPLATE_bldprog_LDFLAGS.win = -hc
    187190else
    188191 TEMPLATE_bldprog_TOOL = GCC3
  • trunk/libc/include/sys/bsd/cdefs.h

    r3824 r3892  
    484484#endif  /* __GNUC__ || __INTEL_COMPILER */
    485485#else                                                                       /* bird */
    486 #define __strong_reference(sym,aliassym)        \
     486# ifdef __GNUC__                                                            /* bird */
     487#  define __strong_reference(sym,aliassym)      \
    487488        extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));  /* bird */
     489# else                                                                      /* bird */
     490#  define __strong_reference(sym,aliassym)                                  /* bird */
     491# endif                                                                     /* bird */
    488492#endif                                                                      /* bird */
    489493
  • trunk/libc/include/sys/cdefs.h

    r3883 r3892  
    122122 * Include the other cdefs.h  Fortunately, they use different blocker macros.
    123123 */
    124 #include <sys/bsd/cdefs.h>
    125 #include <sys/gnu/cdefs.h>
     124#include "bsd/cdefs.h"
     125#include "gnu/cdefs.h"
    126126
    127127/*
  • trunk/libc/src/fbsdlibc/gdtoa/gdtoa.h

    r1862 r3892  
    114114                        int mode, int ndigits, int *decpt, char **rve));
    115115extern void freedtoa ANSI((char*));
     116#ifndef __KLIBC_BUILD_PROGRAM__
    116117extern float  strtof ANSI((CONST char *, char **));
    117118extern double strtod ANSI((CONST char *, char **));
     119#endif
    118120extern int strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*));
    119121
  • trunk/libc/src/fbsdlibc/gdtoa/gdtoaimp.h

    r3820 r3892  
    195195#include "namespace.h"
    196196#ifdef __IN_KLIBC__
    197 #include <386/builtin.h>
    198 #include <sys/fmutex.h>
     197# ifndef __KLIBC_BUILD_PROGRAM__
     198#  include <386/builtin.h>
     199#  include <sys/fmutex.h>
     200# endif
    199201#else /* !__IN_KLIBC__ */
    200202#include <pthread.h>
     
    477479#endif
    478480
     481#ifdef __KLIBC_BUILD_PROGRAM__
     482# undef MULTIPLE_THREADS
     483# define ACQUIRE_DTOA_LOCK(n)    do {} while (0)
     484# define FREE_DTOA_LOCK(n)       do {} while (0)
     485#else
    479486#define MULTIPLE_THREADS
    480 #ifdef __IN_KLIBC__
     487# ifdef __IN_KLIBC__
    481488extern _fmutex __libc_gdtoa_locks[2];
    482489#define ACQUIRE_DTOA_LOCK(n)    do {                            \
     
    488495    _fmutex_checked_release(&__libc_gdtoa_locks[n]);                 \
    489496} while(0)
    490 #else /* !__IN_KLIBC__ */
     497# else /* !__IN_KLIBC__ */
    491498extern pthread_mutex_t __gdtoa_locks[2];
    492499#define ACQUIRE_DTOA_LOCK(n)    do {                            \
     
    498505                _pthread_mutex_unlock(&__gdtoa_locks[n]);       \
    499506} while(0)
    500 #endif /* !__IN_KLIBC__ */
     507# endif /* !__IN_KLIBC__ */
     508#endif /* !__KLIBC_BUILD_PROGRAM__ */
    501509
    502510#define Kmax 15
     
    521529#endif /* NO_STRING_H */
    522530
     531#ifndef __KLIBC_BUILD_PROGRAM__
     532#error
    523533/*
    524534 * Paranoia: Protect exported symbols, including ones in files we don't
     
    603613#define trailz          __trailz_D2A
    604614#define ulp             __ulp_D2A
     615#endif /* !__KLIBC_BUILD_PROGRAM__ */
    605616
    606617 extern char *dtoa_result;
  • trunk/libc/src/fbsdlibc/gdtoa/glue/machdep_ldisx.c

    r3821 r3892  
    4040#endif
    4141
     42#ifdef __KLIBC_BUILD_PROGRAM__
     43long double gdtoa_strtold(const char *s, char **sp)
     44#else
    4245long double
    4346_STD(strtold)(const char * __restrict s, char ** __restrict sp)
     47#endif
    4448{
    4549        long double result;
  • trunk/libc/src/fbsdlibc/gdtoa/strtod.c

    r3821 r3892  
    4242#define Avoid_Underflow
    4343#undef tinytens
     44#define tinytens local_tinytens /* bird - scope changed. */
    4445/* The factor of 2^53 in tinytens[4] helps us avoid setting the underflow */
    4546/* flag unnecessarily.  It leads to a song and dance at the end of strtod. */
     
    5859#endif
    5960
     61#ifdef __KLIBC_BUILD_PROGRAM__
     62double gdtoa_strtod(const char *s00, char **se)
     63#else /* !__KLIBC_BUILD_PROGRAM__ */
    6064 double
    6165#ifdef __IN_KLIBC__
     
    6973        (CONST char *s00, char **se)
    7074#endif
     75#endif /* !__KLIBC_BUILD_PROGRAM__ */
    7176{
    7277#ifdef Avoid_Underflow
  • trunk/libc/src/fbsdlibc/gdtoa/strtof.c

    r1871 r3892  
    3939#include <stdlib.h>
    4040
     41#ifdef __KLIBC_BUILD_PROGRAM__
     42float gdtoa_strtof(const char *s, char **sp)
     43#else
    4144 float
    4245#ifdef KR_headers
     
    4447#else
    4548_STD(strtof)(CONST char *s, char **sp)
     49#endif
    4650#endif
    4751{
  • trunk/libc/src/fbsdlibc/include/fpmath.h

    r1868 r3892  
    3030#include <sys/endian.h>
    3131#include "_fpmath.h"
     32
     33#ifdef __WATCOMC__
     34# define huge myhuge /* huge is a reserved keyword. Used for constants by the sources. */
     35#endif
    3236
    3337union IEEEf2bits {
  • trunk/libc/src/msun/Makefile.kmk

    r3890 r3892  
    108108        $(PATH_LIBC_SRC)/msun/src/s_ceilf.c \
    109109        $(PATH_LIBC_SRC)/msun/src/s_ceill.c \
    110         $(PATH_LIBC_SRC)/msun/src/s_cimag.c \
    111         $(PATH_LIBC_SRC)/msun/src/s_cimagf.c \
    112         $(PATH_LIBC_SRC)/msun/src/s_cimagl.c \
    113         $(PATH_LIBC_SRC)/msun/src/s_conj.c \
    114         $(PATH_LIBC_SRC)/msun/src/s_conjf.c \
    115         $(PATH_LIBC_SRC)/msun/src/s_conjl.c \
    116110        $(PATH_LIBC_SRC)/msun/src/s_copysign.c \
    117111        $(PATH_LIBC_SRC)/msun/src/s_copysignf.c \
     
    119113        $(PATH_LIBC_SRC)/msun/src/s_cos.c \
    120114        $(PATH_LIBC_SRC)/msun/src/s_cosf.c \
    121         $(PATH_LIBC_SRC)/msun/src/s_creal.c \
    122         $(PATH_LIBC_SRC)/msun/src/s_crealf.c \
    123         $(PATH_LIBC_SRC)/msun/src/s_creall.c \
    124115        $(PATH_LIBC_SRC)/msun/src/s_erf.c \
    125116        $(PATH_LIBC_SRC)/msun/src/s_erff.c \
     
    201192        $(PATH_LIBC_SRC)/msun/src/s_truncf.c \
    202193        $(PATH_LIBC_SRC)/msun/src/s_truncl.c \
    203         $(PATH_LIBC_SRC)/msun/src/w_cabs.c \
    204         $(PATH_LIBC_SRC)/msun/src/w_cabsf.c \
    205194        $(PATH_LIBC_SRC)/msun/src/w_drem.c \
    206195        $(PATH_LIBC_SRC)/msun/src/w_dremf.c \
     196
     197ifndef CFG_LIBC_USE_WATCOM # complex crap
     198libc_msun_SOURCES += \
     199        $(PATH_LIBC_SRC)/msun/src/s_cimag.c \
     200        $(PATH_LIBC_SRC)/msun/src/s_cimagf.c \
     201        $(PATH_LIBC_SRC)/msun/src/s_cimagl.c \
     202        $(PATH_LIBC_SRC)/msun/src/s_conj.c \
     203        $(PATH_LIBC_SRC)/msun/src/s_conjf.c \
     204        $(PATH_LIBC_SRC)/msun/src/s_conjl.c \
     205        $(PATH_LIBC_SRC)/msun/src/s_creal.c \
     206        $(PATH_LIBC_SRC)/msun/src/s_crealf.c \
     207        $(PATH_LIBC_SRC)/msun/src/s_creall.c \
     208        $(PATH_LIBC_SRC)/msun/src/w_cabs.c \
     209        $(PATH_LIBC_SRC)/msun/src/w_cabsf.c
     210endif
     211
    207212
    208213MSUN_ARCH.x86 := \
     
    274279BLDPROGS += hextodecfp
    275280hextodecfp_TEMPLATE = bldprog
    276 hextodecfp_SOURCES = hextodecfp.c
     281hextodecfp_INCS = hextodecfp-incs
     282hextodecfp_SOURCES = \
     283        hextodecfp.c \
     284       \
     285        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/dtoa.c \
     286        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/dmisc.c \
     287        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/gdtoa.c \
     288        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/gethex.c \
     289        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/gmisc.c \
     290        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/hd_init.c \
     291        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/hexnan.c \
     292        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/misc.c \
     293        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/smisc.c \
     294        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtodg.c \
     295        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtodI.c \
     296        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtoId.c \
     297        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtoIdd.c \
     298        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtoIf.c \
     299        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtoIg.c \
     300        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtoIQ.c \
     301        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtoIx.c \
     302        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtoIxL.c \
     303        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtopd.c \
     304        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtopdd.c \
     305        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtopf.c \
     306        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtopQ.c \
     307        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtopx.c \
     308        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtopxL.c \
     309        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtord.c \
     310        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtordd.c \
     311        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtorf.c \
     312        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtorQ.c \
     313        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtorx.c \
     314        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtorxL.c \
     315        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/sum.c \
     316        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/ulp.c \
     317       \
     318        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/glue/machdep_ldisx.c \
     319        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtof.c \
     320        $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtod.c \
     321
     322#       $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/g_ddfmt.c \
     323#       $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/g_dfmt.c \
     324#       $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/g_ffmt.c \
     325#       $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/g_Qfmt.c \
     326#       $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/g_xfmt.c \
     327#       $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/g_xLfmt.c \
     328#       $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/g__fmt.c \
     329
     330#       $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/glue/_hdtoa.c \
     331#       $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/glue/_ldtoa.c \
     332#       $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/glue/glue.c \
     333
     334#       $(PATH_LIBC_SRC)/fbsdlibc/gdtoa/strtof.c \
    277335
    278336
     
    280338include $(PATH_KBUILD)/subfooter.kmk
    281339
     340
     341#
     342# For regenerating the decimal constant sources.
     343# Requires Watcom or GCC.
     344#
     345MSUN_HEXADECIMAL_CONSTANT_SOURCES = \
     346        $(PATH_LIBC_SRC)/msun/bsdsrc/b_exp.c \
     347        $(PATH_LIBC_SRC)/msun/src/s_exp2.c \
     348        $(PATH_LIBC_SRC)/msun/src/s_exp2f.c \
     349        $(PATH_LIBC_SRC)/msun/src/s_fma.c \
     350        $(PATH_LIBC_SRC)/msun/src/s_fmal.c \
     351        $(PATH_LIBC_SRC)/msun/src/s_frexpl.c \
     352        $(PATH_LIBC_SRC)/msun/src/s_remquo.c \
     353        $(PATH_LIBC_SRC)/msun/src/s_remquof.c \
     354        $(PATH_LIBC_SRC)/msun/src/s_scalbnl.c \
     355
     356#$(error x=$(foreach file,$(MSUN_HEXADECIMAL_CONSTANT_SOURCES),$(basename $(file))-decimal-constants.c))
     357$(foreach file,$(MSUN_HEXADECIMAL_CONSTANT_SOURCES),$(basename $(file))-decimal-constants.c): \
     358                $$(dir $$@)$$(firstword $$(subst -, ,$$(notdir $$@))).c $(hextodecfp_1_TARGET)
     359        $(hextodecfp_1_TARGET) -i $< -o $@
     360
     361msun_decimal_constants: $(foreach file,$(MSUN_HEXADECIMAL_CONSTANT_SOURCES),$(basename $(file))-decimal-constants.c)
     362
  • trunk/libc/src/msun/bsdsrc/b_exp.c

    r2013 r3892  
    3131 * SUCH DAMAGE.
    3232 */
     33
     34#if (defined(_MSC_VER) || defined(__WATCOMC__)) && !defined(MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED)
     35# define MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED
     36# include "b_exp-decimal-constants.c"
     37#else
    3338
    3439#include "namespace.h"
     
    177182            return( finite(x) ?  scalb(1.0,5000)  : x);
    178183}
     184#endif /* !_MSC_VER && !__WATCOMC__ */
     185
  • trunk/libc/src/msun/bsdsrc/b_tgamma.c

    r2013 r3892  
    152152                if (x == 0.0)
    153153                        return (one/x);
     154#ifdef __WATCOMC__ /* This is not meaningless use of an expression, dear watcom... */
     155                volatile double tmp =
     156#endif
    154157                one+1e-20;              /* Raise inexact flag. */
    155158                return (one/x);
  • trunk/libc/src/msun/hextodecfp.c

    r3890 r3892  
    1717#include <string.h>
    1818
     19extern float        gdtoa_strtof(const char *, char **);
     20extern double       gdtoa_strtod(const char *, char **);
     21extern long double  gdtoa_strtold(const char *, char **);
     22
    1923
    2024static int Error(const char *pszMsg, ...)
    2125{
    2226    va_list va;
    23     fprintf(stderr, "hextodecfp: error: ");
     27    fprintf(stderr, "hextodecfp: error! ");
    2428    va_start(va, pszMsg);
    2529    vfprintf(stderr, pszMsg, va);
     
    3337    char chSaved = pszInput[cchInput];
    3438
     39#ifndef _MSC_VER
    3540    if (chType == 'l')
    3641    {
    37         long double lrd = strtold(pszInput, NULL);
    38         sprintf(pszOutput, "%Le", lrd);
    39 
     42        long double lrdIn, lrdOut;
     43        lrdIn = gdtoa_strtold(pszInput, NULL);
     44        sprintf(pszOutput, "%.22Le", lrdIn);
     45        lrdOut = gdtoa_strtold(pszOutput, NULL);
     46        if (lrdIn != lrdOut)
     47            fprintf(stderr, "hextodecfp: warning! roundtrip failure for '%.*s' (%Le vs %Le)\n", cchInput, pszInput, lrdIn, lrdOut);
    4048    }
    4149    else
    42     {
    43         double rd = strtod(pszInput, NULL);
    44         sprintf(pszOutput, "%e", rd);
     50#endif
     51    {
     52        double rdIn, rdOut;
     53        rdIn = gdtoa_strtod(pszInput, NULL);
     54        sprintf(pszOutput, "%.22e", rdIn);
     55        rdOut = gdtoa_strtod(pszOutput, NULL);
     56        if (rdIn != rdOut)
     57            fprintf(stderr, "hextodecfp: warning! roundtrip failure for '%.*s' (%e vs %e)\n", cchInput, pszInput, rdIn, rdOut);
    4558    }
    4659
     
    6578        if (*psz == '-')
    6679        {
     80            char ch;
    6781            psz++;
    6882
     
    7993
    8094            /* Process short options. */
    81             while (*psz)
     95            while ((ch = *psz) != '\0')
    8296            {
    8397                /* Check out options taking arguments first. */
    8498                const char *pszValue = NULL;
    85                 switch (*psz)
     99                switch (ch)
    86100                {
    87101                    case 'i':
     
    93107                            i++;
    94108                            if (i >= argc)
    95                                 return Error("Expected value after -%c.", *psz);
     109                                return Error("Expected value after -%c.", ch);
    96110                            pszValue = argv[i];
    97111                        }
     
    101115
    102116                /* Now the real switch */
    103                 switch (*psz)
     117                switch (ch)
    104118                {
    105119                    case 'i':
     
    135149
    136150                    default:
    137                         return Error("Unknown option -%c.", *psz);
     151                        return Error("Unknown option -%c.", ch);
    138152                }
    139153
     
    174188                /* Potential hexadecimal floating-point constant. */
    175189                unsigned u;
    176                 unsigned off = 1;
     190                unsigned off = 2;
    177191                while (   (u = (unsigned)pszCur[off]) != '\0'
    178192                       && (   (u - (unsigned)'0' <= 9U)
     
    180194                           || (u - (unsigned)'A' <= 6U) ) )
    181195                    off++;
    182                 if (u == '.')
     196                if (u == '.' || u == 'p' || u == 'P')
    183197                {
    184198                    /*
     
    186200                     */
    187201                    char chType;
     202                    if (u == '.')
     203                        off++;
    188204
    189205                    /* Fraction. */
    190206                    while (   (u = (unsigned)pszCur[off]) != '\0'
    191207                           && (   (u - (unsigned)'0' <= 9U)
    192                                || (u - (unsigned)'a' <= 6U)
    193                                || (u - (unsigned)'A' <= 6U) ) )
     208                               || (u - (unsigned)'a' <= 5U)
     209                               || (u - (unsigned)'A' <= 5U) ) )
    194210                        off++;
    195211
  • trunk/libc/src/msun/i387/fenv.c

    r3765 r3892  
    5050#endif
    5151
     52#ifdef __WATCOMC__
     53int getfl_worker(void);
     54# pragma aux getfl_worker = \
     55        "pushfd" \
     56        "pop eax" \
     57        value [eax]
     58# define getfl(x) (*(x) = getfl_worker())
     59
     60void setfl_worker(int flags);
     61# pragma aux setfl_worker = \
     62        "push eax" \
     63        "popfd" \
     64        parm [eax] modify exact
     65# define setfl(x) setfl_worker(x)
     66
     67int cpuid_dx_worker(void);
     68# pragma aux getfl_worker = \
     69        "mov eax, 1" \
     70        "cpuid" \
     71        value [edx] modify [eax ebx ecx edx]
     72#define cpuid_dx(x) (*(x) = cpuid_dx_worker())
     73
     74#elif _MSC_VER
     75# define getfl(x) ((*x) = __readeflags())
     76# define setfl(x) __writeeflags(x)
     77static inline int cpuid_dx_worker()
     78{
     79    int info[4];
     80    __cpuid(1, info);
     81    return info[3];
     82}
     83# define cpuid_dx(x) (*(x) = cpuid_dx_worker())
     84
     85#else
    5286#define getfl(x)        __asm __volatile("pushfl\n\tpopl %0" : "=mr" (*(x)))
    5387#define setfl(x)        __asm __volatile("pushl %0\n\tpopfl" : : "g" (x))
     
    5589                                         "cpuid\n\tpopl %%ebx"                \
    5690                                        : "=d" (*(x)) : : "eax", "ecx")
     91#endif
    5792
    5893/*
  • trunk/libc/src/msun/src/math_private.h

    r2150 r3892  
    2020#include <sys/types.h>
    2121#include <machine/endian.h>
     22
     23#if defined(__WATCOMC__) && defined(__SW_OA)
     24# error "The msun sources must be compiled without relaxed aliasing optimization (/oa)."
     25#endif
     26
     27#ifdef __WATCOMC__
     28# define huge myhuge /* huge is a reserved keyword. msun uses it for constants. */
     29#endif
    2230
    2331/*
  • trunk/libc/src/msun/src/s_ceill.c

    r2013 r3892  
    5757ceill(long double x)
    5858{
     59#ifdef __GNUC__
    5960        union IEEEl2bits u = { .e = x };
    6061        int e = u.bits.exp - LDBL_MAX_EXP + 1;
     62#else
     63        union IEEEl2bits u;
     64        int e;
     65
     66        u.e = x;
     67        e = u.bits.exp - LDBL_MAX_EXP + 1;
     68#endif
    6169
    6270        if (e < MANH_SIZE - 1) {
  • trunk/libc/src/msun/src/s_exp2.c

    r2013 r3892  
    2424 * SUCH DAMAGE.
    2525 */
     26
     27#if (defined(_MSC_VER) || defined(__WATCOMC__)) && !defined(MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED)
     28# define MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED
     29# include "s_exp2-decimal-constants.c"
     30#else
    2631
    2732#include "namespace.h"
     
    389394        }
    390395}
     396#endif /* !_MSC_VER && !__WATCOMC__ */
     397
  • trunk/libc/src/msun/src/s_exp2f.c

    r2013 r3892  
    2424 * SUCH DAMAGE.
    2525 */
     26
     27#if (defined(_MSC_VER) || defined(__WATCOMC__)) && !defined(MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED)
     28# define MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED
     29# include "s_exp2f-decimal-constants.c"
     30#else
    2631
    2732#include "namespace.h"
     
    141146        }
    142147}
     148#endif /* !_MSC_VER && !__WATCOMC__ */
     149
  • trunk/libc/src/msun/src/s_floorl.c

    r2013 r3892  
    5757floorl(long double x)
    5858{
     59#ifdef __GNUC__
    5960        union IEEEl2bits u = { .e = x };
    6061        int e = u.bits.exp - LDBL_MAX_EXP + 1;
     62#else
     63        union IEEEl2bits u;
     64        int e;
     65
     66        u.e = x;
     67        e = u.bits.exp - LDBL_MAX_EXP + 1;
     68#endif
    6169
    6270        if (e < MANH_SIZE - 1) {
  • trunk/libc/src/msun/src/s_fma.c

    r2013 r3892  
    2424 * SUCH DAMAGE.
    2525 */
     26
     27#if (defined(_MSC_VER) || defined(__WATCOMC__)) && !defined(MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED)
     28# define MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED
     29# include "s_fma-decimal-constants.c"
     30#else
    2631
    2732#include "namespace.h"
     
    202207__weak_reference(fma, fmal);
    203208#endif
     209#endif /* !_MSC_VER && !__WATCOMC__ */
     210
  • trunk/libc/src/msun/src/s_fmal.c

    r2013 r3892  
    2424 * SUCH DAMAGE.
    2525 */
     26
     27#if (defined(_MSC_VER) || defined(__WATCOMC__)) && !defined(MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED)
     28# define MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED
     29# include "s_fmal-decimal-constants.c"
     30#else
    2631
    2732#include "namespace.h"
     
    182187        return (ldexpl(r, spread));
    183188}
     189#endif /* !_MSC_VER && !__WATCOMC__ */
     190
  • trunk/libc/src/msun/src/s_frexpl.c

    r2013 r3892  
    2626 * $FreeBSD: src/lib/msun/src/s_frexpl.c,v 1.1 2005/03/07 04:54:51 das Exp $
    2727 */
     28
     29#if (defined(_MSC_VER) || defined(__WATCOMC__)) && !defined(MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED)
     30# define MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED
     31# include "s_frexpl-decimal-constants.c"
     32#else
    2833
    2934#include "namespace.h"
     
    6267        return (u.e);
    6368}
     69#endif /* !_MSC_VER && !__WATCOMC__ */
     70
  • trunk/libc/src/msun/src/s_remquo.c

    r2013 r3892  
    1010 * ====================================================
    1111 */
     12
     13#if (defined(_MSC_VER) || defined(__WATCOMC__)) && !defined(MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED)
     14# define MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED
     15# include "s_remquo-decimal-constants.c"
     16#else
    1217
    1318#include "namespace.h"
     
    152157        return x;
    153158}
     159#endif /* !_MSC_VER && !__WATCOMC__ */
     160
  • trunk/libc/src/msun/src/s_remquof.c

    r2013 r3892  
    1010 * ====================================================
    1111 */
     12
     13#if (defined(_MSC_VER) || defined(__WATCOMC__)) && !defined(MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED)
     14# define MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED
     15# include "s_remquof-decimal-constants.c"
     16#else
     17
    1218
    1319#include "namespace.h"
     
    121127        return x;
    122128}
     129#endif /* !_MSC_VER && !__WATCOMC__ */
     130
  • trunk/libc/src/msun/src/s_scalbnl.c

    r2150 r3892  
    1010 * ====================================================
    1111 */
     12
     13#if (defined(_MSC_VER) || defined(__WATCOMC__)) && !defined(MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED)
     14# define MSUN_DECIMAL_CONSTANTS_SOURCE_INCLUDED
     15# include "s_scalbnl-decimal-constants.c"
     16#else
    1217
    1318#include "namespace.h"
     
    7176
    7277__strong_reference(_std_scalbnl, _std_ldexpl);
     78#endif /* !_MSC_VER && !__WATCOMC__ */
     79
  • trunk/libc/src/msun/src/s_truncl.c

    r2013 r3892  
    4343truncl(long double x)
    4444{
     45#ifdef __GNUC__
    4546        union IEEEl2bits u = { .e = x };
    4647        int e = u.bits.exp - LDBL_MAX_EXP + 1;
     48#else
     49        union IEEEl2bits u;
     50        int e;
     51
     52        u.e = x;
     53        e = u.bits.exp - LDBL_MAX_EXP + 1;
     54#endif
    4755
    4856        if (e < MANH_SIZE - 1) {
Note: See TracChangeset for help on using the changeset viewer.