summaryrefslogtreecommitdiff
path: root/src/libstddjb/tai_u64.c
blob: 1d7eabe41490a656f67967ee2225ed089423df07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* ISC license. */

#include <skalibs/bsdsnowflake.h>
#include <errno.h>
#include <skalibs/uint64.h>
#include <skalibs/tai.h>

int tai_u64 (tai_t *t, uint64_t u)
{
  if (u & ((uint64_t)1 << 63)) return (errno = EOVERFLOW, 0) ;
  t->x = u ;
  return 1 ;
}