unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: libc-alpha@sourceware.org
Cc: Paul Eggert <eggert@cs.ucla.edu>, Joseph Myers <joseph@codesourcery.com>
Subject: [PATCH v2 2/2] Fix time/mktime.c and time/gmtime.c for gnulib compatibility
Date: Wed, 27 Feb 2019 12:20:42 +0100	[thread overview]
Message-ID: <20190227112042.1794-2-lukma@denx.de> (raw)
In-Reply-To: <20190227112042.1794-1-lukma@denx.de>

From: Paul Eggert <eggert@cs.ucla.edu>

Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

	* time/mktime.c
	(__mktime64): Guard weak_alias with #ifdef
	(__mktime64): Guard libc_hidden_def with #if _LIBC
	(__mktime64): Guard libc_hidden_weak with #if _LIBC
	(mktime): Only build when _LIBC is defined
	* time/timegm.c:
	(timegm): Only build when _LIBC is defined
---
 time/mktime.c | 15 +++------------
 time/timegm.c |  2 +-
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/time/mktime.c b/time/mktime.c
index 5d3644e213..89293a76fb 100644
--- a/time/mktime.c
+++ b/time/mktime.c
@@ -549,18 +549,14 @@ __mktime64 (struct tm *tp)
   return mktime (tp);
 # endif
 }
-#endif /* _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS */
 
-#ifdef weak_alias
 weak_alias (__mktime64, __timelocal64)
-#endif
-
-#ifdef _LIBC
 libc_hidden_def (__mktime64)
 libc_hidden_weak (__timelocal64)
-#endif
 
-#if __TIMESIZE != 64
+#endif /* _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS */
+
+#if defined _LIBC && __TIMESIZE != 64
 
 /* The 32-bit-time wrapper.  */
 time_t
@@ -573,13 +569,8 @@ mktime (struct tm *tp)
   return -1;
 }
 
-#ifdef weak_alias
 weak_alias (mktime, timelocal)
-#endif
-
-#ifdef _LIBC
 libc_hidden_def (mktime)
 libc_hidden_weak (timelocal)
-#endif
 
 #endif
diff --git a/time/timegm.c b/time/timegm.c
index 0cbe60a7fe..f04428d032 100644
--- a/time/timegm.c
+++ b/time/timegm.c
@@ -35,7 +35,7 @@ __timegm64 (struct tm *tmp)
   return __mktime_internal (tmp, __gmtime64_r, &gmtime_offset);
 }
 
-#if __TIMESIZE != 64
+#if defined _LIBC &&  __TIMESIZE != 64
 
 time_t
 timegm (struct tm *tmp)
-- 
2.11.0


  reply	other threads:[~2019-02-27 11:21 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 11:20 [PATCH v2 1/2] Y2038: make __mktime_internal compatible with __time64_t Lukasz Majewski
2019-02-27 11:20 ` Lukasz Majewski [this message]
2019-03-12  0:12   ` [PATCH v2 2/2] Fix time/mktime.c and time/gmtime.c for gnulib compatibility Paul Eggert
2019-03-06 11:31 ` [PATCH v2 1/2] Y2038: make __mktime_internal compatible with __time64_t Lukasz Majewski
2019-03-12  0:11 ` Paul Eggert
2019-03-12  0:36   ` Joseph Myers
2019-03-17 22:48     ` Lukasz Majewski
2019-03-18 16:27       ` Joseph Myers
2019-03-19 10:53         ` Lukasz Majewski
2019-03-12  6:58   ` Lukasz Majewski
2019-03-18 21:23     ` Paul Eggert
2019-03-19 13:39       ` Lukasz Majewski
2019-03-19 23:12         ` Paul Eggert
2019-03-20  7:03           ` Lukasz Majewski
2019-03-22 21:49             ` Paul Eggert
2019-03-23 21:34               ` Lukasz Majewski
2019-03-24 22:17                 ` Lukasz Majewski
2019-03-23 11:59           ` Lukasz Majewski
2019-03-27 20:06             ` Paul Eggert
2019-03-28  8:59               ` Lukasz Majewski
2019-03-28 16:09                 ` Paul Eggert
2019-03-29 14:24                   ` Lukasz Majewski
2019-03-29 21:10                     ` Paul Eggert
2019-03-30 14:39                       ` Lukasz Majewski
2019-04-01 20:17                     ` Joseph Myers
2019-04-01 20:51                       ` Lukasz Majewski
2019-03-28 16:34                 ` Joseph Myers
     [not found]               ` <20190404120715.150a5d44@jawa>
     [not found]                 ` <20190424135748.502c34af@jawa>
2019-04-28 22:45                   ` Paul Eggert
2019-04-30  7:59                     ` Lukasz Majewski
2019-04-30 16:25                       ` Paul Eggert
2019-05-02  7:19                         ` Lukasz Majewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190227112042.1794-2-lukma@denx.de \
    --to=lukma@denx.de \
    --cc=eggert@cs.ucla.edu \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).