Skip to content

Commit

Permalink
Merge pull request #20 from StefansM/misc-bugfixes
Browse files Browse the repository at this point in the history
Miscellaneous bugfixes.
  • Loading branch information
StefansM authored Mar 1, 2018
2 parents 265854c + 10f7fe5 commit 2dc1121
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ WARN_CFLAGS=$(AS_ECHO(["$WARN_CFLAGS"]) | dnl
$SED 's/-W\(error=\)\?declaration-after-statement *//g')
AC_SUBST([WARN_CFLAGS])

# OSX requires linking against libiconv
AC_SEARCH_LIBS([iconv], [iconv], [],
[AC_MSG_ERROR(["iconv is required for locale conversion"])])
# Some systems require librt for clock_gettime
AC_SEARCH_LIBS([clock_gettime], [rt], [],
[AC_MSG_ERROR(["clock_gettime is required for timing"])])

# Use noreturn attribute if available
AC_CHECK_HEADERS_ONCE([stdnoreturn.h])
Expand Down
3 changes: 3 additions & 0 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

///Get a random integer in the range [lo, hi).
int randrange(int lo, int hi){
assert(lo <= hi /* Negative range not allowed. */);
if(lo == hi)
return lo;
return randint(lo, hi - 1);
}

Expand Down

0 comments on commit 2dc1121

Please sign in to comment.