Skip to content

Commit

Permalink
WIN32: fix roken build
Browse files Browse the repository at this point in the history
__declspec not _declspec

Include "err.h" not <err.h>

Include "roken.h" before "err.h"

Indent "#if" as "# if" within roken.h.in when CPP rules must be copied
into the generated "roken.h".

Correct verr() attribute to be ROKEN_LIB_NORETURN_FUNCTION.

Change-Id: I4289ecaba4a097175b4a5a1cde529b59038c72e3
  • Loading branch information
jaltman committed Jan 22, 2019
1 parent 1822681 commit 3bbd866
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion lib/roken/err.c
Expand Up @@ -33,9 +33,10 @@

#include <config.h>

#include "roken.h"
#include "err.h"

ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
ROKEN_LIB_NORETURN_FUNCTION void ROKEN_LIB_CALL
err(int eval, const char *fmt, ...)
{
va_list ap;
Expand Down
2 changes: 1 addition & 1 deletion lib/roken/err.hin
Expand Up @@ -51,7 +51,7 @@
#endif
#ifndef ROKEN_LIB_NORETURN_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_NORETURN_FUNCTION _declspec(noreturn)
#define ROKEN_LIB_NORETURN_FUNCTION __declspec(noreturn)
#else
#define ROKEN_LIB_NORETURN_FUNCTION
#endif
Expand Down
10 changes: 5 additions & 5 deletions lib/roken/roken.h.in
Expand Up @@ -32,11 +32,11 @@
* SUCH DAMAGE.
*/

#if defined(_WIN32) && _MSC_VER >= 1400
# if defined(_WIN32) && _MSC_VER >= 1400
/* _CRT_RAND_S must be defined before including stdlib.h */
# define _CRT_RAND_S
# define HAVE_WIN32_RAND_S 1
#endif
# define _CRT_RAND_S
# define HAVE_WIN32_RAND_S 1
# endif

#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -69,7 +69,7 @@
# ifdef ROKEN_LIB_DYNAMIC
# define ROKEN_LIB_NORETURN_FUNCTION __declspec(dllimport noreturn)
# else
# define ROKEN_LIB_NORETURN_FUNCTION _declspec(noreturn)
# define ROKEN_LIB_NORETURN_FUNCTION __declspec(noreturn)
# endif
# else
# define ROKEN_LIB_NORETURN_FUNCTION
Expand Down
2 changes: 1 addition & 1 deletion lib/roken/verr.c
Expand Up @@ -36,7 +36,7 @@
#include "roken.h"
#include <err.h>

ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
ROKEN_LIB_NORETURN_FUNCTION void ROKEN_LIB_CALL
verr(int eval, const char *fmt, va_list ap)
{
rk_warnerr(1, fmt, ap);
Expand Down
1 change: 1 addition & 0 deletions lib/roken/warn.c
Expand Up @@ -33,6 +33,7 @@

#include <config.h>

#include "roken.h"
#include "err.h"

void
Expand Down

0 comments on commit 3bbd866

Please sign in to comment.