From 9044e1ac96194a06e2a779c241d3e8822929a59d Mon Sep 17 00:00:00 2001 From: Vipul Rahane Date: Fri, 15 Dec 2017 12:48:40 -0800 Subject: [PATCH] Fix compiler warnings for tst_cpp - The defines(_BSD_SOURCE, _DEFAULT_SOURCE) were getting defined in multiple source files generating warnings - Solution is to conditionally define the above --- src/cborencoder.c | 4 ++++ src/cborparser.c | 4 ++++ src/cborparser_dup_string.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/cborencoder.c b/src/cborencoder.c index fc12d570..de0a8847 100644 --- a/src/cborencoder.c +++ b/src/cborencoder.c @@ -22,8 +22,12 @@ ** ****************************************************************************/ +#ifndef _BSD_SOURCE #define _BSD_SOURCE 1 +#endif +#ifndef _DEFAULT_SOURCE #define _DEFAULT_SOURCE 1 +#endif #ifndef __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS 1 #endif diff --git a/src/cborparser.c b/src/cborparser.c index b7d413bb..8aa12983 100644 --- a/src/cborparser.c +++ b/src/cborparser.c @@ -22,8 +22,12 @@ ** ****************************************************************************/ +#ifndef _BSD_SOURCE #define _BSD_SOURCE 1 +#endif +#ifndef _DEFAULT_SOURCE #define _DEFAULT_SOURCE 1 +#endif #ifndef __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS 1 #endif diff --git a/src/cborparser_dup_string.c b/src/cborparser_dup_string.c index 64f3884b..66a908e5 100644 --- a/src/cborparser_dup_string.c +++ b/src/cborparser_dup_string.c @@ -22,8 +22,12 @@ ** ****************************************************************************/ +#ifndef _BSD_SOURCE #define _BSD_SOURCE 1 +#endif +#ifndef _DEFAULT_SOURCE #define _DEFAULT_SOURCE 1 +#endif #ifndef __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS 1 #endif