Upstream: https://opensource.apple.com/source/man/man-16/patches/PR11291804-xcode.diff
The header file "xcselect.h" referenced in the original patch is not available
in the OS X SDK. The local modification in this patch provide the necessary
declarations as implied by the context and put them right into this file.
old
|
new
|
|
26 | 26 | #include <unistd.h> |
27 | 27 | #include <sys/types.h> |
28 | 28 | #include <sys/stat.h> |
| 29 | #ifdef __APPLE__ |
| 30 | #include <stdbool.h> |
| 31 | //#include <xcselect.h> |
| 32 | typedef struct xcselect_manpaths xcselect_manpaths; |
| 33 | xcselect_manpaths *xcselect_get_manpaths(char *sdkname); |
| 34 | unsigned int xcselect_manpaths_get_num_paths(xcselect_manpaths *xcp); |
| 35 | const char *xcselect_manpaths_get_path(xcselect_manpaths *xcp, unsigned i); |
| 36 | void xcselect_manpaths_free(xcselect_manpaths *xcp); |
| 37 | #endif /* __APPLE__ */ |
29 | 38 | |
30 | 39 | /* not always in <string.h> */ |
31 | 40 | extern char *index(const char *, int); |
… |
… |
|
372 | 381 | for (dlp = cfdirlist.nxt; dlp; dlp = dlp->nxt) |
373 | 382 | if (dlp->mandatory) |
374 | 383 | add_to_mandirlist (dlp->mandir, perrs); |
| 384 | |
| 385 | #ifdef __APPLE__ |
| 386 | xcselect_manpaths *xcp; |
| 387 | const char *path; |
| 388 | unsigned i, count; |
| 389 | |
| 390 | // TODO: pass something for sdkname |
| 391 | xcp = xcselect_get_manpaths(NULL); |
| 392 | if (xcp != NULL) { |
| 393 | count = xcselect_manpaths_get_num_paths(xcp); |
| 394 | for (i = 0; i < count; i++) { |
| 395 | path = xcselect_manpaths_get_path(xcp, i); |
| 396 | if (path != NULL) { |
| 397 | add_to_mandirlist((char *)path, perrs); |
| 398 | } |
| 399 | } |
| 400 | xcselect_manpaths_free(xcp); |
| 401 | } |
| 402 | #endif /* __APPLE__ */ |
375 | 403 | } |
376 | 404 | |
377 | 405 | static void |