Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
71e551df
Commit
71e551df
authored
Mar 26, 2020
by
Rosen Penev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace locale.h with clocale
Switch to std:: functions. Changed the meson check. Works locally. Signed-off-by:
Rosen Penev
<
rosenp@gmail.com
>
parent
3540cf26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
meson.build
meson.build
+1
-1
Main.cxx
src/Main.cxx
+6
-8
No files found.
meson.build
View file @
71e551df
...
@@ -145,7 +145,7 @@ add_global_arguments(common_cppflags, language: 'cpp')
...
@@ -145,7 +145,7 @@ add_global_arguments(common_cppflags, language: 'cpp')
enable_daemon = not is_windows and not is_android and get_option('daemon')
enable_daemon = not is_windows and not is_android and get_option('daemon')
conf.set('ENABLE_DAEMON', enable_daemon)
conf.set('ENABLE_DAEMON', enable_daemon)
conf.set('HAVE_
LOCALE_H', compiler.has_header('locale.h
'))
conf.set('HAVE_
CLOCALE', compiler.has_header('clocale
'))
conf.set('HAVE_GETPWNAM_R', compiler.has_function('getpwnam_r'))
conf.set('HAVE_GETPWNAM_R', compiler.has_function('getpwnam_r'))
conf.set('HAVE_GETPWUID_R', compiler.has_function('getpwuid_r'))
conf.set('HAVE_GETPWUID_R', compiler.has_function('getpwuid_r'))
...
...
src/Main.cxx
View file @
71e551df
...
@@ -109,14 +109,12 @@
...
@@ -109,14 +109,12 @@
#include <systemd/sd-daemon.h>
#include <systemd/sd-daemon.h>
#endif
#endif
#include <
stdlib.h
>
#include <
climits
>
#ifdef HAVE_
LOCALE_H
#ifdef HAVE_
CLOCALE
#include <
locale.h
>
#include <
clocale
>
#endif
#endif
#include <climits>
static
constexpr
size_t
KILOBYTE
=
1024
;
static
constexpr
size_t
KILOBYTE
=
1024
;
static
constexpr
size_t
MEGABYTE
=
1024
*
KILOBYTE
;
static
constexpr
size_t
MEGABYTE
=
1024
*
KILOBYTE
;
...
@@ -360,10 +358,10 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
...
@@ -360,10 +358,10 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
#endif
#endif
#ifndef ANDROID
#ifndef ANDROID
#ifdef HAVE_
LOCALE_H
#ifdef HAVE_
CLOCALE
/* initialize locale */
/* initialize locale */
setlocale
(
LC_CTYPE
,
""
);
s
td
::
s
etlocale
(
LC_CTYPE
,
""
);
setlocale
(
LC_COLLATE
,
""
);
s
td
::
s
etlocale
(
LC_COLLATE
,
""
);
#endif
#endif
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment