summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2016-02-12 03:40:30 +0100
committerKamil Rytarowski <n54@gmx.com>2016-02-14 15:07:15 +0100
commiteff2c6e57d957f94129993a5e32ed93925ef289d (patch)
tree60ae688c393bfbde7ab76d88935d0e81a3fd9e34 /src/pal
parentf3a008bf45b6cc8c150afd0416da59a5f23573f8 (diff)
downloadcoreclr-eff2c6e57d957f94129993a5e32ed93925ef289d.tar.gz
coreclr-eff2c6e57d957f94129993a5e32ed93925ef289d.tar.bz2
coreclr-eff2c6e57d957f94129993a5e32ed93925ef289d.zip
Fix build issue on NetBSD: Add time(3) to PAL
Otherwise it triggers linker warnings. /tmp/pkgsrc-tmp/wip/coreclr-git/work/coreclr/src/gc/gc.cpp:33869: warning: warning: reference to compatibility time(); include <time.h> for correct reference $ uname -a NetBSD chieftec 7.99.25 NetBSD 7.99.25 (GENERIC) #0: Fri Dec 25 20:51:06 UTC 2015 root@chieftec:/tmp/netbsd-tmp/sys/arch/amd64/compile/GENERIC amd64
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/inc/pal.h1
-rw-r--r--src/pal/src/cruntime/misc.cpp26
-rw-r--r--src/pal/src/include/pal/misc.h12
-rw-r--r--src/pal/src/include/pal/palinternal.h1
4 files changed, 35 insertions, 5 deletions
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
index cc4a695d04..0aa436504a 100644
--- a/src/pal/inc/pal.h
+++ b/src/pal/inc/pal.h
@@ -6027,6 +6027,7 @@ CoCreateGuid(OUT GUID * pguid);
#define localtime PAL_localtime
#define mktime PAL_mktime
#define rand PAL_rand
+#define time PAL_time
#define getenv PAL_getenv
#define fgets PAL_fgets
#define fgetws PAL_fgetws
diff --git a/src/pal/src/cruntime/misc.cpp b/src/pal/src/cruntime/misc.cpp
index 6ca340bf3f..107d5e316d 100644
--- a/src/pal/src/cruntime/misc.cpp
+++ b/src/pal/src/cruntime/misc.cpp
@@ -206,7 +206,7 @@ See MSDN for more details.
--*/
PAL_time_t
-__cdecl
+__cdecl
PAL_mktime(struct PAL_tm *tm)
{
time_t result;
@@ -260,6 +260,30 @@ PAL_rand(void)
}
+/*++
+Function:
+
+ time
+
+See MSDN for more details.
+--*/
+PAL_time_t
+__cdecl
+PAL_time(PAL_time_t *tloc)
+{
+ time_t result;
+
+ PERF_ENTRY(time);
+ ENTRY( "time( tloc=%p )\n",tloc );
+
+ result = time(tloc);
+
+ LOGEXIT( "time returning %#lx\n",result );
+ PERF_EXIT(time);
+ return result;
+}
+
+
PALIMPORT
void __cdecl
PAL_qsort(void *base, size_t nmemb, size_t size,
diff --git a/src/pal/src/include/pal/misc.h b/src/pal/src/include/pal/misc.h
index 99e7546215..2be2cc06b2 100644
--- a/src/pal/src/include/pal/misc.h
+++ b/src/pal/src/include/pal/misc.h
@@ -41,13 +41,20 @@ extern CRITICAL_SECTION gcsEnvironment;
Function :
PAL_rand
-
- Calls rand and mitigates the difference between RAND_MAX
+
+ Calls rand and mitigates the difference between RAND_MAX
on Windows and FreeBSD.
--*/
int __cdecl PAL_rand(void);
/*++
+Function :
+
+ PAL_time
+--*/
+PAL_time_t __cdecl PAL_time(PAL_time_t*);
+
+/*++
Function:
TIMEInitialize
@@ -128,4 +135,3 @@ void MiscUnsetenv(const char *name);
#endif // __cplusplus
#endif /* __MISC_H_ */
-
diff --git a/src/pal/src/include/pal/palinternal.h b/src/pal/src/include/pal/palinternal.h
index 9dbbf1cd00..070ffdf240 100644
--- a/src/pal/src/include/pal/palinternal.h
+++ b/src/pal/src/include/pal/palinternal.h
@@ -199,7 +199,6 @@ function_name() to call the system's implementation
#define srand DUMMY_srand
#define atoi DUMMY_atoi
#define atof DUMMY_atof
-#define time DUMMY_time
#define tm PAL_tm
#define size_t DUMMY_size_t
#define time_t PAL_time_t