From unknown Sun Jun 22 11:36:54 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12116 <12116@debbugs.gnu.org> To: bug#12116 <12116@debbugs.gnu.org> Subject: Status: merge from gnulib for extern-inline Reply-To: bug#12116 <12116@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:36:54 +0000 retitle 12116 merge from gnulib for extern-inline reassign 12116 emacs submitter 12116 Paul Eggert severity 12116 normal tag 12116 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 01 18:26:24 2012 Received: (at submit) by debbugs.gnu.org; 1 Aug 2012 22:26:24 +0000 Received: from localhost ([127.0.0.1]:55478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SwhN1-0006qC-8a for submit@debbugs.gnu.org; Wed, 01 Aug 2012 18:26:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47208) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SwhMx-0006q3-3Q for submit@debbugs.gnu.org; Wed, 01 Aug 2012 18:26:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwhFi-0006qN-6e for submit@debbugs.gnu.org; Wed, 01 Aug 2012 18:18:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:48313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwhFi-0006qH-3B for submit@debbugs.gnu.org; Wed, 01 Aug 2012 18:18:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwhFg-0004GI-09 for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2012 18:18:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwhFd-0006py-Ru for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2012 18:18:47 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:34561) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwhFd-0006pq-G7; Wed, 01 Aug 2012 18:18:45 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id AABDBA60008; Wed, 1 Aug 2012 15:18:44 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ixsX8UoSJstq; Wed, 1 Aug 2012 15:18:42 -0700 (PDT) Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 2E63AA60007; Wed, 1 Aug 2012 15:18:42 -0700 (PDT) Message-ID: <5019AB4B.3060607@cs.ucla.edu> Date: Wed, 01 Aug 2012 15:18:51 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: merge from gnulib for extern-inline Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit Cc: Juanma Barranquero , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Tags: patch Here's a patch I plan to incorporate into Emacs after a bit more testing. I'm CCing to Eli and to Juanma as it will most likely require some change to the Microsoft-related build procedure, due to the three new .c files under lib/. === modified file 'ChangeLog' --- ChangeLog 2012-08-01 15:00:49 +0000 +++ ChangeLog 2012-08-01 22:11:58 +0000 @@ -1,3 +1,12 @@ +2012-08-01 Paul Eggert + + Merge from gnulib, incorporating: + 2012-08-01 extern-inline: new module + 2012-08-01 stat-time, timespec, u64, utimens: use extern-inline + * lib/stat-time.c, lib/utimespec.c, lib/u64.c, m4/extern-inline.m4: + New files. The new .c files are for instantiating extern inline + functions. + 2012-08-01 Glenn Morris * configure.ac (DOS_NT, MSDOS): New system type templates. === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2012-07-28 23:05:32 +0000 +++ lib/gnulib.mk 2012-08-01 22:11:58 +0000 @@ -465,6 +465,7 @@ ## begin gnulib module stat-time +libgnu_a_SOURCES += stat-time.c EXTRA_DIST += stat-time.h @@ -1092,6 +1093,7 @@ ## begin gnulib module timespec +libgnu_a_SOURCES += timespec.c EXTRA_DIST += timespec.h @@ -1111,6 +1113,7 @@ ## begin gnulib module u64 +libgnu_a_SOURCES += u64.c EXTRA_DIST += u64.h === added file 'lib/stat-time.c' --- lib/stat-time.c 1970-01-01 00:00:00 +0000 +++ lib/stat-time.c 2012-08-01 22:11:58 +0000 @@ -0,0 +1,3 @@ +#include +#define _GL_STAT_TIME_INLINE _GL_EXTERN_INLINE +#include === modified file 'lib/stat-time.h' --- lib/stat-time.h 2012-06-24 17:21:20 +0000 +++ lib/stat-time.h 2012-08-01 22:11:58 +0000 @@ -23,6 +23,11 @@ #include #include +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_STAT_TIME_INLINE +# define _GL_STAT_TIME_INLINE _GL_INLINE +#endif + /* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST, ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST, @@ -46,7 +51,7 @@ #endif /* Return the nanosecond component of *ST's access time. */ -static inline long int +_GL_STAT_TIME_INLINE long int get_stat_atime_ns (struct stat const *st) { # if defined STAT_TIMESPEC @@ -59,7 +64,7 @@ } /* Return the nanosecond component of *ST's status change time. */ -static inline long int +_GL_STAT_TIME_INLINE long int get_stat_ctime_ns (struct stat const *st) { # if defined STAT_TIMESPEC @@ -72,7 +77,7 @@ } /* Return the nanosecond component of *ST's data modification time. */ -static inline long int +_GL_STAT_TIME_INLINE long int get_stat_mtime_ns (struct stat const *st) { # if defined STAT_TIMESPEC @@ -85,7 +90,7 @@ } /* Return the nanosecond component of *ST's birth time. */ -static inline long int +_GL_STAT_TIME_INLINE long int get_stat_birthtime_ns (struct stat const *st) { # if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC @@ -100,7 +105,7 @@ } /* Return *ST's access time. */ -static inline struct timespec +_GL_STAT_TIME_INLINE struct timespec get_stat_atime (struct stat const *st) { #ifdef STAT_TIMESPEC @@ -114,7 +119,7 @@ } /* Return *ST's status change time. */ -static inline struct timespec +_GL_STAT_TIME_INLINE struct timespec get_stat_ctime (struct stat const *st) { #ifdef STAT_TIMESPEC @@ -128,7 +133,7 @@ } /* Return *ST's data modification time. */ -static inline struct timespec +_GL_STAT_TIME_INLINE struct timespec get_stat_mtime (struct stat const *st) { #ifdef STAT_TIMESPEC @@ -143,7 +148,7 @@ /* Return *ST's birth time, if available; otherwise return a value with tv_sec and tv_nsec both equal to -1. */ -static inline struct timespec +_GL_STAT_TIME_INLINE struct timespec get_stat_birthtime (struct stat const *st) { struct timespec t; @@ -186,4 +191,6 @@ return t; } +_GL_INLINE_HEADER_END + #endif === added file 'lib/timespec.c' --- lib/timespec.c 1970-01-01 00:00:00 +0000 +++ lib/timespec.c 2012-08-01 22:11:58 +0000 @@ -0,0 +1,3 @@ +#include +#define _GL_TIMESPEC_INLINE _GL_EXTERN_INLINE +#include === modified file 'lib/timespec.h' --- lib/timespec.h 2012-07-09 08:34:39 +0000 +++ lib/timespec.h 2012-08-01 22:11:58 +0000 @@ -21,6 +21,11 @@ # include +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_TIMESPEC_INLINE +# define _GL_TIMESPEC_INLINE _GL_INLINE +#endif + /* Return negative, zero, positive if A < B, A == B, A > B, respectively. For each time stamp T, this code assumes that either: @@ -49,7 +54,7 @@ The (int) cast avoids a gcc -Wconversion warning. */ -static inline int +_GL_TIMESPEC_INLINE int timespec_cmp (struct timespec a, struct timespec b) { return (a.tv_sec < b.tv_sec ? -1 @@ -59,7 +64,7 @@ /* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be nonnegative. */ -static inline int +_GL_TIMESPEC_INLINE int timespec_sign (struct timespec a) { return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; @@ -73,7 +78,7 @@ _GL_ATTRIBUTE_CONST; /* Return an approximation to A, of type 'double'. */ -static inline double +_GL_TIMESPEC_INLINE double timespectod (struct timespec a) { return a.tv_sec + a.tv_nsec / 1e9; @@ -82,4 +87,6 @@ void gettime (struct timespec *); int settime (struct timespec const *); +_GL_INLINE_HEADER_END + #endif === added file 'lib/u64.c' --- lib/u64.c 1970-01-01 00:00:00 +0000 +++ lib/u64.c 2012-08-01 22:11:58 +0000 @@ -0,0 +1,3 @@ +#include +#define _GL_U64_INLINE _GL_EXTERN_INLINE +#include === modified file 'lib/u64.h' --- lib/u64.h 2012-05-26 23:14:36 +0000 +++ lib/u64.h 2012-08-01 22:11:58 +0000 @@ -19,6 +19,11 @@ #include +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_U64_INLINE +# define _GL_U64_INLINE _GL_INLINE +#endif + /* Return X rotated left by N bits, where 0 < N < 64. */ #define u64rol(x, n) u64or (u64shl (x, n), u64shr (x, 64 - n)) @@ -54,7 +59,7 @@ /* Given the high and low-order 32-bit quantities HI and LO, return a u64 value representing (HI << 32) + LO. */ -static inline u64 +_GL_U64_INLINE u64 u64hilo (uint32_t hi, uint32_t lo) { u64 r; @@ -64,7 +69,7 @@ } /* Return a u64 value representing LO. */ -static inline u64 +_GL_U64_INLINE u64 u64lo (uint32_t lo) { u64 r; @@ -74,7 +79,7 @@ } /* Return a u64 value representing SIZE. */ -static inline u64 +_GL_U64_INLINE u64 u64size (size_t size) { u64 r; @@ -84,14 +89,14 @@ } /* Return X < Y. */ -static inline int +_GL_U64_INLINE int u64lt (u64 x, u64 y) { return x.hi < y.hi || (x.hi == y.hi && x.lo < y.lo); } /* Return X & Y. */ -static inline u64 +_GL_U64_INLINE u64 u64and (u64 x, u64 y) { u64 r; @@ -101,7 +106,7 @@ } /* Return X | Y. */ -static inline u64 +_GL_U64_INLINE u64 u64or (u64 x, u64 y) { u64 r; @@ -111,7 +116,7 @@ } /* Return X ^ Y. */ -static inline u64 +_GL_U64_INLINE u64 u64xor (u64 x, u64 y) { u64 r; @@ -121,7 +126,7 @@ } /* Return X + Y. */ -static inline u64 +_GL_U64_INLINE u64 u64plus (u64 x, u64 y) { u64 r; @@ -131,7 +136,7 @@ } /* Return X << N. */ -static inline u64 +_GL_U64_INLINE u64 u64shl (u64 x, int n) { u64 r; @@ -149,7 +154,7 @@ } /* Return X >> N. */ -static inline u64 +_GL_U64_INLINE u64 u64shr (u64 x, int n) { u64 r; @@ -167,3 +172,5 @@ } #endif + +_GL_INLINE_HEADER_END === modified file 'lib/utimens.c' --- lib/utimens.c 2012-06-22 21:26:37 +0000 +++ lib/utimens.c 2012-08-01 22:11:58 +0000 @@ -21,6 +21,7 @@ #include +#define _GL_UTIMENS_INLINE _GL_EXTERN_INLINE #include "utimens.h" #include === modified file 'lib/utimens.h' --- lib/utimens.h 2012-06-24 17:21:20 +0000 +++ lib/utimens.h 2012-08-01 22:11:58 +0000 @@ -1,3 +1,22 @@ +/* Set file access and modification times. + + Copyright 2012 Free Software Foundation, Inc. + + This program 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 any + later version. + + This program 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 this program. If not, see . */ + +/* Written by Paul Eggert. */ + #include int fdutimens (int, char const *, struct timespec const [2]); int utimens (char const *, struct timespec const [2]); @@ -7,13 +26,21 @@ # include # include +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_UTIMENS_INLINE +# define _GL_UTIMENS_INLINE _GL_INLINE +#endif + int fdutimensat (int fd, int dir, char const *name, struct timespec const [2], int atflag); /* Using this function makes application code slightly more readable. */ -static inline int +_GL_UTIMENS_INLINE int lutimensat (int dir, char const *file, struct timespec const times[2]) { return utimensat (dir, file, times, AT_SYMLINK_NOFOLLOW); } + +_GL_INLINE_HEADER_END + #endif === added file 'm4/extern-inline.m4' --- m4/extern-inline.m4 1970-01-01 00:00:00 +0000 +++ m4/extern-inline.m4 2012-08-01 22:11:58 +0000 @@ -0,0 +1,40 @@ +dnl 'extern inline' a la ISO C99. + +dnl Copyright 2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_EXTERN_INLINE], +[ + AC_REQUIRE([AC_C_INLINE]) + AH_VERBATIM([extern_inline], +[/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'. + _GL_EXTERN_INLINE is a portable alternative to 'extern inline'. + _GL_INLINE_HEADER_BEGIN contains useful stuff to put + in an include file, before uses of _GL_INLINE. + It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic, + when FOO is an inline function in the header; see + . + _GL_INLINE_HEADER_END contains useful stuff to put + in the same include file, after uses of _GL_INLINE. */ +#if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__ +# define _GL_INLINE inline +# define _GL_EXTERN_INLINE extern inline +# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +# endif +#else +# define _GL_INLINE static inline +# define _GL_EXTERN_INLINE static inline +#endif + +#ifndef _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +#endif]) +]) === modified file 'm4/gnulib-comp.m4' --- m4/gnulib-comp.m4 2012-07-28 23:05:32 +0000 +++ m4/gnulib-comp.m4 2012-08-01 22:11:58 +0000 @@ -55,6 +55,7 @@ # Code from module environ: # Code from module extensions: AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + # Code from module extern-inline: # Code from module filemode: # Code from module getloadavg: # Code from module getopt-gnu: @@ -151,6 +152,7 @@ gl_UNISTD_MODULE_INDICATOR([dup2]) gl_ENVIRON gl_UNISTD_MODULE_INDICATOR([environ]) +AC_REQUIRE([gl_EXTERN_INLINE]) gl_FILEMODE gl_GETLOADAVG if test $HAVE_GETLOADAVG = 0; then @@ -261,7 +263,6 @@ fi gl_TIME_MODULE_INDICATOR([time_r]) gl_TIMESPEC -AC_REQUIRE([AC_C_INLINE]) gl_UNISTD_H gl_UTIMENS gl_gnulib_enabled_dosname=false @@ -565,6 +566,7 @@ lib/sha512.c lib/sha512.h lib/signal.in.h + lib/stat-time.c lib/stat-time.h lib/stat.c lib/stdalign.in.h @@ -590,7 +592,9 @@ lib/time_r.c lib/timespec-add.c lib/timespec-sub.c + lib/timespec.c lib/timespec.h + lib/u64.c lib/u64.h lib/unistd.in.h lib/utimens.c @@ -603,6 +607,7 @@ m4/dup2.m4 m4/environ.m4 m4/extensions.m4 + m4/extern-inline.m4 m4/filemode.m4 m4/getloadavg.m4 m4/getopt.m4 From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 02:25:27 2012 Received: (at 12116-done) by debbugs.gnu.org; 2 Aug 2012 06:25:27 +0000 Received: from localhost ([127.0.0.1]:55883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Swoqd-0000d0-6n for submit@debbugs.gnu.org; Thu, 02 Aug 2012 02:25:27 -0400 Received: from vms173001pub.verizon.net ([206.46.173.1]:48328) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Swoqb-0000cs-6M for 12116-done@debbugs.gnu.org; Thu, 02 Aug 2012 02:25:25 -0400 Received: from [192.168.1.4] ([unknown] [108.23.119.2]) by vms173001.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0M84003F06SL9SLX@vms173001.mailsrvcs.net> for 12116-done@debbugs.gnu.org; Thu, 02 Aug 2012 01:17:10 -0500 (CDT) Message-id: <501A1B71.4060409@verizon.net> Date: Wed, 01 Aug 2012 23:17:21 -0700 From: Paul Eggert User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-version: 1.0 To: 12116-done@debbugs.gnu.org Subject: Re: merge from gnulib for extern-inline Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 12116-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) I installed this as trunk bzr 109387 and so am marking it as done. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 11:16:03 2012 Received: (at submit) by debbugs.gnu.org; 2 Aug 2012 15:16:03 +0000 Received: from localhost ([127.0.0.1]:57165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Swx86-00059j-C1 for submit@debbugs.gnu.org; Thu, 02 Aug 2012 11:16:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47628) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Swx83-00059K-Cy for submit@debbugs.gnu.org; Thu, 02 Aug 2012 11:16:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Swx0g-00008L-Lb for submit@debbugs.gnu.org; Thu, 02 Aug 2012 11:08:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:58969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swx0g-00008G-I9 for submit@debbugs.gnu.org; Thu, 02 Aug 2012 11:08:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swx0a-0005NC-S3 for bug-gnu-emacs@gnu.org; Thu, 02 Aug 2012 11:08:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Swx0Z-00007N-F1 for bug-gnu-emacs@gnu.org; Thu, 02 Aug 2012 11:08:16 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:60804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swx0Z-00007C-6l for bug-gnu-emacs@gnu.org; Thu, 02 Aug 2012 11:08:15 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0M8400E00V9WCJ00@a-mtaout21.012.net.il> for bug-gnu-emacs@gnu.org; Thu, 02 Aug 2012 18:07:41 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M8400E0OVCS1G80@a-mtaout21.012.net.il>; Thu, 02 Aug 2012 18:07:40 +0300 (IDT) Date: Thu, 02 Aug 2012 18:07:33 +0300 From: Eli Zaretskii Subject: Re: merge from gnulib for extern-inline In-reply-to: <5019AB4B.3060607@cs.ucla.edu> X-012-Sender: halo1@inter.net.il To: Paul Eggert Message-id: <83obmtcoy2.fsf@gnu.org> References: <5019AB4B.3060607@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit Cc: lekktu@gmail.com, bug-gnu-emacs@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) > Date: Wed, 01 Aug 2012 15:18:51 -0700 > From: Paul Eggert > CC: Eli Zaretskii , Juanma Barranquero > > Tags: patch > > Here's a patch I plan to incorporate into Emacs after a bit more testing. > I'm CCing to Eli and to Juanma as it will most likely require > some change to the Microsoft-related build procedure, due to the three > new .c files under lib/. Can you explain what it does? I don't understand how these changes are supposed to plug into Emacs sources in general, and into sources that are used on MS-Windows in particular. TIA From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 14:10:41 2012 Received: (at 12116) by debbugs.gnu.org; 2 Aug 2012 18:10:41 +0000 Received: from localhost ([127.0.0.1]:57368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Swzr6-0002Ou-Ho for submit@debbugs.gnu.org; Thu, 02 Aug 2012 14:10:41 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:40412) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Swzr2-0002Ol-VC for 12116@debbugs.gnu.org; Thu, 02 Aug 2012 14:10:38 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id AC4EB39E8014; Thu, 2 Aug 2012 11:03:04 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RLBxOOfVkg0W; Thu, 2 Aug 2012 11:03:04 -0700 (PDT) Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id E52A939E8013; Thu, 2 Aug 2012 11:03:03 -0700 (PDT) Message-ID: <501AC0D3.6080300@cs.ucla.edu> Date: Thu, 02 Aug 2012 11:02:59 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: merge from gnulib for extern-inline References: <5019AB4B.3060607@cs.ucla.edu> <83obmtcoy2.fsf@gnu.org> In-Reply-To: <83obmtcoy2.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 12116 Cc: lekktu@gmail.com, 12116@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 08/02/2012 08:07 AM, Eli Zaretskii wrote: > Can you explain what it does? The basic idea is to support globally-used inline functions using the way established by C99 standard. C99 does it by putting this into a .h file: inline foo (int x) { return bar (x); } and by also declaring FOO to be extern in one .c file. In a non-optimizing implementation FOO's machine code is generated for that .c file, and all uses invoke that machine code. In an optimizing implementation, FOO is expanded inline when that makes sense, and FOO's machine code can be optimized away if all calls to FOO are inlined. The way it's done in gnulib and Emacs is to use the above scheme when C99 style extern inline works, and to fall back on 'static inline' for older compilers, or even to plain 'static' if the compiler is so ancient that it doesn't even grok 'inline'. In Emacs we have the macros: e x p a n s i o n i n : macro C99 older compilers ancient compilers INLINE inline static inline static EXTERN_INLINE extern inline static inline static and the Emacs include file charset.h does this: #ifndef CHARSET_INLINE # define CHARSET_INLINE INLINE #endif CHARSET_INLINE void set_charset_attr (struct charset *charset, enum charset_attr_index idx, Lisp_Object val) { ASET (CHARSET_ATTRIBUTES (charset), idx, val); } so in C99 most users of charset.h see the function as being 'inline void'. charset.c does this before including charset.h: #define CHARSET_INLINE EXTERN_INLINE so that when it's compiled, the function is 'extern inline void'. In pre-C99 compilers the function is 'static inline' or (if ancient) plain 'static'. Similarly for each .h file that uses inline functions. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 15:57:31 2012 Received: (at 12116) by debbugs.gnu.org; 2 Aug 2012 19:57:31 +0000 Received: from localhost ([127.0.0.1]:57462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sx1WV-0005c7-6l for submit@debbugs.gnu.org; Thu, 02 Aug 2012 15:57:31 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:56566) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sx1WS-0005by-BQ for 12116@debbugs.gnu.org; Thu, 02 Aug 2012 15:57:29 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M8500L0081A6H00@a-mtaout23.012.net.il> for 12116@debbugs.gnu.org; Thu, 02 Aug 2012 22:49:45 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M8500LC68EW5340@a-mtaout23.012.net.il>; Thu, 02 Aug 2012 22:49:45 +0300 (IDT) Date: Thu, 02 Aug 2012 22:49:37 +0300 From: Eli Zaretskii Subject: Re: merge from gnulib for extern-inline In-reply-to: <501AC0D3.6080300@cs.ucla.edu> X-012-Sender: halo1@inter.net.il To: Paul Eggert Message-id: <837gthcbvy.fsf@gnu.org> References: <5019AB4B.3060607@cs.ucla.edu> <83obmtcoy2.fsf@gnu.org> <501AC0D3.6080300@cs.ucla.edu> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12116 Cc: lekktu@gmail.com, 12116@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Thu, 02 Aug 2012 11:02:59 -0700 > From: Paul Eggert > CC: 12116@debbugs.gnu.org, lekktu@gmail.com > > e x p a n s i o n i n : > macro C99 older compilers ancient compilers > INLINE inline static inline static > EXTERN_INLINE extern inline static inline static > > and the Emacs include file charset.h does this: > > #ifndef CHARSET_INLINE > # define CHARSET_INLINE INLINE > #endif > > CHARSET_INLINE void > set_charset_attr (struct charset *charset, enum charset_attr_index idx, > Lisp_Object val) > { > ASET (CHARSET_ATTRIBUTES (charset), idx, val); > } > > so in C99 most users of charset.h see the function as being > 'inline void'. charset.c does this before including charset.h: > > #define CHARSET_INLINE EXTERN_INLINE > > so that when it's compiled, the function is 'extern inline void'. > In pre-C99 compilers the function is 'static inline' or (if ancient) > plain 'static'. Similarly for each .h file that uses inline functions. OK, but what's the story with the addition of stat-time.c, utimespec.c, and u64.c, which just include the respective headers? Where and how are these used, and for what purposes? I understood the extern inline stuff, I just don't get why are these *.c files introduced. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 17:27:49 2012 Received: (at 12116) by debbugs.gnu.org; 2 Aug 2012 21:27:50 +0000 Received: from localhost ([127.0.0.1]:57526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sx2vs-0007dB-Vv for submit@debbugs.gnu.org; Thu, 02 Aug 2012 17:27:49 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:49664) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sx2vq-0007d4-Cl for 12116@debbugs.gnu.org; Thu, 02 Aug 2012 17:27:47 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 5505FA60009; Thu, 2 Aug 2012 14:20:13 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eWSHcbmFnCmj; Thu, 2 Aug 2012 14:20:12 -0700 (PDT) Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id AD1E7A60007; Thu, 2 Aug 2012 14:20:12 -0700 (PDT) Message-ID: <501AEF0D.6030202@cs.ucla.edu> Date: Thu, 02 Aug 2012 14:20:13 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: merge from gnulib for extern-inline References: <5019AB4B.3060607@cs.ucla.edu> <83obmtcoy2.fsf@gnu.org> <501AC0D3.6080300@cs.ucla.edu> <837gthcbvy.fsf@gnu.org> In-Reply-To: <837gthcbvy.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 12116 Cc: lekktu@gmail.com, 12116@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 08/02/2012 12:49 PM, Eli Zaretskii wrote: > what's the story with the addition of stat-time.c, > utimespec.c, and u64.c, which just include the respective headers? > Where and how are these used, and for what purposes? These .c files instantiate the inline functions defined in their respective headers, by declaring them to be extern inline. Without these .c files, if a compiler decides not to inline one of those functions when compiling some other module, there might not be any code that actually implements the function. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 03 07:17:05 2012 Received: (at 12116) by debbugs.gnu.org; 3 Aug 2012 11:17:05 +0000 Received: from localhost ([127.0.0.1]:58408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SxFsO-0004XU-L0 for submit@debbugs.gnu.org; Fri, 03 Aug 2012 07:17:05 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:61095) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SxFsM-0004X2-0J for 12116@debbugs.gnu.org; Fri, 03 Aug 2012 07:17:03 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M8600200EUT4Q00@a-mtaout23.012.net.il> for 12116@debbugs.gnu.org; Fri, 03 Aug 2012 14:09:25 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M86002SNEZO1530@a-mtaout23.012.net.il>; Fri, 03 Aug 2012 14:09:25 +0300 (IDT) Date: Fri, 03 Aug 2012 14:09:19 +0300 From: Eli Zaretskii Subject: Re: merge from gnulib for extern-inline In-reply-to: <501AEF0D.6030202@cs.ucla.edu> X-012-Sender: halo1@inter.net.il To: Paul Eggert Message-id: <83obmsb5b4.fsf@gnu.org> References: <5019AB4B.3060607@cs.ucla.edu> <83obmtcoy2.fsf@gnu.org> <501AC0D3.6080300@cs.ucla.edu> <837gthcbvy.fsf@gnu.org> <501AEF0D.6030202@cs.ucla.edu> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12116 Cc: lekktu@gmail.com, 12116@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Thu, 02 Aug 2012 14:20:13 -0700 > From: Paul Eggert > CC: 12116@debbugs.gnu.org, lekktu@gmail.com > > On 08/02/2012 12:49 PM, Eli Zaretskii wrote: > > what's the story with the addition of stat-time.c, > > utimespec.c, and u64.c, which just include the respective headers? > > Where and how are these used, and for what purposes? > > These .c files instantiate the inline functions defined in > their respective headers, by declaring them to be extern inline. > Without these .c files, if a compiler decides not to inline one > of those functions when compiling some other module, there might > not be any code that actually implements the function. Thanks. From unknown Sun Jun 22 11:36:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 31 Aug 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator