194695718SGheorghe-Teodor Bercea#pragma once 294695718SGheorghe-Teodor Bercea 3f85ae058SJohannes Doerfert#include <stdlib.h> 4f85ae058SJohannes Doerfert 57641f310SGheorghe-Teodor Bercea#if __cplusplus >= 201703L 67641f310SGheorghe-Teodor Berceaextern int abs (int __x) throw() __attribute__ ((__const__)) ; 77641f310SGheorghe-Teodor Berceaextern long int labs (long int __x) throw() __attribute__ ((__const__)) ; 87641f310SGheorghe-Teodor Bercea#else 994695718SGheorghe-Teodor Berceaextern int abs (int __x) __attribute__ ((__const__)) ; 1094695718SGheorghe-Teodor Berceaextern long int labs (long int __x) __attribute__ ((__const__)) ; 117641f310SGheorghe-Teodor Bercea#endif 1294695718SGheorghe-Teodor Bercea 1394695718SGheorghe-Teodor Berceanamespace std 1494695718SGheorghe-Teodor Bercea{ 1594695718SGheorghe-Teodor Bercea 1694695718SGheorghe-Teodor Berceausing ::abs; 1794695718SGheorghe-Teodor Bercea 1894695718SGheorghe-Teodor Berceainline long 1994695718SGheorghe-Teodor Berceaabs(long __i) { return __builtin_labs(__i); } 2094695718SGheorghe-Teodor Bercea 2194695718SGheorghe-Teodor Berceainline long long 2294695718SGheorghe-Teodor Berceaabs(long long __x) { return __builtin_llabs (__x); } 23f85ae058SJohannes Doerfert 24f85ae058SJohannes Doerfertfloat fabs(float __x) { return __builtin_fabs(__x); } 25d999cbc9SJohannes Doerfert 26d999cbc9SJohannes Doerfertfloat abs(float __x) { return fabs(__x); } 27d999cbc9SJohannes Doerfertdouble abs(double __x) { return fabs(__x); } 28d999cbc9SJohannes Doerfert 29*053dd30bSYaxun (Sam) Liuusing ::malloc; 30*053dd30bSYaxun (Sam) Liuusing ::free; 3194695718SGheorghe-Teodor Bercea} 32713a5d12SPushpinder Singh 33