#315 __mingw_optreset undefined

closed-fixed
nobody
header (101)
5
2012-08-10
2012-08-10
Jürgen Pfeifer
No

Taking #define optreset out of the _BSD_SOURCE guard requires also to take the
extern int optreset; definition to be made available.
Discovered that when compiling xz 5.0.4
Attached patch solves that problem.

Discussion

  • Patch for optreset definition

     
    Attachments
  • Ozkan Sezer
    Ozkan Sezer
    2012-08-10

    AFAICS, xz source doesn't define _BSD_SOURCE and only checks it by AC_CHECK_DECL from getopt.m4 and as it happens only a define is enough for AC_CHECK_DECL to set the existence of queried symbol. I'd argue that it would be better to use TRY_COMPILE or TRY_LINK or something, but since we have that getopt.m4 in the wild, I'll probably revert the __mingw_optreset define move and add it to getopt.c instead.

     
  • Ozkan Sezer
    Ozkan Sezer
    2012-08-10

    Fixed in the trunk (rev. 5368), stable/v1.x (rev. 5367) and stable/v2.x (rev. 5366).

    Closing.

     
  • Ozkan Sezer
    Ozkan Sezer
    2012-08-10

    • status: open --> closed-fixed