more generalized. More fallback functions
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@551 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
20
lib/roken/gettimeofday.c
Normal file
20
lib/roken/gettimeofday.c
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
RCSID("$Id$");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_GETTIMEOFDAY
|
||||||
|
/*
|
||||||
|
* Simple gettimeofday that only returns seconds.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
gettimeofday (struct timeval *tp, void *ignore)
|
||||||
|
{
|
||||||
|
time_t t;
|
||||||
|
|
||||||
|
t = time(NULL);
|
||||||
|
tp->tv_sec = t;
|
||||||
|
tp->tv_usec = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
18
lib/roken/swab.c
Normal file
18
lib/roken/swab.c
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
RCSID("$Id$");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_SWAB
|
||||||
|
void
|
||||||
|
swab (char *from, char *to, int nbytes)
|
||||||
|
{
|
||||||
|
while(nbytes >= 2) {
|
||||||
|
*(to + 1) = *from;
|
||||||
|
*to = *(from + 1);
|
||||||
|
to += 2;
|
||||||
|
from += 2;
|
||||||
|
nbytes -= 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
Reference in New Issue
Block a user