-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
strerror, strerror_r, gai_strerror, perror: Add full implementation
DONE: RTOS-569
- Loading branch information
1 parent
d1a034b
commit 4dd2ecd
Showing
3 changed files
with
182 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,8 @@ | ||
# | ||
# Makefile for libphoenix/string | ||
# | ||
# Copyright 2017, 2020 Phoenix Systems | ||
# Copyright 2017, 2020, 2023 Phoenix Systems | ||
# Author: Pawel Pisarczyk | ||
# | ||
|
||
INCS := errno.str.inc errno.tab.inc gaierr.str.inc gaierr.tab.inc | ||
|
||
|
||
ERR_EXTRACT := $(SED) -En -e '/^\s*\#\s*define\s+E\w+\s+[[:digit:]]+/{s/^[^d]*define\s+(\w+)\s+([[:digit:]]+).*/\2\t\1/;p;d}' \ | ||
-e '/^\s*E\w+\s*=\s*-?[[:digit:]]+/{s/^\s*(\w+)\s*=\s*-?([[:digit:]]+).*/\2\t\1/;p;d}' | ||
|
||
|
||
%/errno.list: $(SYSROOT)/usr/include/phoenix/errno.h include/errno.h | ||
@(printf "GEN %-24s \n" "$(@F)") | ||
$(SIL)$(ERR_EXTRACT) $^ | sort -n > $@ | ||
|
||
|
||
%/gaierr.list: include/netdb.h Makefile | ||
@(printf "GEN %-24s \n" "$(@F)") | ||
$(SIL)$(ERR_EXTRACT) $^ | sort -n > $@ | ||
|
||
|
||
%.str.inc: %.list Makefile | ||
@(printf "GEN %-24s \n" "$(@F)") | ||
$(SIL)$(SED) -e 's/^.*\t\(.*\)$$/"\1\\0"/' $< > $@ | ||
|
||
|
||
%.tab.inc: %.list Makefile | ||
@(printf "GEN %-24s \n" "$(@F)") | ||
$(SIL)bash -c 'o=0; while read num name; do echo "{ $$num, $$o },"; o=$$((o+$${#name}+1)); done' < $< > $@ | ||
|
||
|
||
$(PREFIX_O)string/strerror.o: $(patsubst %,string/%,$(INCS)) | ||
|
||
|
||
OBJS += $(addprefix $(PREFIX_O)string/, string.o strdup.o strerror.o strsignal.o) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters