Use std=gnu99

This allows us to use C99 features such as lldiv along with GNU extensions
and POSIX, etc.
This commit is contained in:
Laurence Withers 2009-01-03 19:04:54 +00:00
parent 2d51d09c83
commit 849744bb07
3 changed files with 6 additions and 7 deletions

View File

@ -13,7 +13,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <sys/time.h>
/* Useful define to alleviate typos */

View File

@ -100,13 +100,13 @@ void iso8601_subtract_elapsed(struct iso8601_date* date, const struct iso8601_el
void iso8601_add_multiple(struct iso8601_date* date, const struct iso8601_elapsed* per, int n)
{
intmax_t nsec;
imaxdiv_t qr;
long long nsec;
lldiv_t qr;
struct iso8601_elapsed mult;
nsec = per->nsec * imaxabs(n);
qr = imaxdiv(nsec, BILLION);
mult.sec = qr.quot + per->sec * imaxabs(n);
nsec = per->nsec * llabs(n);
qr = lldiv(nsec, BILLION);
mult.sec = qr.quot + per->sec * llabs(n);
mult.nsec = qr.rem;
if(n < 0) iso8601_subtract_elapsed(date, &mult);

View File

@ -12,7 +12,7 @@ then
source src/libiso8601/soversion
libiso8601="obj/${libiso8601_BASE}.so.${SOMAJOR}.${SOMICRO}"
libiso8601_DEP_CFLAGS=""
libiso8601_DEP_CFLAGS="-std=gnu99"
libiso8601_DEP_LIBS="-lrt"
SO_EXTRA="${libiso8601_DEP_CFLAGS} ${libiso8601_DEP_LIBS} -lc"