Browse Source

Fix compilation issue when libuargp is compiled without __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__

This fixes the issue reported at https://github.com/wbx-github/uclibc-ng/issues/2

Signed-off-by: Yann Sionneau <yann@sionneau.net>
Yann Sionneau 1 year ago
parent
commit
f93b43e4d1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      libuargp/argp-parse.c

+ 2 - 2
libuargp/argp-parse.c

@@ -112,7 +112,7 @@ argp_default_parser (int key, char *arg, struct argp_state *state)
       break;
 
     case OPT_PROGNAME:         /* Set the program name.  */
-#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_NAME
+#if defined _LIBC && defined(__UCLIBC_HAS_PROGRAM_INVOCATION_NAME__)
       program_invocation_name = arg;
 #endif
       /* [Note that some systems only have PROGRAM_INVOCATION_SHORT_NAME (aka
@@ -126,7 +126,7 @@ argp_default_parser (int key, char *arg, struct argp_state *state)
       else
        state->name = arg;
 
-#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+#if defined _LIBC && defined(__UCLIBC_HAS_PROGRAM_INVOCATION_NAME__)
       program_invocation_short_name = state->name;
 #endif