33 lines · plain
1#pragma once2 3#include <stdlib.h>4 5#if __cplusplus >= 201703L6extern int abs (int __x) throw() __attribute__ ((__const__)) ;7extern long int labs (long int __x) throw() __attribute__ ((__const__)) ;8#else9extern int abs (int __x) __attribute__ ((__const__)) ;10extern long int labs (long int __x) __attribute__ ((__const__)) ;11#endif12 13namespace std14{15 16using ::abs;17 18inline long19abs(long __i) { return __builtin_labs(__i); }20 21inline long long22abs(long long __x) { return __builtin_llabs (__x); }23 24float fabs(float __x) { return __builtin_fabs(__x); }25 26float abs(float __x) { return fabs(__x); }27double abs(double __x) { return fabs(__x); }28 29using ::malloc;30using ::free;31}32 33