[EMAIL PROTECTED] writes:
> OK, I _think_ I've figured out what's happeneing, but it makes no sense. Can
> someone who understands this argp code disaster help? What is this code
> supposed to do, anyway? It's _terribly_ written, and not portable _at_
> _all_. Perhaps we should jettison the whole nightmare.
>
> So:
>
> - If _LIBC is defined, argp_fmtstream_putc becomes putc.
> - Otherwise, argp_fmtstream_putc and __argp_fmtstream_putc are defined as
> external.
[ details snipped ]
> This is obviously bogus.
Well, it's usually compiled as a part of libc. That's why it uses
identifiers from the __-namespace reserved for the C implementation.
But that is conditionalized, so that you more or less can compile it
separately. When using the newest glibc streams implementation,
formatting into lines and columns is done by the C stream, which is
why you can use putc() rather than argp_fmtstream_putc. All this is
also conditionalized.
Theres also a file using linker magic to create weak symbols and
stuff in the C clibrary. I don't really understand that (and it's
obviously not used when argp is compiled separately).
But all together this gets a little messy.
> Who wrote this crap?
I *think* it was originally written by Miles Bader, but I'm not sure
about that. I obviously don't think it's crap. My primary wish for
argp is that its dependency on getopt be nuked. And that it be nicely
package for use outside glibc.
[EMAIL PROTECTED] writes:
> I resolved the last argp problem by changing:
>
> #ifdef __OPTIMIZE__
> to
> #if 1
>
> I also had to modify the ARGP_FS_EI macro to:
>
> #ifndef ARGP_FS_EI
> #ifdef __GNUC__
> #define ARGP_FS_EI extern inline
> #else
> #define ARGP_FS_EI static
> #endif
> #endif
>
> The whole thing now compiles. Now to see if it works, and to change my hacks
> into clean patches to configure.in and a few .c and .h files.
Great. I'm looking forward to that.
/Niels