aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-12-01 21:56:49 -0800
committerPaul Eggert2016-12-01 21:57:15 -0800
commitf3fa5d7e229f88e6f83dc24757b33e9b17bf10ae (patch)
tree81af303417b41d6d70a71461e2d81434710d1347
parentebb96114d88af64cbb72f42052cb359ba8010aa2 (diff)
downloademacs-f3fa5d7e229f88e6f83dc24757b33e9b17bf10ae.tar.gz
emacs-f3fa5d7e229f88e6f83dc24757b33e9b17bf10ae.zip
Merge from gnulib
This incorporates: 2016-11-27 md4,md5,sha*: tune for recent glibc _STRING_INLINE_unaligned 2016-11-21 snippet/c++defs: Simplify _GL_CXXALIAS_* macros. * build-aux/snippet/c++defs.h: * lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c: Copy from gnulib.
-rw-r--r--build-aux/snippet/c++defs.h40
-rw-r--r--lib/md5.c2
-rw-r--r--lib/sha1.c2
-rw-r--r--lib/sha256.c2
-rw-r--r--lib/sha512.c2
5 files changed, 29 insertions, 19 deletions
diff --git a/build-aux/snippet/c++defs.h b/build-aux/snippet/c++defs.h
index d42ea25d852..2b819da5e07 100644
--- a/build-aux/snippet/c++defs.h
+++ b/build-aux/snippet/c++defs.h
@@ -133,8 +133,11 @@
133 static const struct _gl_ ## func ## _wrapper \ 133 static const struct _gl_ ## func ## _wrapper \
134 { \ 134 { \
135 typedef rettype (*type) parameters; \ 135 typedef rettype (*type) parameters; \
136 inline type rpl () const { return ::rpl_func; } \ 136 \
137 inline operator type () const { return rpl (); } \ 137 inline operator type () const \
138 { \
139 return ::rpl_func; \
140 } \
138 } func = {}; \ 141 } func = {}; \
139 } \ 142 } \
140 _GL_EXTERN_C int _gl_cxxalias_dummy 143 _GL_EXTERN_C int _gl_cxxalias_dummy
@@ -155,9 +158,11 @@
155 static const struct _gl_ ## func ## _wrapper \ 158 static const struct _gl_ ## func ## _wrapper \
156 { \ 159 { \
157 typedef rettype (*type) parameters; \ 160 typedef rettype (*type) parameters; \
158 inline type rpl () const \ 161 \
159 { return reinterpret_cast<type>(::rpl_func); } \ 162 inline operator type () const \
160 inline operator type () const { return rpl (); } \ 163 { \
164 return reinterpret_cast<type>(::rpl_func); \
165 } \
161 } func = {}; \ 166 } func = {}; \
162 } \ 167 } \
163 _GL_EXTERN_C int _gl_cxxalias_dummy 168 _GL_EXTERN_C int _gl_cxxalias_dummy
@@ -183,10 +188,13 @@
183 static const struct _gl_ ## func ## _wrapper \ 188 static const struct _gl_ ## func ## _wrapper \
184 { \ 189 { \
185 typedef rettype (*type) parameters; \ 190 typedef rettype (*type) parameters; \
186 inline type rpl () const { return ::func; } \ 191 \
187 inline operator type () const { return rpl (); } \ 192 inline operator type () const \
193 { \
194 return ::func; \
195 } \
188 } func = {}; \ 196 } func = {}; \
189 } \ 197 } \
190 _GL_EXTERN_C int _gl_cxxalias_dummy 198 _GL_EXTERN_C int _gl_cxxalias_dummy
191#else 199#else
192# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 200# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
@@ -205,9 +213,11 @@
205 static const struct _gl_ ## func ## _wrapper \ 213 static const struct _gl_ ## func ## _wrapper \
206 { \ 214 { \
207 typedef rettype (*type) parameters; \ 215 typedef rettype (*type) parameters; \
208 inline type rpl () const \ 216 \
209 { return reinterpret_cast<type>(::func); } \ 217 inline operator type () const \
210 inline operator type () const { return rpl (); }\ 218 { \
219 return reinterpret_cast<type>(::func); \
220 } \
211 } func = {}; \ 221 } func = {}; \
212 } \ 222 } \
213 _GL_EXTERN_C int _gl_cxxalias_dummy 223 _GL_EXTERN_C int _gl_cxxalias_dummy
@@ -235,10 +245,10 @@
235 { \ 245 { \
236 typedef rettype (*type) parameters; \ 246 typedef rettype (*type) parameters; \
237 \ 247 \
238 inline type rpl () const \ 248 inline operator type () const \
239 { return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); }\ 249 { \
240 \ 250 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
241 inline operator type () const { return rpl (); } \ 251 } \
242 } func = {}; \ 252 } func = {}; \
243 } \ 253 } \
244 _GL_EXTERN_C int _gl_cxxalias_dummy 254 _GL_EXTERN_C int _gl_cxxalias_dummy
diff --git a/lib/md5.c b/lib/md5.c
index 62d247ed7aa..cec62339e26 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -259,7 +259,7 @@ md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
259 /* Process available complete blocks. */ 259 /* Process available complete blocks. */
260 if (len >= 64) 260 if (len >= 64)
261 { 261 {
262#if !_STRING_ARCH_unaligned 262#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned)
263# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0) 263# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0)
264 if (UNALIGNED_P (buffer)) 264 if (UNALIGNED_P (buffer))
265 while (len > 64) 265 while (len > 64)
diff --git a/lib/sha1.c b/lib/sha1.c
index 45f1cbefd18..753c0884d8b 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -246,7 +246,7 @@ sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
246 /* Process available complete blocks. */ 246 /* Process available complete blocks. */
247 if (len >= 64) 247 if (len >= 64)
248 { 248 {
249#if !_STRING_ARCH_unaligned 249#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned)
250# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0) 250# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0)
251 if (UNALIGNED_P (buffer)) 251 if (UNALIGNED_P (buffer))
252 while (len > 64) 252 while (len > 64)
diff --git a/lib/sha256.c b/lib/sha256.c
index 0be8fd2a858..5251e8d950b 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -379,7 +379,7 @@ sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
379 /* Process available complete blocks. */ 379 /* Process available complete blocks. */
380 if (len >= 64) 380 if (len >= 64)
381 { 381 {
382#if !_STRING_ARCH_unaligned 382#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned)
383# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0) 383# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0)
384 if (UNALIGNED_P (buffer)) 384 if (UNALIGNED_P (buffer))
385 while (len > 64) 385 while (len > 64)
diff --git a/lib/sha512.c b/lib/sha512.c
index 5494dcbdbad..71a7eca14d7 100644
--- a/lib/sha512.c
+++ b/lib/sha512.c
@@ -387,7 +387,7 @@ sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
387 /* Process available complete blocks. */ 387 /* Process available complete blocks. */
388 if (len >= 128) 388 if (len >= 128)
389 { 389 {
390#if !_STRING_ARCH_unaligned 390#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned)
391# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (u64) != 0) 391# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (u64) != 0)
392 if (UNALIGNED_P (buffer)) 392 if (UNALIGNED_P (buffer))
393 while (len > 128) 393 while (len > 128)