aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-02-27 19:37:43 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2023-03-03 14:19:46 +0100
commit1b3c1f6c06d73e881bfc2a46e5ee3e0b24ba96d8 (patch)
tree43133b9b21805464d613280b3d1222da7125ff31 /src/nvim/mbyte.c
parent166b149d5b473f277c63e64ced03c40df44ac3c9 (diff)
downloadrneovim-1b3c1f6c06d73e881bfc2a46e5ee3e0b24ba96d8.tar.gz
rneovim-1b3c1f6c06d73e881bfc2a46e5ee3e0b24ba96d8.tar.bz2
rneovim-1b3c1f6c06d73e881bfc2a46e5ee3e0b24ba96d8.zip
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.
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r--src/nvim/mbyte.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index e27bb003e7..d8be4f4997 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -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");