diff options
| author | Jim Blandy | 1993-02-22 14:51:13 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-02-22 14:51:13 +0000 |
| commit | 98f7775387dec3359f0332bcd55a608b24c7678b (patch) | |
| tree | a066bb83ff6a9c0a220b0926a749c8d54bd9d028 /src | |
| parent | 31be8d24679fdbd2aa94db6b19c30664638b391d (diff) | |
| download | emacs-98f7775387dec3359f0332bcd55a608b24c7678b.tar.gz emacs-98f7775387dec3359f0332bcd55a608b24c7678b.zip | |
* systime.h [_AIX]: Move test outside of previous #if.
(EMACS_GET_TZ_OFFSET) [USG]: Don't declare twice. Prefer tzset.
Diffstat (limited to 'src')
| -rw-r--r-- | src/systime.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/systime.h b/src/systime.h index ab1d6802133..fdbb70a78af 100644 --- a/src/systime.h +++ b/src/systime.h | |||
| @@ -33,13 +33,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 33 | #include <time.h> | 33 | #include <time.h> |
| 34 | #endif /* _h_BSDTYPES */ | 34 | #endif /* _h_BSDTYPES */ |
| 35 | 35 | ||
| 36 | #endif | ||
| 37 | |||
| 36 | /* AIX needs both <sys/time.h> and <time.h>. */ | 38 | /* AIX needs both <sys/time.h> and <time.h>. */ |
| 37 | #ifdef _AIX | 39 | #ifdef _AIX |
| 38 | #include <time.h> | 40 | #include <time.h> |
| 39 | #endif | 41 | #endif |
| 40 | 42 | ||
| 41 | #endif | ||
| 42 | |||
| 43 | 43 | ||
| 44 | /* EMACS_TIME is the type to use to represent temporal intervals - | 44 | /* EMACS_TIME is the type to use to represent temporal intervals - |
| 45 | struct timeval on some systems, int on others. It can be passed as | 45 | struct timeval on some systems, int on others. It can be passed as |
| @@ -184,8 +184,17 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 184 | 184 | ||
| 185 | #ifndef EMACS_CURRENT_TIME_ZONE | 185 | #ifndef EMACS_CURRENT_TIME_ZONE |
| 186 | 186 | ||
| 187 | /* System V derivatives have a timezone global variable. */ | ||
| 188 | #ifdef USG | ||
| 189 | #define EMACS_GET_TZ_OFFSET(offset) \ | ||
| 190 | do { \ | ||
| 191 | tzset (); \ | ||
| 192 | *(offset) = timezone; \ | ||
| 193 | } while (0) | ||
| 194 | #endif | ||
| 195 | |||
| 187 | /* If we have timeval, then we have gettimeofday; that's half the battle. */ | 196 | /* If we have timeval, then we have gettimeofday; that's half the battle. */ |
| 188 | #ifdef HAVE_TIMEVAL | 197 | #if defined (HAVE_TIMEVAL) && !defined (EMACS_GET_TZ_OFFSET) |
| 189 | #define EMACS_GET_TZ_OFFSET(offset) \ | 198 | #define EMACS_GET_TZ_OFFSET(offset) \ |
| 190 | do { \ | 199 | do { \ |
| 191 | struct timeval dummy; \ | 200 | struct timeval dummy; \ |
| @@ -196,15 +205,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 196 | } while (0) | 205 | } while (0) |
| 197 | #endif /* ! defined (HAVE_TIMEVAL) */ | 206 | #endif /* ! defined (HAVE_TIMEVAL) */ |
| 198 | 207 | ||
| 199 | /* System V derivatives have a timezone global variable. */ | ||
| 200 | #ifdef USG | ||
| 201 | #define EMACS_GET_TZ_OFFSET(offset) \ | ||
| 202 | do { \ | ||
| 203 | tzset (); \ | ||
| 204 | *(offset) = timezone; \ | ||
| 205 | } while (0) | ||
| 206 | #endif | ||
| 207 | |||
| 208 | /* The following sane systems have a tzname array. The timezone() function | 208 | /* The following sane systems have a tzname array. The timezone() function |
| 209 | is a stupid idea; timezone names can only be determined geographically, | 209 | is a stupid idea; timezone names can only be determined geographically, |
| 210 | not by Greenwich offset. */ | 210 | not by Greenwich offset. */ |