Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(sysctl): consolidate platform-specific syscall files #1071

Merged
merged 3 commits into from May 13, 2024

Conversation

skrashevich
Copy link
Contributor

@skrashevich skrashevich commented Apr 29, 2024

  • Rename syscall_linux.go to syscall.go with build constraints for non-BSD and non-Windows platforms.
  • Merge syscall_darwin.go into syscall_bsd.go and adjust build constraints for BSD platforms (Darwin, FreeBSD, OpenBSD).
  • Remove redundant syscall_freebsd.go.
  • Add build constraints to syscall_windows.go for Windows platform.
  • Rename device_freebsd.go to device_bsd.go and hardware_freebsd.go to hardware_bsd.go to reflect broader BSD support (FreeBSD, NetBSD, OpenBSD, Dragonfly).
  • Update build tags in device_bsd.go and hardware_bsd.go to include FreeBSD, NetBSD, OpenBSD, and Dragonfly.
  • Rename device_linux.go to device_unix.go and hardware_linux.go to hardware_unix.go to generalize Unix support excluding Darwin-based systems and BSDs.
  • Add specific build tags to device_darwin.go, device_unix.go, hardware_darwin.go, and hardware_unix.go to correctly target their respective operating systems.
  • Ensure Windows-specific files (device_windows.go and hardware_windows.go) are correctly tagged for building on Windows.

The main point of the changes: the ability to build a project for any POSIX-compatible system, not limited to a {linux,darwin,windows,freebsd} list

- Rename `syscall_linux.go` to `syscall.go` with build constraints for non-BSD and non-Windows platforms.
- Merge `syscall_darwin.go` into `syscall_bsd.go` and adjust build constraints for BSD platforms (Darwin, FreeBSD, OpenBSD).
- Remove redundant `syscall_freebsd.go`.
- Add build constraints to `syscall_windows.go` for Windows platform.
@AlexxIT
Copy link
Owner

AlexxIT commented Apr 30, 2024

It won't help. FFmpeg is also bound to the OS

@AlexxIT AlexxIT added the doubt label Apr 30, 2024
- Rename `device_freebsd.go` to `device_bsd.go` and `hardware_freebsd.go` to `hardware_bsd.go` to reflect broader BSD support (FreeBSD, NetBSD, OpenBSD, Dragonfly).
- Update build tags in `device_bsd.go` and `hardware_bsd.go` to include FreeBSD, NetBSD, OpenBSD, and Dragonfly.
- Rename `device_linux.go` to `device_unix.go` and `hardware_linux.go` to `hardware_unix.go` to generalize Unix support excluding Darwin-based systems and BSDs.
- Add specific build tags to `device_darwin.go`, `device_unix.go`, `hardware_darwin.go`, and `hardware_unix.go` to correctly target their respective operating systems.
- Ensure Windows-specific files (`device_windows.go` and `hardware_windows.go`) are correctly tagged for building on Windows.
@skrashevich skrashevich changed the title refactor(mdns): consolidate platform-specific syscall files refactor(sysctl): consolidate platform-specific syscall files May 1, 2024
@skrashevich
Copy link
Contributor Author

It won't help. FFmpeg is also bound to the OS

fixed

@AlexxIT AlexxIT removed the doubt label May 1, 2024
@AlexxIT AlexxIT self-assigned this May 1, 2024
@AlexxIT AlexxIT merged commit 32e0ee4 into AlexxIT:master May 13, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented May 13, 2024

Thanks!

@AlexxIT AlexxIT added this to the v1.9.2 milestone May 13, 2024
@skrashevich skrashevich deleted the refactr-syscall-more-generic branch May 17, 2024 21:19
@AlexxIT
Copy link
Owner

AlexxIT commented May 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants