#include <math.h>
#include <stdbool.h>
#include <stddef.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
+#ifdef __FreeBSD__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreserved-macro-identifier"
+#define __BSD_VISIBLE 1
+#pragma clang diagnostic pop
+#endif
+#include <time.h>
+
#include <keks/atom.h>
#include <keks/err.h>
#include <keks/items.h>
fputs(" ", stdout);
} else {
fprintf(stdout, "%s%zd%s ", ColourBlue, indent, ColourReset);
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat-nonliteral"
fprintf(stdout, OffFmt, ColourRed, items->offsets[idx], ColourReset);
+#pragma clang diagnostic pop
}
struct KEKSItem *item = &(items->list[idx]);
printIndent(indent);
KEKSItemsNoOffsets(&items);
}
errno = 0;
+#ifdef __FreeBSD__
if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &started) != 0) {
+#else
+ if (clock_gettime(CLOCK_MONOTONIC, &started) != 0) {
+#endif
fprintf(stderr, "clock_gettime(started): %s\n", strerror(errno));
exit(EXIT_FAILURE);
}
err = KEKSItemsParse(&items, &off, buf, len);
errno = 0;
+#ifdef __FreeBSD__
if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &finished) != 0) {
+#else
+ if (clock_gettime(CLOCK_MONOTONIC, &finished) != 0) {
+#endif
fprintf(stderr, "clock_gettime(finished): %s\n", strerror(errno));
exit(EXIT_FAILURE);
}
-redo-ifchange conf/prefix
+redo-ifchange conf/cflags conf/prefix
read PREFIX <conf/prefix
+cat conf/cflags
printf "%s\n" "-I$PREFIX/include"
-std=c99
+-D_POSIX_C_SOURCE=200809L
-pipe
-fno-omit-frame-pointer
-fPIC
#include <stddef.h>
-#include "atom.h"
+#include "atom.h" // IWYU pragma: keep // struct KEKSAtom
#include "err.h"
// TEXINFO: KEKSAtomDecode
// You should have received a copy of the GNU Lesser General Public
// License along with this program. If not, see <http://www.gnu.org/licenses/>.
-#include <stddef.h>
#include <stdint.h>
#include <time.h>
#ifndef KEKS_DECTAI_H
#define KEKS_DECTAI_H
-#include <stddef.h>
-#include <time.h>
+#include <time.h> // IWYU pragma: keep // struct timespec
#include "err.h"
#define KEKS_ENCTAI_H
#include <stdbool.h>
-#include <time.h>
+#include <time.h> // IWYU pragma: keep // struct timespec
// TEXINFO: KEKSTimespecToTAI64
// @deftypefun bool KEKSTimespecToTAI64 @
#include <stddef.h>
-#include "items.h"
+#include "items.h" // IWYU pragma: keep // struct KEKSItems
// TEXINFO: KEKSSchemaErrType
// @deftp {Data type} {enum KEKSSchemaErrType}
--- /dev/null
+#!/bin/sh -e
+
+root=${0%/*}
+redo-ifchange $root/../compile_flags.txt
+cflags=$(cat $root/../compile_flags.txt)
+[ $# -eq 0 ] && srcs=*.c || srcs="$@"
+for c in $srcs ; do
+ include-what-you-use $cflags -Xiwyu --mapping_file=$root/iwyu-maps.imp $c 2>&1
+done
[
{ symbol: ["CLOCK_REALTIME", "private", "<time.h>", "public"] },
+ { symbol: ["CLOCK_MONOTONIC_PRECISE", "private", "<time.h>", "public"] },
{ symbol: ["PTRDIFF_MAX", "private", "<stdint.h>", "public"] },
{ symbol: ["SIZE_MAX", "private", "<stdint.h>", "public"] },
]