find: port to Ubuntu 20.04 cross-compiling for OpenWRT 21.02

In the above build environment, HAVE_ENDPWENT seems to be defined to 0
instead of being #undef'ed.  Hence the build fails:

  parser.c: In function 'parse_user':
  parser.c:75:20: error: expected expression before ')' token
     75 | # define endpwent ()
        |                    ^
  parser.c:2463:7: note: in expansion of macro 'endpwent'
   2463 |       endpwent ();
        |       ^~~~~~~~

* find/parser.c (HAVE_ENDGRENT,HAVE_ENDPWENT): Change from #ifndef to
"#if !", and define the replacement code to "(void) 0".

Fixes https://github.com/openwrt/packages/issues/17912
This commit is contained in:
Bernhard Voelker 2022-03-29 01:06:50 +02:00
parent 43679658e2
commit fa7e628e19

View File

@ -67,12 +67,12 @@
#include "findutils-version.h"
#include "system.h"
#ifndef HAVE_ENDGRENT
# define endgrent ()
#if ! HAVE_ENDGRENT
# define endgrent() ((void) 0)
#endif
#ifndef HAVE_ENDPWENT
# define endpwent ()
#if ! HAVE_ENDPWENT
# define endpwent() ((void) 0)
#endif
static bool parse_accesscheck (const struct parser_table*, char *argv[], int *arg_ptr);