Skip to content

Commit

Permalink
zephyr: Add _POSIX_C_SOURCE definition to fix build
Browse files Browse the repository at this point in the history
Since version 3.6 of Zephyr, the _POSIX_C_SOURCE definition is
required to be set per file to specify the version of the POSIX
standard to be used.

Define _POSIX_C_SOURCE to 200809L in the files that use strtok_r
and strnlen.

Signed-off-by: Mykyta Poturai <[email protected]>
  • Loading branch information
Deedone committed Feb 28, 2024
1 parent f9aba2d commit dc47b5a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libfdt/fdt_ro.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* libfdt - Flat Device Tree manipulation
* Copyright (C) 2006 David Gibson, IBM Corporation.
*/
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L

#include "libfdt_env.h"

#include <fdt.h>
Expand Down
3 changes: 3 additions & 0 deletions xen-dom-mgmt/src/xl_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L

#include <stdlib.h>
#include <string.h>
#include <stddef.h>
Expand Down
4 changes: 4 additions & 0 deletions xenstore-srv/src/xenstore_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
* SPDX-License-Identifier: Apache-2.0
*/

#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L

#include <stdint.h>
#include <string.h>
#include <strings.h>
#include <stdio.h>

#include <zephyr/init.h>
Expand Down

0 comments on commit dc47b5a

Please sign in to comment.