Skip to content

Build: _XOPEN_SOURCE breaks some dependencies on FreeBSD #9823

Closed as not planned
@valpackett

Description

Due to this line:

add_definitions("-D_XOPEN_SOURCE=700")

implying not-__BSD_VISIBLE, we end up with sys/types.h not defining types like u_int, breaking whereami:

../src/external/whereami/src/whereami.c:593:22: error: use of undeclared identifier 'u_int'
    if (sysctl(mib, (u_int)(sizeof(mib) / sizeof(mib[0])), path, &size, NULL, 0) != 0)
                     ^
../src/external/whereami/src/whereami.c:638:5: error: use of undeclared identifier 'Dl_info'
    Dl_info info;
    ^
../src/external/whereami/src/whereami.c:640:9: warning: implicit declaration of function 'dladdr' is invalid in C99 [-Wimplicit-function-declaration]
    if (dladdr(WAI_RETURN_ADDRESS(), &info))
        ^
../src/external/whereami/src/whereami.c:640:39: error: use of undeclared identifier 'info'
    if (dladdr(WAI_RETURN_ADDRESS(), &info))
                                      ^
../src/external/whereami/src/whereami.c:642:27: error: use of undeclared identifier 'info'
      resolved = realpath(info.dli_fname, buffer);
                          ^
1 warning and 4 errors generated.

(sent an upstream PR gpakosz/whereami#26 to define __BSD_VISIBLE because that does make sense)

But even worse, with CUPS:

In file included from ../src/common/cups_print.c:19:
In file included from /usr/local/include/cups/cups.h:27:
In file included from /usr/local/include/cups/ipp.h:18:
In file included from /usr/local/include/cups/http.h:39:
/usr/include/netinet/ip.h:53:2: fatal error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ip_hl:4,                /* header length */
        ^
1 error generated.

(that one probably should be fixed in netinet/ip.h itself tbh??)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bug: pendingsomeone needs to start working on thatdifficulty: averagesome changes across different parts of the code baseno-issue-activityscope: OS supportmaking darktable work on particular operating systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions