mescc: Mes C Library: Support make 3.80: Add setlocale, sigaddset.

* include/limits.h (ULONG_MAX): New macro.
* include/locale.h (LC_ALL, LC_NUMERIC): New macro.
* lib/stub/setlocale.c: New file.
* lib/stub/sigaddset.c: New file.
* lib/libc+gnu.c: Include them.
This commit is contained in:
Jan Nieuwenhuizen 2018-08-28 00:45:23 +02:00
parent f22cc0c173
commit ea357f506e
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
6 changed files with 68 additions and 2 deletions

View File

@ -33,6 +33,7 @@
#define UCHAR_MAX 255
#define CHAR_MAX 255
#define UINT_MAX 4294967295U
#define ULONG_MAX 4294967295U
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define MB_CUR_MAX 1

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -28,7 +28,13 @@
#include_next <locale.h>
#else // ! WITH_GLIBC
char* dirname (char*);
#ifndef LC_ALL
#define LC_ALL "LC_ALL"
#define LC_NUMERIC "LC_NUMERIC"
#endif
char * setlocale (int category, char const *locale);
#endif // ! WITH_GLIBC
#endif // __MES_LOCALE_H

View File

@ -210,6 +210,7 @@ typedef struct ucontext
int kill (pid_t pid, int signum);
int sigaction (int signum, struct sigaction const *act, struct sigaction *oldact);
int sigaddset (sigset_t *set, int signum);
#if __MESC__
void* signal (int signum, void * action);
#else

View File

@ -111,3 +111,5 @@
#include <stub/getlogin.c>
#include <stub/setvbuf.c>
#include <stub/sigblock.c>
#include <stub/sigaddset.c>
#include <stub/setlocale.c>

28
lib/stub/setlocale.c Normal file
View File

@ -0,0 +1,28 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
* GNU Mes is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
* GNU Mes is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libmes.h>
#include <locale.h>
char *
setlocale (int category, char const *locale)
{
return "C";
}

28
lib/stub/sigaddset.c Normal file
View File

@ -0,0 +1,28 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
* GNU Mes is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
* GNU Mes is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libmes.h>
#include <signal.h>
int
sigaddset (sigset_t *set, int signum)
{
return 0;
}