mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
libcsa: fix to use proper xdr function for time_t
This commit is contained in:
parent
2c9db8fe37
commit
4316bb797d
2 changed files with 21 additions and 1 deletions
|
@ -397,6 +397,12 @@ AC_CHECK_LIB(tirpc, svc_register,
|
|||
TIRPCLIB=-ltirpc])
|
||||
AC_SUBST(TIRPCLIB)
|
||||
|
||||
dnl check sizeof time_t for RPC
|
||||
AC_CHECK_SIZEOF([int])
|
||||
AC_CHECK_SIZEOF([long])
|
||||
AC_CHECK_SIZEOF([long long])
|
||||
AC_CHECK_SIZEOF([time_t])
|
||||
|
||||
dnl jpeg
|
||||
AC_CHECK_LIB(jpeg, jpeg_read_header, [JPEGLIB="-ljpeg"],
|
||||
[AC_MSG_ERROR([libjpeg not found, please install it])],
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
* xdr routines for xapia csa data structures
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <autotools_config.h>
|
||||
#endif
|
||||
#include <EUSCompat.h>
|
||||
#include "cm.h"
|
||||
#include "csa.h"
|
||||
|
@ -44,10 +47,21 @@ bool_t xdr_time_t(XDR *xdrs, time_t *objp);
|
|||
/*
|
||||
* time_t is a typedef which is system dependent
|
||||
*/
|
||||
#ifndef _xdr_time_t
|
||||
# if SIZEOF_INT == SIZEOF_TIME_T
|
||||
# define _xdr_time_t xdr_int
|
||||
# elif SIZEOF_LONG == SIZEOF_TIME_T
|
||||
# define _xdr_time_t xdr_long
|
||||
# elif SIZEOF_LONG_LONG == SIZEOF_TIME_T
|
||||
# define _xdr_time_t xdr_hyper
|
||||
# else
|
||||
# error "Unknown time_t size"
|
||||
# endif
|
||||
#endif
|
||||
bool_t
|
||||
xdr_time_t(XDR *xdrs, time_t *objp)
|
||||
{
|
||||
if (!xdr_long(xdrs, objp))
|
||||
if (!_xdr_time_t(xdrs, objp))
|
||||
return (FALSE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue