]> git.mdlowis.com Git - projs/tide.git/commitdiff
removed common includes and add them to the acc runtime
authorMichael D. Lowis <mike.lowis@gentex.com>
Fri, 1 Feb 2019 18:21:11 +0000 (13:21 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Fri, 1 Feb 2019 18:21:11 +0000 (13:21 -0500)
acc
inc/stdc.h
src/edit.c
src/fetch.c
src/pick.c
src/registrar.c
src/term.c
src/tide.c

diff --git a/acc b/acc
index da9c0d6e6f2a35c288b1d4d6f4a424f348bd0ff1..82be42ed78ef9367b557a0c5aa9c1cfc21c596e3 100755 (executable)
--- 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 <stddef.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <limits.h>
+#include <sys/types.h>
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <fcntl.h>
+' # 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
index 12f80a0d524a729d86d77b402c60e86843b82d5c..bc94b0bf72c871b9576bd6516cd16269acd37f5b 100644 (file)
@@ -4,20 +4,20 @@
   @license BSD 2-clause License
 */
 
-/* Standard Macros and Types */
-#include <stddef.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <errno.h>
-#include <limits.h>
-#include <assert.h>
-
-/* Useful Standard Functions */
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
+///* Standard Macros and Types */
+//#include <stddef.h>
+//#include <stdint.h>
+//#include <stdbool.h>
+//#include <errno.h>
+//#include <limits.h>
+//#include <assert.h>
+//
+///* Useful Standard Functions */
+//#include <signal.h>
+//#include <stdio.h>
+//#include <stdlib.h>
+//#include <stdarg.h>
+//#include <string.h>
 
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-function"
index 982ed59a6a184b1adc9fcbdd26005708eecd9c99..766001e3d6c8d0098c78b5cf8a136e3cf4333907 100644 (file)
@@ -1,7 +1,5 @@
-#define _XOPEN_SOURCE 700
-#include <x11.h>
-#include <unistd.h>
 #include <stdc.h>
+#include <x11.h>
 
 #include "config.h"
 
index b253ee0f61b68365c960e27af365193fb2388ec2..2ce67d3ca485ec4d2f34575da92e50facef3cd63 100644 (file)
@@ -1,11 +1,6 @@
-#define _XOPEN_SOURCE 700
 #include <stdc.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
 #include <regex.h>
-#include <ctype.h>
-#include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/wait.h>
 
 typedef struct {
index 7721e951b445686c0f807251b5f2769177364421..5afd0aecba75b67a311ae26e8f230c456bd51a53 100644 (file)
@@ -1,6 +1,5 @@
 #include <stdc.h>
 #include <vec.h>
-#include <ctype.h>
 #include <x11.h>
 
 #define INCLUDE_DEFS
index 7509dba8cb670f183ea24dc4513aededd6afcb0d..bfaea70132aa3be4d41bec194cdbe84f72582ac6 100644 (file)
@@ -1,6 +1,5 @@
 #include <stdc.h>
 #include <x11.h>
-#include <unistd.h>
 #include "config.h"
 
 typedef struct TWindow {
index 6b952565d4980e07fab27fb309e3e0c55cad078c..bd2dbe7edaf007df334ef85017f7451032abc130 100644 (file)
@@ -1,27 +1,15 @@
 #define XINERAMA
 
 /* See LICENSE for license details. */
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
 #include <locale.h>
 #include <pwd.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <stdint.h>
 #include <sys/ioctl.h>
 #include <sys/select.h>
 #include <sys/stat.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/wait.h>
 #include <termios.h>
 #include <time.h>
-#include <unistd.h>
 #include <libgen.h>
 #include <X11/Xatom.h>
 #include <X11/Xlib.h>
index 3e92f25226391b6a07301ddcf5b464c7b708b8f8..e039e3349aa881aab690c4e7aacba35a04764533 100644 (file)
@@ -4,10 +4,7 @@
 #include <win.h>
 #include <x11.h>
 #include <draw.h>
-#include <ctype.h>
-#include <unistd.h>
 #include <locale.h>
-#include <sys/types.h>
 #include <sys/wait.h>
 
 #define INCLUDE_DEFS