wip update - use the fetched mesa gallium paths and files.
[AROS.git] / compiler / stdc / __stdc_gmtoffset.c
blob54db7c4a9ee640668280e7f2cdfce10f9d4a54e0
1 /*
2 Copyright © 1995-2018, The AROS Development Team. All rights reserved.
3 $Id$
5 Internal arossstdc function to get current GMT offset
6 */
7 #include <proto/exec.h>
9 #define __NOBLIBBASE__
11 #include <proto/locale.h>
12 #include <exec/execbase.h>
14 #include "__stdc_intbase.h"
15 #include "__optionallibs.h"
17 /*****************************************************************************
19 NAME */
20 #include <time.h>
22 int __stdc_gmtoffset (
24 /* SYNOPSIS */
25 void)
27 /* FUNCTION
29 INPUTS
31 RESULT
32 The offset to GMT in minutes
34 NOTES
35 Will return 0 when locale.library is not loaded into memory yet.
37 EXAMPLE
39 BUGS
41 SEE ALSO
43 INTERNALS
44 Will always query the current locale through locale.library to
45 get the GMT offset.
47 ******************************************************************************/
49 struct StdCIntBase *StdCBase =
50 (struct StdCIntBase *)__aros_getbase_StdCBase();
51 struct LocaleBase *LocaleBase;
52 int gmtoffset = 0;
54 if (__locale_available(StdCBase))
56 struct Locale *loc;
57 LocaleBase = StdCBase->StdCLocaleBase;
58 if ((loc = OpenLocale(NULL)))
60 gmtoffset = (int)loc->loc_GMTOffset;
61 CloseLocale(loc);
65 return gmtoffset;