time.inl and error C2664

I found this file in a game I'm working on:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/***
*time.inl - inline definitions for time-related functions
*
*       Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
*       This file contains the time-related function definitions.
*
*       [Public]
*
****/

#pragma once

#if !defined (__CRTDECL)
#if defined (_M_CEE_PURE)
#define __CRTDECL
#else  /* defined (_M_CEE_PURE) */
#define __CRTDECL   __cdecl
#endif  /* defined (_M_CEE_PURE) */
#endif  /* !defined (__CRTDECL) */

#ifndef _INC_TIME_INL
#define _INC_TIME_INL
#ifndef RC_INVOKED

#ifdef _USE_32BIT_TIME_T
static __inline double __CRTDECL difftime(time_t _Time1, time_t _Time2)
{
    return _difftime32(_Time1,_Time2);
}
_CRT_INSECURE_DEPRECATE(ctime_s) static __inline char * __CRTDECL ctime(const time_t * _Time)
{
#pragma warning( push )
#pragma warning( disable : 4996 )
    return _ctime32(_Time);
#pragma warning( pop )
}
#if __STDC_WANT_SECURE_LIB__
static __inline errno_t __CRTDECL ctime_s(char *_Buffer, size_t _SizeInBytes, const time_t * _Time)
{
    return _ctime32_s(_Buffer, _SizeInBytes, _Time);
}
#endif  /* __STDC_WANT_SECURE_LIB__ */
_CRT_INSECURE_DEPRECATE(gmtime_s) static __inline struct tm * __CRTDECL gmtime(const time_t * _Time)
{
#pragma warning( push )
#pragma warning( disable : 4996 )
    return _gmtime32(_Time);
#pragma warning( pop )
}
#if __STDC_WANT_SECURE_LIB__
static __inline errno_t __CRTDECL gmtime_s(struct tm * _Tm, const time_t * _Time)
{
    return _gmtime32_s(_Tm, _Time);
}
#endif  /* __STDC_WANT_SECURE_LIB__ */
_CRT_INSECURE_DEPRECATE(localtime_s) static __inline struct tm * __CRTDECL localtime(const time_t * _Time)
{
#pragma warning( push )
#pragma warning( disable : 4996 )
    return _localtime32(_Time);
#pragma warning( pop )
}
static __inline errno_t __CRTDECL localtime_s(struct tm * _Tm, const time_t * _Time)
{
    return _localtime32_s(_Tm, _Time);
}
static __inline time_t __CRTDECL mktime(struct tm * _Tm)
{
    return _mktime32(_Tm);
}
static __inline time_t __CRTDECL _mkgmtime(struct tm * _Tm)
{
    return _mkgmtime32(_Tm);
}
static __inline time_t __CRTDECL time(time_t * _Time)
{
    return _time32(_Time);
}
#else  /* _USE_32BIT_TIME_T */
static __inline double __CRTDECL difftime(time_t _Time1, time_t _Time2)
{
    return _difftime64(_Time1,_Time2);
}
_CRT_INSECURE_DEPRECATE(ctime_s) static __inline char * __CRTDECL ctime(const time_t * _Time)
{
#pragma warning( push )
#pragma warning( disable : 4996 )
    return _ctime64(_Time);
#pragma warning( pop )
}
#if __STDC_WANT_SECURE_LIB__
static __inline errno_t __CRTDECL ctime_s(char *_Buffer, size_t _SizeInBytes, const time_t * _Time)
{
    return _ctime64_s(_Buffer, _SizeInBytes, _Time);
}
#endif  /* __STDC_WANT_SECURE_LIB__ */
_CRT_INSECURE_DEPRECATE(gmtime_s) static __inline struct tm * __CRTDECL gmtime(const time_t * _Time)
{
#pragma warning( push )
#pragma warning( disable : 4996 )
    return _gmtime64(_Time);
#pragma warning( pop )
}
#if __STDC_WANT_SECURE_LIB__
static __inline errno_t __CRTDECL gmtime_s(struct tm * _Tm, const time_t * _Time)
{
    return _gmtime64_s(_Tm, _Time);
}
#endif  /* __STDC_WANT_SECURE_LIB__ */
_CRT_INSECURE_DEPRECATE(localtime_s) static __inline struct tm * __CRTDECL localtime(const time_t * _Time)
{
#pragma warning( push )
#pragma warning( disable : 4996 )
    return _localtime64(_Time);
#pragma warning( pop )
}
static __inline errno_t __CRTDECL localtime_s(struct tm * _Tm, const time_t * _Time)
{
    return _localtime64_s(_Tm, _Time);
}
static __inline time_t __CRTDECL mktime(struct tm * _Tm)
{
    return _mktime64(_Tm);
}
static __inline time_t __CRTDECL _mkgmtime(struct tm * _Tm)
{
    return _mkgmtime64(_Tm);
}
static __inline time_t __CRTDECL time(time_t * _Time)
{
    return _time64(_Time);
}
#endif  /* _USE_32BIT_TIME_T */


#endif  /* RC_INVOKED */
#endif  /* _INC_TIME_INL */ 


and I'm getting the following errors when I compile it in Visual Studio Community 2013:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Warning	3	warning C4244: 'argument' : conversion from 'time_t' to '__time32_t', possible loss of data	c:\program files (x86)\microsoft visual studio 12.0\vc\include\time.inl	30

Error	4	error C2664: 'char *_ctime32(const __time32_t *)' : cannot convert argument 1 from 'const time_t *' to 'const __time32_t *'	c:\program files (x86)\microsoft visual studio 12.0\vc\include\time.inl	36

Error	5	error C2664: 'errno_t _ctime32_s(char *,size_t,const __time32_t *)' : cannot convert argument 3 from 'const time_t *' to 'const __time32_t *'	c:\program files (x86)\microsoft visual studio 12.0\vc\include\time.inl	42

Error	6	error C2664: 'tm *_gmtime32(const __time32_t *)' : cannot convert argument 1 from 'const time_t *' to 'const __time32_t *'	c:\program files (x86)\microsoft visual studio 12.0\vc\include\time.inl	49

Error	7	error C2664: 'errno_t _gmtime32_s(tm *,const __time32_t *)' : cannot convert argument 2 from 'const time_t *' to 'const __time32_t *'	c:\program files (x86)\microsoft visual studio 12.0\vc\include\time.inl	55

Error	8	error C2664: 'tm *_localtime32(const __time32_t *)' : cannot convert argument 1 from 'const time_t *' to 'const __time32_t *'	c:\program files (x86)\microsoft visual studio 12.0\vc\include\time.inl	62

Error	9	error C2664: 'errno_t _localtime32_s(tm *,const __time32_t *)' : cannot convert argument 2 from 'const time_t *' to 'const __time32_t *'	c:\program files (x86)\microsoft visual studio 12.0\vc\include\time.inl	67

Error	10	error C2664: '__time32_t _time32(__time32_t *)' : cannot convert argument 1 from 'time_t *' to '__time32_t *'	c:\program files (x86)\microsoft visual studio 12.0\vc\include\time.inl	79


Any idea how I can resolve this?
Last edited on
If anyone cares I figured out the answer to this problem. You can solve it by going to:

Properties => C/C++ => Preprocessor => Preprocessor Definitions

and adding:

_USE_32BIT_TIME_T
Topic archived. No new replies allowed.