From: Michael D. Lowis Date: Fri, 1 Feb 2019 18:21:11 +0000 (-0500) Subject: removed common includes and add them to the acc runtime X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=76248073b781dbaff68945df74a251c715ddce52;p=projs%2Ftide.git removed common includes and add them to the acc runtime --- diff --git a/acc b/acc index da9c0d6..82be42e 100755 --- a/acc +++ b/acc @@ -1,4 +1,30 @@ #!/usr/bin/env bash +# +# Copyright 2019 Michael D. Lowis +#------------------------------------------------------------------------------- +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +# Wrapper script for system compiler that enables some flags by default and scans +# for library dependencies. +# +# Compilation Features: +# * Enables --std=c99 -pedantic +# * Enables -Wall -Wextra -Werror +# * Defines AUTOLIB() macro to specify dependencies in sources and headers +# * Auto-includes commonly include headers such as stddef.h, stdio.h, etc. +# +# Linking Features: +# * Scans objects for AUTOLIB()-ed libs, and adds the -l flags for them # predeclare our variables declare -a objects @@ -8,7 +34,23 @@ runtime=' #define _POSIX_C_SOURCE 200809L #define _XOPEN_SOURCE 700 #define AUTOLIB(n) \ - int __autolib_##n __attribute__ ((weak));' + int __autolib_##n __attribute__ ((weak)); +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +' # end of runtime definition # scan the rest of the options for lib paths, libs and objects for i do @@ -19,7 +61,7 @@ for i do -L*) # Add libpaths to the search list libpaths+=("${i#-L}") ;; - -c) # Mark this as compilation only + -c|-E) # Mark this as compilation/preprocess only compile=true ;; esac done diff --git a/inc/stdc.h b/inc/stdc.h index 12f80a0..bc94b0b 100644 --- a/inc/stdc.h +++ b/inc/stdc.h @@ -4,20 +4,20 @@ @license BSD 2-clause License */ -/* Standard Macros and Types */ -#include -#include -#include -#include -#include -#include - -/* Useful Standard Functions */ -#include -#include -#include -#include -#include +///* Standard Macros and Types */ +//#include +//#include +//#include +//#include +//#include +//#include +// +///* Useful Standard Functions */ +//#include +//#include +//#include +//#include +//#include #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" diff --git a/src/edit.c b/src/edit.c index 982ed59..766001e 100644 --- a/src/edit.c +++ b/src/edit.c @@ -1,7 +1,5 @@ -#define _XOPEN_SOURCE 700 -#include -#include #include +#include #include "config.h" diff --git a/src/fetch.c b/src/fetch.c index b253ee0..2ce67d3 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -1,11 +1,6 @@ -#define _XOPEN_SOURCE 700 #include -#include -#include -#include #include -#include -#include +#include #include typedef struct { diff --git a/src/pick.c b/src/pick.c index 7721e95..5afd0ae 100644 --- a/src/pick.c +++ b/src/pick.c @@ -1,6 +1,5 @@ #include #include -#include #include #define INCLUDE_DEFS diff --git a/src/registrar.c b/src/registrar.c index 7509dba..bfaea70 100644 --- a/src/registrar.c +++ b/src/registrar.c @@ -1,6 +1,5 @@ #include #include -#include #include "config.h" typedef struct TWindow { diff --git a/src/term.c b/src/term.c index 6b95256..bd2dbe7 100644 --- a/src/term.c +++ b/src/term.c @@ -1,27 +1,15 @@ #define XINERAMA /* See LICENSE for license details. */ -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include -#include #include #include #include #include -#include #include #include #include -#include #include #include #include diff --git a/src/tide.c b/src/tide.c index 3e92f25..e039e33 100644 --- a/src/tide.c +++ b/src/tide.c @@ -4,10 +4,7 @@ #include #include #include -#include -#include #include -#include #include #define INCLUDE_DEFS