1#pragma once 2 3#include <stdlib.h> 4 5#if __cplusplus >= 201703L 6extern int abs (int __x) throw() __attribute__ ((__const__)) ; 7extern long int labs (long int __x) throw() __attribute__ ((__const__)) ; 8#else 9extern int abs (int __x) __attribute__ ((__const__)) ; 10extern long int labs (long int __x) __attribute__ ((__const__)) ; 11#endif 12 13namespace std 14{ 15 16using ::abs; 17 18inline long 19abs(long __i) { return __builtin_labs(__i); } 20 21inline long long 22abs(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