From 80d7bc30601be0ef93f6c6e54401a1b23d0f163a Mon Sep 17 00:00:00 2001 From: yidong0635 Date: Wed, 27 May 2020 14:32:44 -0400 Subject: [PATCH] app/spdk_top: Include header file by case. For compatible on different OS, need to using __has_include. And this can't be simplified. ncurses file is different on openSUSE. Fixes issue #1400. Signed-off-by: yidong0635 Change-Id: I612e7c37d054da90206499bcdfe8cc06cd8cc360 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2638 Community-CI: Mellanox Build Bot Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- app/spdk_top/spdk_top.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/spdk_top/spdk_top.c b/app/spdk_top/spdk_top.c index 165418cfb..0b7c9269a 100644 --- a/app/spdk_top/spdk_top.c +++ b/app/spdk_top/spdk_top.c @@ -38,10 +38,21 @@ #include "spdk/util.h" #include "spdk/env.h" +#if defined __has_include +#if __has_include() +#include +#include +#include +#else #include #include #include - +#endif +#else +#include +#include +#include +#endif #define RPC_MAX_THREADS 1024 #define RPC_MAX_POLLERS 1024