1 extern int inside_main; 2 extern void abort (void); 3 #ifdef __OPTIMIZE__ 4 #define ABORT_INSIDE_MAIN do { if (inside_main) abort (); } while (0) 5 #else 6 #define ABORT_INSIDE_MAIN do { } while (0) 7 #endif 8 9 typedef __INTMAX_TYPE__ intmax_t; 10 11 __attribute__ ((__noinline__)) 12 int abs(int x)13abs (int x) 14 { 15 ABORT_INSIDE_MAIN; 16 return x < 0 ? -x : x; 17 } 18 19 __attribute__ ((__noinline__)) 20 long labs(long x)21labs (long x) 22 { 23 ABORT_INSIDE_MAIN; 24 return x < 0 ? -x : x; 25 } 26 27 __attribute__ ((__noinline__)) 28 long long llabs(long long x)29llabs (long long x) 30 { 31 ABORT_INSIDE_MAIN; 32 return x < 0 ? -x : x; 33 } 34 35 __attribute__ ((__noinline__)) 36 intmax_t imaxabs(intmax_t x)37imaxabs (intmax_t x) 38 { 39 ABORT_INSIDE_MAIN; 40 return x < 0 ? -x : x; 41 } 42