Updated all uses of features to the new `#if FEATURE_HAS_FLAG()` method.

Fortune for sink's current commit: Small blessing − 小吉
master
Avril 3 years ago
parent 9a50132e90
commit 0ed7cb86cf
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -30,7 +30,7 @@ static int r_parent_stderr = r_stderr;
#define dprintf(...) ((void)0) #define dprintf(...) ((void)0)
#endif #endif
#ifdef REPLACE_STDERR #if FEATURE_HAS_FLAG(REPLACE_STDERR)
#define _replace_stderr #define _replace_stderr
#else #else
#define _replace_stderr __attribute__((unused)) #define _replace_stderr __attribute__((unused))
@ -97,7 +97,7 @@ static inline int dupall(int from)
} }
#ifdef REPLACE_STDERR #if FEATURE_HAS_FLAG(REPLACE_STDERR)
// Save parent's stderr to a private one // Save parent's stderr to a private one
if(UNLIKELY(!save_stderr())) { if(UNLIKELY(!save_stderr())) {
return 3; return 3;
@ -112,7 +112,7 @@ static inline int dupall(int from)
return 0; return 0;
} }
#ifndef NO_SEARCH_PATH #if ! FEATURE_HAS_FLAG(NO_SEARCH_PATH)
inline static int err_not_found(int er) { inline static int err_not_found(int er) {
return er == ENOENT; return er == ENOENT;
} }
@ -145,7 +145,7 @@ static int path_lookup(size_t sz; const char name[restrict static 1], char fullp
free(_tmpfree); free(_tmpfree);
return found; return found;
} }
#endif // !NO_SEARCH_PATH #endif // ! NO_SEARCH_PATH
#ifdef DEBUG #ifdef DEBUG
static inline size_t count_list(const void*const* p) static inline size_t count_list(const void*const* p)
@ -215,7 +215,7 @@ static void print_debug_info(int argc, char* const* argv, char* const* envp)
int main(int argc, char** argv, char** envp) int main(int argc, char** argv, char** envp)
{ {
#ifdef NO_ENV #if FEATURE_HAS_FLAG(NO_ENV)
(void)envp; (void)envp;
#define GET_ENV ((char*[]){NULL}) #define GET_ENV ((char*[]){NULL})
#else #else
@ -236,7 +236,7 @@ int main(int argc, char** argv, char** envp)
else return rc; else return rc;
if(argv[1]) { if(argv[1]) {
#ifdef NO_SEARCH_PATH #if FEATURE_HAS_FLAG(NO_SEARCH_PATH)
if(UNLIKELY($execve(argv[1]) < 0)) { if(UNLIKELY($execve(argv[1]) < 0)) {
perror("execve() failed"); perror("execve() failed");
return errno; return errno;

Loading…
Cancel
Save