mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-21 00:27:09 +02:00
util/spkmodem-recv: fix getopt prototype
i use -pedantic and std=c90 also add the define Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -1,14 +1,30 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: MIT
|
||||||
|
# SPDX-FileCopyrightText: 2022,2026 Leah Rowe <leah@libreboot.org>
|
||||||
|
# SPDX-FileCopyrightText: 2023 Riku Viitanen <riku.viitanen@protonmail.com>
|
||||||
|
|
||||||
CC?=cc
|
CC?=cc
|
||||||
CFLAGS?=-Os -Wall -Wextra -Werror -pedantic
|
CFLAGS?=-Os -Wall -Wextra -Werror -pedantic -std=c90
|
||||||
DESTDIR?=
|
DESTDIR?=
|
||||||
PREFIX?=/usr/local
|
PREFIX?=/usr/local
|
||||||
INSTALL?=install
|
INSTALL?=install
|
||||||
|
|
||||||
spkmodem-recv:
|
PROG=spkmodem-recv
|
||||||
$(CC) $(CFLAGS) -o $@ $@.c
|
|
||||||
install: spkmodem-recv
|
all: $(PROG)
|
||||||
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin/
|
|
||||||
$(INSTALL) $< -t $(DESTDIR)$(PREFIX)/bin/
|
$(PROG): spkmodem-recv.c
|
||||||
|
$(CC) $(CFLAGS) spkmodem-recv.c -o $(PROG)
|
||||||
|
|
||||||
|
install: $(PROG)
|
||||||
|
mkdir -p $(DESTDIR)$(PREFIX)/bin/
|
||||||
|
install $(PROG) $(DESTDIR)$(PREFIX)/bin/
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
rm -f $(DESTDIR)$(PREFIX)/bin/$(PROG)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f spkmodem-recv
|
rm -f $(PROG)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
|
||||||
|
.PHONY: all install uninstall clean distclean
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
* This version is heavily modified, re-written based on OpenBSD Kernel Source
|
* This version is heavily modified, re-written based on OpenBSD Kernel Source
|
||||||
* File Style Guide (KNF); this change is Copyright 2023,2026 Leah Rowe. */
|
* File Style Guide (KNF); this change is Copyright 2023,2026 Leah Rowe. */
|
||||||
|
|
||||||
|
#define _POSIX_SOURCE
|
||||||
|
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -25,6 +27,10 @@ static void err(int nvm_errval, const char *msg, ...);
|
|||||||
static const char * getnvmprogname(void);
|
static const char * getnvmprogname(void);
|
||||||
static void set_err_if_unset(int x);
|
static void set_err_if_unset(int x);
|
||||||
|
|
||||||
|
int getopt(int, char * const *, const char *);
|
||||||
|
extern char *optarg;
|
||||||
|
extern int optind, opterr, optopt;
|
||||||
|
|
||||||
#if defined(__OpenBSD__) && defined(OpenBSD)
|
#if defined(__OpenBSD__) && defined(OpenBSD)
|
||||||
#if OpenBSD >= 509
|
#if OpenBSD >= 509
|
||||||
#ifndef HAVE_PLEDGE
|
#ifndef HAVE_PLEDGE
|
||||||
|
|||||||
Reference in New Issue
Block a user