MantisBT - NetSurf | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0002862 | NetSurf | [All Projects] General | public | 2024-01-15 22:28 | 2024-01-15 22:28 |
Reporter | Ryan Carsten Schmidt | ||||
---|---|---|---|---|---|
Assigned To | |||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | x86_64 | OS | OS X | OS Version | 10.9 |
Product Version | 3.11 | ||||
Target Version | Fixed in Version | ||||
Fixed in CI build # | |||||
Reported in CI build # | |||||
URL of problem page | |||||
Summary | 0002862: error: use of undeclared identifier 'AT_SYMLINK_NOFOLLOW' | ||||
Description | NetSurf 3.11 fails to build on an old version of macOS, OS X 10.9: utils/file.c:349:7: warning: implicit declaration of function 'fstatat' is invalid in C99 [-Wimplicit-function-declaration] if (fstatat(dirfd(parent), entry->d_name, &ent_stat, ^ utils/file.c:350:5: error: use of undeclared identifier 'AT_SYMLINK_NOFOLLOW' AT_SYMLINK_NOFOLLOW) != 0) { ^ utils/file.c:365:8: warning: implicit declaration of function 'unlinkat' is invalid in C99 [-Wimplicit-function-declaration] if (unlinkat(dirfd(parent), entry->d_name, 0) != 0) { ^ 2 warnings and 1 error generated. This problem does not occur on OS X 10.10 or later. This isn't surprising since fstatat was introduced in OS X 10.10. What is surprising is that the code in file.c and filename.c—the only places where fstatat is used—is guarded by "#if (defined(HAVE_DIRFD) && defined(HAVE_FSTATAT))". So somehow HAVE_FSTATAT is defined even though the system doesn't have it. I initially assumed there was a problem with your configure test for fstatat when I was reminded that NetSurf doesn't use a configure script. HAVE_FSTATAT is defined unconditionally in netsurf/utils/config.h and is then undefined on a few systems. I guess if you don't use something like a configure script to see what's actually available, you'll have to hardcode a decision into config.h not to use fstatat when building *for* those older OS X versions that don't have it. (I say *for*, not *on*; *for* means looking at the deployment target (the MAC_OS_X_VERSION_MIN_REQUIRED preprocessor macro), not the SDK version (the MAC_OS_X_VERSION_MAX_ALLOWED preprocessor macro)). I don't see any existing occurrences of either of these macros in any of your source code so perhaps you're using another method to deal with this problem as it has arisen for other functions, or perhaps you haven't had to deal with this problem yet. Using either of these macros requires including <AvailabilityMacros.h> first, which you should only do when __APPLE__ is defined. | ||||
Steps To Reproduce | Build NetSurf 3.11 on OS X 10.9. | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | build.log (1,258,841) 2024-01-15 22:28 https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=735&type=bug |
There are no notes attached to this issue. |
Issue History | |||||
Date Modified | Username | Field | Change | ||
---|---|---|---|---|---|
2024-01-15 22:28 | Ryan Carsten Schmidt | New Issue | |||
2024-01-15 22:28 | Ryan Carsten Schmidt | File Added: build.log |