зеркало из https://github.com/github/ruby.git
* configure.in: check langinfo.h and locale.h.
* encoding.c: use langinfo.h only if available. * main.c: use locale.h only if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
7a34e08d84
Коммит
f2515d9938
|
@ -1,3 +1,11 @@
|
||||||
|
Fri Dec 21 12:00:34 2007 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* configure.in: check langinfo.h and locale.h.
|
||||||
|
|
||||||
|
* encoding.c: use langinfo.h only if available.
|
||||||
|
|
||||||
|
* main.c: use locale.h only if available.
|
||||||
|
|
||||||
Fri Dec 21 11:47:56 2007 Tanaka Akira <akr@fsij.org>
|
Fri Dec 21 11:47:56 2007 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* encoding.c: include locale.h
|
* encoding.c: include locale.h
|
||||||
|
|
|
@ -530,7 +530,7 @@ AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h sys/
|
||||||
fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
|
fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
|
||||||
syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
|
syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
|
||||||
sys/mkdev.h sys/utime.h netinet/in_systm.h float.h ieeefp.h pthread.h \
|
sys/mkdev.h sys/utime.h netinet/in_systm.h float.h ieeefp.h pthread.h \
|
||||||
ucontext.h intrinsics.h)
|
ucontext.h intrinsics.h langinfo.h locale.h)
|
||||||
|
|
||||||
dnl Check additional types.
|
dnl Check additional types.
|
||||||
AC_CHECK_SIZEOF(rlim_t, 0, [
|
AC_CHECK_SIZEOF(rlim_t, 0, [
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
#include "ruby/encoding.h"
|
#include "ruby/encoding.h"
|
||||||
#include "regenc.h"
|
#include "regenc.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#ifdef HAVE_LANGINFO_H
|
||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static ID id_encoding, id_based_encoding;
|
static ID id_encoding, id_based_encoding;
|
||||||
static VALUE rb_cEncoding;
|
static VALUE rb_cEncoding;
|
||||||
|
@ -707,9 +709,13 @@ rb_enc_set_default_external(VALUE encoding)
|
||||||
VALUE
|
VALUE
|
||||||
rb_locale_charmap(VALUE klass)
|
rb_locale_charmap(VALUE klass)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_LANGINFO_H
|
||||||
char *codeset;
|
char *codeset;
|
||||||
codeset = nl_langinfo(CODESET);
|
codeset = nl_langinfo(CODESET);
|
||||||
return rb_str_new2(codeset);
|
return rb_str_new2(codeset);
|
||||||
|
#else
|
||||||
|
return rb_str_new2("ASCII-8BIT");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
4
main.c
4
main.c
|
@ -12,7 +12,9 @@
|
||||||
|
|
||||||
#undef RUBY_EXPORT
|
#undef RUBY_EXPORT
|
||||||
#include "ruby/ruby.h"
|
#include "ruby/ruby.h"
|
||||||
|
#ifdef LOCALE_H
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
RUBY_GLOBAL_SETUP
|
RUBY_GLOBAL_SETUP
|
||||||
|
|
||||||
|
@ -23,7 +25,9 @@ main(int argc, char **argv, char **envp)
|
||||||
extern void ruby_set_debug_option(const char *);
|
extern void ruby_set_debug_option(const char *);
|
||||||
ruby_set_debug_option(getenv("RUBY_DEBUG"));
|
ruby_set_debug_option(getenv("RUBY_DEBUG"));
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef LOCALE_H
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
|
#endif
|
||||||
|
|
||||||
ruby_sysinit(&argc, &argv);
|
ruby_sysinit(&argc, &argv);
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче