From: Blue Swirl <blauwirbel@xxxxxxxxx> This patch adds OpenBSD support to sparse. Acked-by: Christopher Li <sparse@xxxxxxxxxxx> Signed-off-by: Blue Swirl <blauwirbel@xxxxxxxxx> --- cgcc | 3 +++ compat-bsd.c | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 0 deletions(-) create mode 100644 compat-bsd.c diff --git a/cgcc b/cgcc index 98686a7..cda8dab 100755 --- a/cgcc +++ b/cgcc @@ -221,6 +221,9 @@ sub add_specs { } elsif ($spec eq 'linux') { return &add_specs ('unix') . ' -D__linux__=1 -D__linux=1 -Dlinux=linux'; + } elsif ($spec eq 'openbsd') { + return &add_specs ('unix') . + ' -D__OpenBSD__=1'; } elsif ($spec eq 'unix') { return ' -Dunix=1 -D__unix=1 -D__unix__=1'; } elsif ( $spec =~ /^cygwin/) { diff --git a/compat-bsd.c b/compat-bsd.c new file mode 100644 index 0000000..4f3c8c0 --- /dev/null +++ b/compat-bsd.c @@ -0,0 +1,20 @@ +/* + * BSD Compatibility functions + * + * + * Licensed under the Open Software License version 1.1 + */ + +#include <sys/types.h> +#include <string.h> + +#include "lib.h" +#include "allocate.h" +#include "token.h" + +#include "compat/mmap-blob.c" + +long double string_to_ld(const char *nptr, char **endptr) +{ + return strtod(nptr, endptr); +} -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html