> -----Original Message-----
> From: lng-odp-boun...@lists.linaro.org [mailto:lng-odp-
> boun...@lists.linaro.org] On Behalf Of ext Mike Holmes
> Sent: Friday, October 31, 2014 8:25 PM
> To: lng-odp@lists.linaro.org
> Subject: [lng-odp] [PATCH 1/2] fix including odp_std_types.h
> 
> The public ODP API should not directly call Linux system  headers

API headers should not include Linux headers at all, only C std lib headers.


> 
> Signed-off-by: Mike Holmes <mike.hol...@linaro.org>
> ---
>  platform/linux-generic/include/api/odp_byteorder.h | 1 -
>  platform/linux-generic/include/api/odp_debug.h     | 3 +--
>  platform/linux-generic/include/api/odp_std_types.h | 4 +++-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/platform/linux-generic/include/api/odp_byteorder.h
> b/platform/linux-generic/include/api/odp_byteorder.h
> index 79ddd75..6834ad9 100644
> --- a/platform/linux-generic/include/api/odp_byteorder.h
> +++ b/platform/linux-generic/include/api/odp_byteorder.h
> @@ -18,7 +18,6 @@
>  extern "C" {
>  #endif
> 
> -#include <endian.h>
>  #include <odp_std_types.h>
>  #include <odp_compiler.h>
> 
> diff --git a/platform/linux-generic/include/api/odp_debug.h
> b/platform/linux-generic/include/api/odp_debug.h
> index 0a20430..dad57a8 100644
> --- a/platform/linux-generic/include/api/odp_debug.h
> +++ b/platform/linux-generic/include/api/odp_debug.h
> @@ -12,8 +12,7 @@
>  #ifndef ODP_DEBUG_H_
>  #define ODP_DEBUG_H_
> 
> -#include <stdio.h>
> -#include <stdlib.h>
> +#include <odp_std_types.h>
> 
>  #ifdef __cplusplus
>  extern "C" {
> diff --git a/platform/linux-generic/include/api/odp_std_types.h
> b/platform/linux-generic/include/api/odp_std_types.h
> index b12a2f3..af8c35d 100644
> --- a/platform/linux-generic/include/api/odp_std_types.h
> +++ b/platform/linux-generic/include/api/odp_std_types.h
> @@ -26,7 +26,9 @@ extern "C" {
>  #include <stdint.h>
>  #include <inttypes.h>
>  #include <limits.h>
> -
> +#include <endian.h>

This is not a standard C header and should not be included here. Endian 
implementation uses some definitions (e.g. _BYTE_ORDER) from endian.h. It's 
part of implementation and better keep the include in odp_byteorder.h. We could 
instead remove endian.h and implement the same definitions in the build system.

-Petri


> +#include <stdio.h>
> +#include <stdlib.h>
> 
> 
> 
> --
> 2.1.0
> 
> 
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to