ruby-changes:59493
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Thu, 26 Dec 2019 20:45:45 +0900 (JST)
Subject: [ruby-changes:59493] 863dbb21d8 (master): assume C99
https://git.ruby-lang.org/ruby.git/commit/?id=863dbb21d8 From 863dbb21d8912c73e84fed47f2d3a1ac5d8275d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Mon, 2 Dec 2019 14:48:42 +0900 Subject: assume C99 Now that we no longer support old compilers, we can safely delete several obsolete #ifdef gurads. Also because (as of writing) it is impossible to compile the program using C++ compilers, lets just entirely prohibit __cplusplus to reduce # of LOCs. Note however that we still cannot eliminate __STDC_VERSION__ checks, because MSVC does not define it, saying its C99 support is partial. See also https://social.msdn.microsoft.com/Forums/vstudio/en-US/53a4fd75-9f97-48b2-aa63-2e2e5a15efa3 diff --git a/internal.h b/internal.h index 5b7f87a..337aee8 100644 --- a/internal.h +++ b/internal.h @@ -12,13 +12,10 @@ https://github.com/ruby/ruby/blob/trunk/internal.h#L12 #ifndef RUBY_INTERNAL_H #define RUBY_INTERNAL_H 1 -#include "ruby.h" +#include "ruby/config.h" -#if defined(__cplusplus) -extern "C" { -#if 0 -} /* satisfy cc-mode */ -#endif +#ifdef __cplusplus +# error not for C++ #endif #include "ruby/encoding.h" @@ -87,10 +84,4 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/internal.h#L84 #include "internal/inits.h" #include "internal/warnings.h" -#if defined(__cplusplus) -#if 0 -{ /* satisfy cc-mode */ -#endif -} /* extern "C" { */ -#endif #endif /* RUBY_INTERNAL_H */ diff --git a/internal/serial.h b/internal/serial.h index 224ab47..118848d 100644 --- a/internal/serial.h +++ b/internal/serial.h @@ -10,21 +10,13 @@ https://github.com/ruby/ruby/blob/trunk/internal/serial.h#L10 * file COPYING are met. Consult the file for details. */ -#if defined(HAVE_LONG_LONG) -typedef unsigned LONG_LONG rb_serial_t; -# define SERIALT2NUM ULL2NUM -# define PRI_SERIALT_PREFIX PRI_LL_PREFIX -# define SIZEOF_SERIAL_T SIZEOF_LONG_LONG -#elif defined(HAVE_UINT64_T) -typedef uint64_t rb_serial_t; -# define SERIALT2NUM SIZET2NUM -# define PRI_SERIALT_PREFIX PRI_64_PREFIX -# define SIZEOF_SERIAL_T SIZEOF_UINT64_T -#else -typedef unsigned long rb_serial_t; -# define SERIALT2NUM ULONG2NUM -# define PRI_SERIALT_PREFIX PRI_LONG_PREFIX -# define SIZEOF_SERIAL_T SIZEOF_LONG +#ifndef HAVE_LONG_LONG +# error need C99+ #endif +typedef unsigned LONG_LONG rb_serial_t; +#define SERIALT2NUM ULL2NUM +#define PRI_SERIALT_PREFIX PRI_LL_PREFIX +#define SIZEOF_SERIAL_T SIZEOF_LONG_LONG + #endif /* INTERNAL_SERIAL_H */ -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/