Changeset 84929b0 in mainline for uspace/lib/math/generic/__signbit.c


Ignore:
Timestamp:
2018-08-29T20:06:00Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Children:
ed9043f7
Parents:
184ff675
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 19:44:33)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 20:06:00)
Message:

Strip libmath to the bare necessities

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/math/generic/__signbit.c

    r184ff675 r84929b0  
    11/*
    2  * Copyright (c) 2014 Martin Decky
     2 * Copyright (c) 2018 CZ.NIC, z.s.p.o.
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libmath
    30  * @{
     29#include <math.h>
     30#include <stdarg.h>
     31
     32/**
     33 * Fallback symbol used when code including <math.h> is compiled with something
     34 * other than GCC or Clang. The function itself must be built with GCC or Clang.
    3135 */
    32 /** @file
    33  */
     36int __signbit(size_t sz, ...)
     37{
     38        va_list ap;
     39        va_start(ap, sz);
    3440
    35 #ifndef LIBMATH_TRIG_H_
    36 #define LIBMATH_TRIG_H_
     41        int result;
    3742
    38 #include <mathtypes.h>
     43        switch (sz) {
     44        case 4:
     45                result = signbit(va_arg(ap, double));
     46                break;
     47        case 8:
     48                result = signbit(va_arg(ap, double));
     49                break;
     50        default:
     51                result = signbit(va_arg(ap, long double));
     52                break;
     53        }
    3954
    40 extern float32_t float32_sin(float32_t);
    41 extern float64_t float64_sin(float64_t);
    42 extern float32_t float32_cos(float32_t);
    43 extern float64_t float64_cos(float64_t);
     55        va_end(ap);
     56        return result;
     57}
    4458
    45 #endif
    46 
    47 /** @}
    48  */
Note: See TracChangeset for help on using the changeset viewer.