Fix building example module in OpenBSD.

This commit is contained in:
Joris Vink 2013-10-15 13:09:00 +02:00
parent c64d3e7854
commit ee99503323
3 changed files with 21 additions and 5 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#
# Copyright (c) 2013 Joris Vink <joris@coders.se>
#

View File

@ -20,6 +20,7 @@
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <inttypes.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
@ -87,8 +88,15 @@ main(int argc, char *argv[])
close(fd);
printf("};\n\n");
printf("u_int32_t static_len_%s_%s = %ld;\n", ext, argv[2], st.st_size);
printf("time_t static_mtime_%s_%s = %ld;\n", ext, argv[2], st.st_mtime);
printf("u_int32_t static_len_%s_%s = %" PRId64 ";\n",
ext, argv[2], st.st_size);
#if defined(OpenBSD)
printf("time_t static_mtime_%s_%s = %d;\n", ext, argv[2], st.st_mtime);
#else
printf("time_t static_mtime_%s_%s = %" PRId64 ";\n",
ext, argv[2], st.st_mtime);
#endif
fprintf(hdr, "extern u_int8_t static_%s_%s[];\n", ext, argv[2]);
fprintf(hdr, "extern u_int32_t static_len_%s_%s;\n", ext, argv[2]);

View File

@ -20,6 +20,7 @@
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <inttypes.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
@ -87,8 +88,15 @@ main(int argc, char *argv[])
close(fd);
printf("};\n\n");
printf("u_int32_t static_len_%s_%s = %ld;\n", ext, argv[2], st.st_size);
printf("time_t static_mtime_%s_%s = %ld;\n", ext, argv[2], st.st_mtime);
printf("u_int32_t static_len_%s_%s = %" PRId64 ";\n",
ext, argv[2], st.st_size);
#if defined(OpenBSD)
printf("time_t static_mtime_%s_%s = %d;\n", ext, argv[2], st.st_mtime);
#else
printf("time_t static_mtime_%s_%s = %" PRId64 ";\n",
ext, argv[2], st.st_mtime);
#endif
fprintf(hdr, "extern u_int8_t static_%s_%s[];\n", ext, argv[2]);
fprintf(hdr, "extern u_int32_t static_len_%s_%s;\n", ext, argv[2]);