jeaye / ncurses-rs

A low-level ncurses wrapper for Rust
Other
685 stars 99 forks source link

Use libc::setlocale #197

Closed gyscos closed 3 years ago

gyscos commented 4 years ago

This removes the setlocale binding, instead relying on the one from libc. It also re-exports the LC_ALL & cie constants from libc, rather than re-defining them here.

This is more portable: libc goes to great length to support many platforms (with platform-dependents constants and links), no need to re-invent the wheel here.

Concretely, this fixes an issue with NetBSD where setlocale should actually link to __setlocale50. libc does it correctly, so let's just take that.

Vest commented 3 years ago

Hi @gyscos

I am not the repo's maintainer, but I had reached Jeaye on LinkedIn, and he agreed to review my PR. Maybe if your change is not hm... dangerous for other projects, you can do the same.

Thanks

jeaye commented 3 years ago

It's nothing @gyscos did wrong. I just haven't been very available for a while. I have a new job now, though, which gives me saner hours so I can better keep up with merging PRs.

As for this PR, thanks so much for taking the time to make the change!