]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[libc] Add abs()
authorMichael Brown <mcb30@ipxe.org>
Tue, 7 Jan 2014 03:53:56 +0000 (03:53 +0000)
committerMichael Brown <mcb30@ipxe.org>
Sun, 12 Jan 2014 21:53:16 +0000 (22:53 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/stdlib.h

index bca85a234e6014fa3ab2b008c6631a4bf79bcc7c..2951522b8a4581eb78eaab135b901b03c7cab223 100644 (file)
@@ -93,6 +93,10 @@ static inline void srand ( unsigned int seed ) {
  ****************************************************************************
  */
 
+static inline __attribute__ (( always_inline )) int abs ( int value ) {
+       return __builtin_abs ( value );
+}
+
 extern int system ( const char *command );
 extern __asmcall int main ( void );