Skip to content

Move macOS overrides for st_mtim & friends into a generic macOS source #25373

@barracuda156

Description

@barracuda156

Nim Version

2.2.6

Description

macOS uses st_mtimespec instead of st_mtim. However for some reason correct macOS definitions are hidden in a x86-specific source:

when defined(osx):
st_atim* {.importc:"st_atimespec".}: Timespec ## Time of last access.
st_mtim* {.importc:"st_mtimespec".}: Timespec ## Time of last data modification.
st_ctim* {.importc:"st_ctimespec".}: Timespec ## Time of last status change.

This leaves powerpc build broken.

Current Output

gcc -isystem/opt/local/include/LegacySupport -w -fmax-errors=3 -fno-strict-aliasing -arch ppc -Ic_code -c c_code/3_16/@pos.nim.c -o c_code/3_16/@pos.nim.o
c_code/3_16/@pos.nim.c: In function 'nosgetLastModificationTime':
c_code/3_16/@pos.nim.c:959:59: error: 'struct stat' has no member named 'st_mtim'
  959 |         nimln_(292);    result = toTime__pureZos_u27(res_1.st_mtim);
      |                                                           ^
Command failed: PATH=./bin:$PATH ./build.sh --os darwin --cpu powerpc
Exit code: 1

Expected Output


Known Workarounds

The fix is already there, apparently, but in a wrong place.

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions