C11 and KTime improvements

This commit is contained in:
Ali Mashtizadeh 2014-11-25 00:22:05 -08:00
parent a379454139
commit 287b3bc043
3 changed files with 16 additions and 2 deletions

11
include/stdalign.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef __STDALIGN_H__
#define __STDALIGN_H__
#if !defined(__cplusplus)
#define alignas _Alignas
#define alignof _Alignof
#endif
#endif /* __STDALIGN_H__ */

View File

@ -21,5 +21,7 @@ NO_RETURN void Panic(const char *str);
int kprintf(const char *fmt, ...);
void Debug_Assert(const char *fmt, ...);
#define static_assert _Static_assert
#endif /* __KASSERT_H__ */

View File

@ -58,7 +58,7 @@ KTime_DaysInMonth(uint64_t year, uint64_t month)
}
/*
* This function recomputes yday or wday given all other fields
* This function recomputes yday, mday or wday given other fields
*/
void
KTime_Fixup(KTime *tm)
@ -173,8 +173,9 @@ KTime_SetTime(const KTime *tm)
}
void
KTime_GetTime(const KTime *tm)
KTime_GetTime(KTime *tm)
{
KTime_FromEpoch(KTime_GetEpoch(), tm);
}
UnixEpoch