- Timestamp:
- Jun 29, 2014, 6:12:30 PM (11 years ago)
- Location:
- trunk/libc
- Files:
-
- 20 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/Config.kmk
r3891 r3892 178 178 # Only permit #include <include/emx/bigint.h>. 179 179 TEMPLATE_bldprog = Build programs 180 TEMPLATE_bldprog_DEFS = __LIBC_BUILD_PROGRAM__ 180 TEMPLATE_bldprog_DEFS = __LIBC_BUILD_PROGRAM__ __KLIBC_BUILD_PROGRAM__ 181 181 TEMPLATE_bldprog_LIBSUFF = .a 182 182 if defined(CFG_LIBC_USE_WATCOM) … … 184 184 TEMPLATE_bldprog_INCS = $(TOOL_OPENWATCOM_CXXINCS) $(PATH_LIBC_ROOT) 185 185 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 187 190 else 188 191 TEMPLATE_bldprog_TOOL = GCC3 -
trunk/libc/include/sys/bsd/cdefs.h
r3824 r3892 484 484 #endif /* __GNUC__ || __INTEL_COMPILER */ 485 485 #else /* bird */ 486 #define __strong_reference(sym,aliassym) \ 486 # ifdef __GNUC__ /* bird */ 487 # define __strong_reference(sym,aliassym) \ 487 488 extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))); /* bird */ 489 # else /* bird */ 490 # define __strong_reference(sym,aliassym) /* bird */ 491 # endif /* bird */ 488 492 #endif /* bird */ 489 493 -
trunk/libc/include/sys/cdefs.h
r3883 r3892 122 122 * Include the other cdefs.h Fortunately, they use different blocker macros. 123 123 */ 124 #include <sys/bsd/cdefs.h>125 #include <sys/gnu/cdefs.h>124 #include "bsd/cdefs.h" 125 #include "gnu/cdefs.h" 126 126 127 127 /* -
trunk/libc/src/fbsdlibc/gdtoa/gdtoa.h
r1862 r3892 114 114 int mode, int ndigits, int *decpt, char **rve)); 115 115 extern void freedtoa ANSI((char*)); 116 #ifndef __KLIBC_BUILD_PROGRAM__ 116 117 extern float strtof ANSI((CONST char *, char **)); 117 118 extern double strtod ANSI((CONST char *, char **)); 119 #endif 118 120 extern int strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*)); 119 121 -
trunk/libc/src/fbsdlibc/gdtoa/gdtoaimp.h
r3820 r3892 195 195 #include "namespace.h" 196 196 #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 199 201 #else /* !__IN_KLIBC__ */ 200 202 #include <pthread.h> … … 477 479 #endif 478 480 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 479 486 #define MULTIPLE_THREADS 480 # ifdef __IN_KLIBC__487 # ifdef __IN_KLIBC__ 481 488 extern _fmutex __libc_gdtoa_locks[2]; 482 489 #define ACQUIRE_DTOA_LOCK(n) do { \ … … 488 495 _fmutex_checked_release(&__libc_gdtoa_locks[n]); \ 489 496 } while(0) 490 # else /* !__IN_KLIBC__ */497 # else /* !__IN_KLIBC__ */ 491 498 extern pthread_mutex_t __gdtoa_locks[2]; 492 499 #define ACQUIRE_DTOA_LOCK(n) do { \ … … 498 505 _pthread_mutex_unlock(&__gdtoa_locks[n]); \ 499 506 } while(0) 500 #endif /* !__IN_KLIBC__ */ 507 # endif /* !__IN_KLIBC__ */ 508 #endif /* !__KLIBC_BUILD_PROGRAM__ */ 501 509 502 510 #define Kmax 15 … … 521 529 #endif /* NO_STRING_H */ 522 530 531 #ifndef __KLIBC_BUILD_PROGRAM__ 532 #error 523 533 /* 524 534 * Paranoia: Protect exported symbols, including ones in files we don't … … 603 613 #define trailz __trailz_D2A 604 614 #define ulp __ulp_D2A 615 #endif /* !__KLIBC_BUILD_PROGRAM__ */ 605 616 606 617 extern char *dtoa_result; -
trunk/libc/src/fbsdlibc/gdtoa/glue/machdep_ldisx.c
r3821 r3892 40 40 #endif 41 41 42 #ifdef __KLIBC_BUILD_PROGRAM__ 43 long double gdtoa_strtold(const char *s, char **sp) 44 #else 42 45 long double 43 46 _STD(strtold)(const char * __restrict s, char ** __restrict sp) 47 #endif 44 48 { 45 49 long double result; -
trunk/libc/src/fbsdlibc/gdtoa/strtod.c
r3821 r3892 42 42 #define Avoid_Underflow 43 43 #undef tinytens 44 #define tinytens local_tinytens /* bird - scope changed. */ 44 45 /* The factor of 2^53 in tinytens[4] helps us avoid setting the underflow */ 45 46 /* flag unnecessarily. It leads to a song and dance at the end of strtod. */ … … 58 59 #endif 59 60 61 #ifdef __KLIBC_BUILD_PROGRAM__ 62 double gdtoa_strtod(const char *s00, char **se) 63 #else /* !__KLIBC_BUILD_PROGRAM__ */ 60 64 double 61 65 #ifdef __IN_KLIBC__ … … 69 73 (CONST char *s00, char **se) 70 74 #endif 75 #endif /* !__KLIBC_BUILD_PROGRAM__ */ 71 76 { 72 77 #ifdef Avoid_Underflow -
trunk/libc/src/fbsdlibc/gdtoa/strtof.c
r1871 r3892 39 39 #include <stdlib.h> 40 40 41 #ifdef __KLIBC_BUILD_PROGRAM__ 42 float gdtoa_strtof(const char *s, char **sp) 43 #else 41 44 float 42 45 #ifdef KR_headers … … 44 47 #else 45 48 _STD(strtof)(CONST char *s, char **sp) 49 #endif 46 50 #endif 47 51 { -
trunk/libc/src/fbsdlibc/include/fpmath.h
r1868 r3892 30 30 #include <sys/endian.h> 31 31 #include "_fpmath.h" 32 33 #ifdef __WATCOMC__ 34 # define huge myhuge /* huge is a reserved keyword. Used for constants by the sources. */ 35 #endif 32 36 33 37 union IEEEf2bits { -
trunk/libc/src/msun/Makefile.kmk
r3890 r3892 108 108 $(PATH_LIBC_SRC)/msun/src/s_ceilf.c \ 109 109 $(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 \116 110 $(PATH_LIBC_SRC)/msun/src/s_copysign.c \ 117 111 $(PATH_LIBC_SRC)/msun/src/s_copysignf.c \ … … 119 113 $(PATH_LIBC_SRC)/msun/src/s_cos.c \ 120 114 $(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 \124 115 $(PATH_LIBC_SRC)/msun/src/s_erf.c \ 125 116 $(PATH_LIBC_SRC)/msun/src/s_erff.c \ … … 201 192 $(PATH_LIBC_SRC)/msun/src/s_truncf.c \ 202 193 $(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 \205 194 $(PATH_LIBC_SRC)/msun/src/w_drem.c \ 206 195 $(PATH_LIBC_SRC)/msun/src/w_dremf.c \ 196 197 ifndef CFG_LIBC_USE_WATCOM # complex crap 198 libc_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 210 endif 211 207 212 208 213 MSUN_ARCH.x86 := \ … … 274 279 BLDPROGS += hextodecfp 275 280 hextodecfp_TEMPLATE = bldprog 276 hextodecfp_SOURCES = hextodecfp.c 281 hextodecfp_INCS = hextodecfp-incs 282 hextodecfp_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 \ 277 335 278 336 … … 280 338 include $(PATH_KBUILD)/subfooter.kmk 281 339 340 341 # 342 # For regenerating the decimal constant sources. 343 # Requires Watcom or GCC. 344 # 345 MSUN_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 361 msun_decimal_constants: $(foreach file,$(MSUN_HEXADECIMAL_CONSTANT_SOURCES),$(basename $(file))-decimal-constants.c) 362 -
trunk/libc/src/msun/bsdsrc/b_exp.c
r2013 r3892 31 31 * SUCH DAMAGE. 32 32 */ 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 33 38 34 39 #include "namespace.h" … … 177 182 return( finite(x) ? scalb(1.0,5000) : x); 178 183 } 184 #endif /* !_MSC_VER && !__WATCOMC__ */ 185 -
trunk/libc/src/msun/bsdsrc/b_tgamma.c
r2013 r3892 152 152 if (x == 0.0) 153 153 return (one/x); 154 #ifdef __WATCOMC__ /* This is not meaningless use of an expression, dear watcom... */ 155 volatile double tmp = 156 #endif 154 157 one+1e-20; /* Raise inexact flag. */ 155 158 return (one/x); -
trunk/libc/src/msun/hextodecfp.c
r3890 r3892 17 17 #include <string.h> 18 18 19 extern float gdtoa_strtof(const char *, char **); 20 extern double gdtoa_strtod(const char *, char **); 21 extern long double gdtoa_strtold(const char *, char **); 22 19 23 20 24 static int Error(const char *pszMsg, ...) 21 25 { 22 26 va_list va; 23 fprintf(stderr, "hextodecfp: error :");27 fprintf(stderr, "hextodecfp: error! "); 24 28 va_start(va, pszMsg); 25 29 vfprintf(stderr, pszMsg, va); … … 33 37 char chSaved = pszInput[cchInput]; 34 38 39 #ifndef _MSC_VER 35 40 if (chType == 'l') 36 41 { 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); 40 48 } 41 49 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); 45 58 } 46 59 … … 65 78 if (*psz == '-') 66 79 { 80 char ch; 67 81 psz++; 68 82 … … 79 93 80 94 /* Process short options. */ 81 while ( *psz)95 while ((ch = *psz) != '\0') 82 96 { 83 97 /* Check out options taking arguments first. */ 84 98 const char *pszValue = NULL; 85 switch ( *psz)99 switch (ch) 86 100 { 87 101 case 'i': … … 93 107 i++; 94 108 if (i >= argc) 95 return Error("Expected value after -%c.", *psz);109 return Error("Expected value after -%c.", ch); 96 110 pszValue = argv[i]; 97 111 } … … 101 115 102 116 /* Now the real switch */ 103 switch ( *psz)117 switch (ch) 104 118 { 105 119 case 'i': … … 135 149 136 150 default: 137 return Error("Unknown option -%c.", *psz);151 return Error("Unknown option -%c.", ch); 138 152 } 139 153 … … 174 188 /* Potential hexadecimal floating-point constant. */ 175 189 unsigned u; 176 unsigned off = 1;190 unsigned off = 2; 177 191 while ( (u = (unsigned)pszCur[off]) != '\0' 178 192 && ( (u - (unsigned)'0' <= 9U) … … 180 194 || (u - (unsigned)'A' <= 6U) ) ) 181 195 off++; 182 if (u == '.' )196 if (u == '.' || u == 'p' || u == 'P') 183 197 { 184 198 /* … … 186 200 */ 187 201 char chType; 202 if (u == '.') 203 off++; 188 204 189 205 /* Fraction. */ 190 206 while ( (u = (unsigned)pszCur[off]) != '\0' 191 207 && ( (u - (unsigned)'0' <= 9U) 192 || (u - (unsigned)'a' <= 6U)193 || (u - (unsigned)'A' <= 6U) ) )208 || (u - (unsigned)'a' <= 5U) 209 || (u - (unsigned)'A' <= 5U) ) ) 194 210 off++; 195 211 -
trunk/libc/src/msun/i387/fenv.c
r3765 r3892 50 50 #endif 51 51 52 #ifdef __WATCOMC__ 53 int getfl_worker(void); 54 # pragma aux getfl_worker = \ 55 "pushfd" \ 56 "pop eax" \ 57 value [eax] 58 # define getfl(x) (*(x) = getfl_worker()) 59 60 void 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 67 int 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) 77 static 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 52 86 #define getfl(x) __asm __volatile("pushfl\n\tpopl %0" : "=mr" (*(x))) 53 87 #define setfl(x) __asm __volatile("pushl %0\n\tpopfl" : : "g" (x)) … … 55 89 "cpuid\n\tpopl %%ebx" \ 56 90 : "=d" (*(x)) : : "eax", "ecx") 91 #endif 57 92 58 93 /* -
trunk/libc/src/msun/src/math_private.h
r2150 r3892 20 20 #include <sys/types.h> 21 21 #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 22 30 23 31 /* -
trunk/libc/src/msun/src/s_ceill.c
r2013 r3892 57 57 ceill(long double x) 58 58 { 59 #ifdef __GNUC__ 59 60 union IEEEl2bits u = { .e = x }; 60 61 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 61 69 62 70 if (e < MANH_SIZE - 1) { -
trunk/libc/src/msun/src/s_exp2.c
r2013 r3892 24 24 * SUCH DAMAGE. 25 25 */ 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 26 31 27 32 #include "namespace.h" … … 389 394 } 390 395 } 396 #endif /* !_MSC_VER && !__WATCOMC__ */ 397 -
trunk/libc/src/msun/src/s_exp2f.c
r2013 r3892 24 24 * SUCH DAMAGE. 25 25 */ 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 26 31 27 32 #include "namespace.h" … … 141 146 } 142 147 } 148 #endif /* !_MSC_VER && !__WATCOMC__ */ 149 -
trunk/libc/src/msun/src/s_floorl.c
r2013 r3892 57 57 floorl(long double x) 58 58 { 59 #ifdef __GNUC__ 59 60 union IEEEl2bits u = { .e = x }; 60 61 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 61 69 62 70 if (e < MANH_SIZE - 1) { -
trunk/libc/src/msun/src/s_fma.c
r2013 r3892 24 24 * SUCH DAMAGE. 25 25 */ 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 26 31 27 32 #include "namespace.h" … … 202 207 __weak_reference(fma, fmal); 203 208 #endif 209 #endif /* !_MSC_VER && !__WATCOMC__ */ 210 -
trunk/libc/src/msun/src/s_fmal.c
r2013 r3892 24 24 * SUCH DAMAGE. 25 25 */ 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 26 31 27 32 #include "namespace.h" … … 182 187 return (ldexpl(r, spread)); 183 188 } 189 #endif /* !_MSC_VER && !__WATCOMC__ */ 190 -
trunk/libc/src/msun/src/s_frexpl.c
r2013 r3892 26 26 * $FreeBSD: src/lib/msun/src/s_frexpl.c,v 1.1 2005/03/07 04:54:51 das Exp $ 27 27 */ 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 28 33 29 34 #include "namespace.h" … … 62 67 return (u.e); 63 68 } 69 #endif /* !_MSC_VER && !__WATCOMC__ */ 70 -
trunk/libc/src/msun/src/s_remquo.c
r2013 r3892 10 10 * ==================================================== 11 11 */ 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 12 17 13 18 #include "namespace.h" … … 152 157 return x; 153 158 } 159 #endif /* !_MSC_VER && !__WATCOMC__ */ 160 -
trunk/libc/src/msun/src/s_remquof.c
r2013 r3892 10 10 * ==================================================== 11 11 */ 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 12 18 13 19 #include "namespace.h" … … 121 127 return x; 122 128 } 129 #endif /* !_MSC_VER && !__WATCOMC__ */ 130 -
trunk/libc/src/msun/src/s_scalbnl.c
r2150 r3892 10 10 * ==================================================== 11 11 */ 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 12 17 13 18 #include "namespace.h" … … 71 76 72 77 __strong_reference(_std_scalbnl, _std_ldexpl); 78 #endif /* !_MSC_VER && !__WATCOMC__ */ 79 -
trunk/libc/src/msun/src/s_truncl.c
r2013 r3892 43 43 truncl(long double x) 44 44 { 45 #ifdef __GNUC__ 45 46 union IEEEl2bits u = { .e = x }; 46 47 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 47 55 48 56 if (e < MANH_SIZE - 1) {
Note:
See TracChangeset
for help on using the changeset viewer.