Repository navigation
lib: stub: readdir: Define readdir, not readir - #3
Merged
Merged
Conversation
lib/stub/readdir.c named its stub readir and returned an int, so a C library built with it, as libc is for mes_kernel=gnu and windows, had no readdir. Mes compiled by MesCC calls readdir for its readdir builtin (src/mescc-posix.c), and on Windows hex2 stopped linking mes with "Target label readdir is not valid". The stub now has <dirent.h>'s signature and, as before, returns a null pointer with errno 0, the end of the directory. GNU Mes 0.27.1 has the misspelling. * lib/stub/readdir.c (readdir): Rename from readir. Take a DIR * and return a struct dirent *. Include <dirent.h> for them rather than <unistd.h>.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lib/stub/readdir.cnamed its stubreadirand returned anint, so a C library built with it, as libc is formes_kernel=gnuandwindows, had noreaddir. Mes compiled by MesCC callsreaddirfor itsreaddirbuiltin (src/mescc-posix.c), and on Windows hex2 stopped linkingmeswith "Target label readdir is not valid". Linux is unaffected because it takeslib/linux/readdir.c. The misspelling is GNU Mes's own, from 800becf ("lib: Move directory reading to plain libc"), and is in 0.27.1.The stub now has
<dirent.h>'s signature and, as before, returns a null pointer with errno 0, the end of the directory.The Windows CI builds mes-m2 with M2-Planet, which skips
mescc-posix.c, so it shows only that nothing else changed; the link this fixes runs in nova-nix's Mes job.