Fixing now() function

The now() function was defined using the #define directive. That is
wrong as it prevents using the keyword "now" in other situations.
This commit is contained in:
Jiri Bilek 2018-02-03 13:15:56 +01:00
parent 42a5e9f907
commit 35e0a6453a
1 changed files with 4 additions and 2 deletions

View File

@ -52,7 +52,9 @@ class RTClock {
time_t getTime();
void getTime(tm_t & tmm );
#define now getTime
time_t now() { return getTime(); }
void now(tm_t & tmm ) { getTime(tmm); } // non-standard use of now() function, added for compatibility with previous versions of the library
uint8_t year(void) { getTime(tmm); return tmm.year; }
uint8_t month(void) { getTime(tmm); return tmm.month; }
@ -100,4 +102,4 @@ class RTClock {
#endif // _RTCLOCK_H_