mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
refactor(build): graduate HAVE_LOCALE_H feature
Merge locale.h into os/lang.h Having a source file with the same name as a system header we use is considered an anti-pattern.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <iconv.h>
|
||||
#include <locale.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -67,10 +68,6 @@
|
||||
#include "nvim/types.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
#ifdef HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int rangeStart;
|
||||
int rangeEnd;
|
||||
@@ -2193,10 +2190,7 @@ char *enc_locale(void)
|
||||
if (!(s = nl_langinfo(CODESET)) || *s == NUL)
|
||||
#endif
|
||||
{
|
||||
#if defined(HAVE_LOCALE_H)
|
||||
if (!(s = setlocale(LC_CTYPE, NULL)) || *s == NUL)
|
||||
#endif
|
||||
{
|
||||
if (!(s = setlocale(LC_CTYPE, NULL)) || *s == NUL) {
|
||||
if ((s = os_getenv("LC_ALL"))) {
|
||||
if ((s = os_getenv("LC_CTYPE"))) {
|
||||
s = os_getenv("LANG");
|
||||
|
Reference in New Issue
Block a user