Add a shared "port" directory for POSIX functions needed by multiple host tools (getopt/mkstemps) and import the one and only getopt from glibc.

This finally fixes our duplicated getopt functions from different sources and gives us an up to date and the most compatible implementation.
isohybrid actually relies on a glibc-specific getopt behavior that we previously hacked into the reactos_support_code.c implementation derived from BSD/mingw-w64.
widl also needs getopt and previously used an even older BSD-derived code.
This commit is contained in:
Colin Finck 2019-04-27 16:19:26 +02:00
parent c02257ef57
commit 2c11c41115
No known key found for this signature in database
GPG key ID: 1BA74E70456BA1A9
18 changed files with 1305 additions and 1615 deletions

View file

@ -26,20 +26,15 @@
#include <string.h>
#include <assert.h>
#if defined(_WIN32) || defined(__APPLE__)
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef __REACTOS__
#include <io.h>
int mkstemps(char* template, int suffix_len);
#endif /* __REACTOS__ */
#include "../../port/port.h"
#ifdef _WIN32
#include <io.h>
#else
#ifdef __REACTOS__
#include <sys/types.h>
#include <sys/stat.h>
#endif /* __REACTOS__ */
#include <unistd.h>
#include <unistd.h>
#endif
#include "err.h"