mirror of
https://git.code.sf.net/p/zint/code
synced 2025-12-17 09:57:02 +00:00
filemem: fix fwrite() return check in fm_write();
test `ferror()` also in `fm_err()` if `err` zero and file NetBSD: add instructions and some workarounds (`getopt_long_only()` in particular) qzint: check `__GNUC__` version for "-Wstringop-truncation" suppression
This commit is contained in:
@@ -26,20 +26,27 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#include <getopt.h>
|
||||
#include <zint.h>
|
||||
# include <getopt.h>
|
||||
# ifdef __NetBSD__ /* `getopt_long_only()` not available */
|
||||
# define getopt_long_only getopt_long
|
||||
# endif
|
||||
# include <zint.h>
|
||||
#else
|
||||
#include "../getopt/getopt.h"
|
||||
#include "zint.h"
|
||||
#if _MSC_VER != 1200 /* VC6 */
|
||||
#pragma warning(disable: 4996) /* function or variable may be unsafe */
|
||||
#endif
|
||||
# include "../getopt/getopt.h"
|
||||
# include "zint.h"
|
||||
# if _MSC_VER != 1200 /* VC6 */
|
||||
# pragma warning(disable: 4996) /* function or variable may be unsafe */
|
||||
# endif
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Following copied from "backend/library.c" */
|
||||
|
||||
/* It's assumed that int is at least 32 bits, the following will compile-time fail if not
|
||||
* https://stackoverflow.com/a/1980056 */
|
||||
typedef char static_assert_int_at_least_32bits[sizeof(int) * CHAR_BIT < 32 ? -1 : 1];
|
||||
|
||||
/* Following copied from "backend/common.h" */
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(x) ((int) (sizeof(x) / sizeof((x)[0])))
|
||||
#endif
|
||||
|
||||
@@ -1245,6 +1245,9 @@ static void test_other_opts(const testCtx *const p_ctx) {
|
||||
for (i = 0; i < data_size; i++) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
#ifdef __NetBSD__
|
||||
if (strcmp(data[i].opt, " -bg=") == 0) continue; /* `getopt_long_only()` not available on NetBSD */
|
||||
#endif
|
||||
|
||||
strcpy(cmd, "zint");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user