From 8f7453b5ecc6d5ca7641c756f285495e4d02b468 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 14 Aug 2015 12:04:57 -0600 Subject: [PATCH] Addings to stdlib.h must be added to cstdlib too --- include/cxx/cstdlib | 18 ++++++++++++++++-- include/stdlib.h | 9 +++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/include/cxx/cstdlib b/include/cxx/cstdlib index 790996a8ea..419291c789 100644 --- a/include/cxx/cstdlib +++ b/include/cxx/cstdlib @@ -1,7 +1,7 @@ //*************************************************************************** // include/cxx/cstdlib // -// Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. +// Copyright (C) 2009, 2012, 2015 Gregory Nutt. All rights reserved. // Author: Gregory Nutt // // Redistribution and use in source and binary forms, with or without @@ -100,15 +100,29 @@ namespace std using ::calloc; using ::mallinfo; - // Misc. + // Arithmetic using ::abs; using ::labs; #ifdef CONFIG_HAVE_LONG_LONG using ::llabs; #endif + +#ifdef CONFIG_CAN_PASS_STRUCTS + using ::div; + using ::ldiv; +#ifdef CONFIG_HAVE_LONG_LONG + using ::lldiv; +#endif +#endif + + // Temporary files + using ::mktemp; using ::mkstemp; + + // Sorting + using ::qsort; } diff --git a/include/stdlib.h b/include/stdlib.h index 433b11dc9a..12a1b951a9 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -203,6 +203,11 @@ FAR void *calloc(size_t, size_t); /* Arithmetic */ int abs(int j); +long int labs(long int j); +#ifdef CONFIG_HAVE_LONG_LONG +long long int llabs(long long int j); +#endif + #ifdef CONFIG_CAN_PASS_STRUCTS div_t div(int numer, int denom); ldiv_t ldiv(long numer, long denom); @@ -210,10 +215,6 @@ ldiv_t ldiv(long numer, long denom); lldiv_t lldiv(long long numer, long long denom); #endif #endif -long int labs(long int j); -#ifdef CONFIG_HAVE_LONG_LONG -long long int llabs(long long int j); -#endif /* Temporary files */