lha icon indicating copy to clipboard operation
lha copied to clipboard

GNU getopt not always used when USE_GNU is defined

Open sodero opened this issue 2 years ago • 3 comments

Missing include guard leads to GNU getopt being used in some cases and getopt_long in others.

sodero avatar Apr 17 '23 20:04 sodero

Thanks for your PR. Sorry but I don't see why this is necessary.

jca02266 avatar Apr 19 '23 00:04 jca02266

When building with newlib you'll get conflicts otherwise:

In file included from lharc.c:213: getopt_long.h:29:8: error: redefinition of ‘struct option’ 29 | struct option { | ^~~~~~ In file included from /opt/adtools/ppc-amigaos/SDK/newlib/include/sys/unistd.h:73, from /opt/adtools/ppc-amigaos/SDK/newlib/include/unistd.h:4, from lha.h:63, from lharc.c:45: /opt/adtools/ppc-amigaos/SDK/newlib/include/getopt.h:52:8: note: originally defined here 52 | struct option { | ^~~~~~ In file included from lharc.c:213: getopt_long.h:45:5: error: conflicting types for ‘getopt_long’; have ‘int(int, char **, const char *, struct option *, int *)’ 45 | int getopt_long(int argc, char **argv, | ^~~~~~~~~~~ In file included from /opt/adtools/ppc-amigaos/SDK/newlib/include/sys/unistd.h:73, from /opt/adtools/ppc-amigaos/SDK/newlib/include/unistd.h:4, from lha.h:63, from lharc.c:45: /opt/adtools/ppc-amigaos/SDK/newlib/include/getopt.h:70:5: note: previous declaration of ‘getopt_long’ with type ‘int(int, char * const*, const char *, const struct option *, int *)’ 70 | int getopt_long(int, char * const *, const char *,

sodero avatar Apr 19 '23 16:04 sodero

@jca02266 this PR adds support for PS3 and AmigaOS

grepwood avatar May 05 '24 14:05 grepwood