]> git.refcnt.org Git - colorize.git/blobdiff - colorize.c
colorize 0.60
[colorize.git] / colorize.c
index 06f448b15e8b7f20734c134d6e3ede2e077ff7cb..3c96a29e960d0ab7e29aaa3a32ae3116f8e73db7 100644 (file)
@@ -2,7 +2,7 @@
  * colorize - Read text from standard input stream or file and print
  *            it colorized through use of ANSI escape sequences
  *
- * Copyright (c) 2011-2016 Steven Schubiger
+ * Copyright (c) 2011-2017 Steven Schubiger
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
  *
  */
 
+#define _DEFAULT_SOURCE
 #define _BSD_SOURCE
 #define _XOPEN_SOURCE 700
 #define _FILE_OFFSET_BITS 64
 
 #define DEBUG_FILE "debug.txt"
 
-#define VERSION "0.59"
+#define VERSION "0.60"
 
 typedef enum { false, true } bool;
 
@@ -473,7 +474,7 @@ print_version (void)
     const char *version = NULL;
 #endif
     const char *version_prefix, *version_string;
-    const char *c_flags;
+    const char *c_flags, *ld_flags, *cpp_flags;
     struct bytes_size bytes_size;
     bool debug;
 #ifdef CFLAGS
@@ -481,6 +482,16 @@ print_version (void)
 #else
     c_flags = "unknown";
 #endif
+#ifdef LDFLAGS
+    ld_flags = to_str (LDFLAGS);
+#else
+    ld_flags = "unknown";
+#endif
+#ifdef CPPFLAGS
+    cpp_flags = to_str (CPPFLAGS);
+#else
+    cpp_flags = "unknown";
+#endif
 #if DEBUG
     debug = true;
 #else
@@ -491,6 +502,8 @@ print_version (void)
     printf ("colorize %s%s (compiled at %s, %s)\n", version_prefix, version_string, __DATE__, __TIME__);
 
     printf ("Compiler flags: %s\n", c_flags);
+    printf ("Linker flags: %s\n", ld_flags);
+    printf ("Preprocessor flags: %s\n", cpp_flags);
     if (get_bytes_size (BUF_SIZE, &bytes_size))
       {
         if (BUF_SIZE % 1024 == 0)
@@ -773,7 +786,7 @@ read_print_stream (bool bold, const struct color **colors, const char *file, FIL
         line = buf;
         while ((eol = strpbrk (line, "\n\r")))
           {
-            char *p;
+            const char *p;
             flags &= ~(CR|LF);
             if (*eol == '\r')
               {