Skip to content

Commit effdc25

Browse files
committed
libyang BUGFIX freeBSD compilation fixes
1 parent a91da26 commit effdc25

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/parser_common.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Michal Vasko <mvasko@cesnet.cz>
44
* @brief libyang common parser functions.
55
*
6-
* Copyright (c) 2015 - 2024 CESNET, z.s.p.o.
6+
* Copyright (c) 2015 - 2025 CESNET, z.s.p.o.
77
*
88
* This source code is licensed under BSD 3-Clause License (the "License").
99
* You may not use this file except in compliance with the License.
@@ -13,7 +13,9 @@
1313
*/
1414

1515
#define _GNU_SOURCE
16-
#define _POSIX_C_SOURCE 200809L /* strdup, strndup */
16+
#if defined (__FreeBSD__) /* hides asprintf */
17+
# define _POSIX_C_SOURCE 200809L /* strdup, strndup */
18+
#endif
1719

1820
#ifdef __APPLE__
1921
#define _DARWIN_C_SOURCE /* F_GETPATH */

tools/lint/completion.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Michal Vasko <mvasko@cesnet.cz>
44
* @brief libyang's yanglint tool auto completion
55
*
6-
* Copyright (c) 2015 CESNET, z.s.p.o.
6+
* Copyright (c) 2015 - 2025 CESNET, z.s.p.o.
77
*
88
* This source code is licensed under BSD 3-Clause License (the "License").
99
* You may not use this file except in compliance with the License.
@@ -13,7 +13,9 @@
1313
*/
1414

1515
#define _GNU_SOURCE
16-
#define _POSIX_C_SOURCE 200809L /* strdup */
16+
#if defined (__FreeBSD__) /* hides asprintf */
17+
# define _POSIX_C_SOURCE 200809L /* strdup */
18+
#endif
1719

1820
#include <dirent.h>
1921
#include <errno.h>

0 commit comments

Comments
 (0)