Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[GH #93] Fix compile errors reported on old Solaris systems

 - tig.h:81:1: warning: "__NORETURN" redefined
 - tig.c:2468: error: subscripted value is neither array nor pointer
  • Loading branch information...
commit 9ba6219ac69a38eeb59f466fca22813fff1ed953 1 parent 7290971
@jonas authored
Showing with 9 additions and 8 deletions.
  1. +1 −0  NEWS
  2. +1 −1  test-graph.c
  3. +5 −5 tig.c
  4. +2 −2 tig.h
View
1  NEWS
@@ -8,6 +8,7 @@ Bug fixes:
- Fix diff broken display when using --follow <filename>.
- Reload current branch name when reloading the status view. (GH #93)
+ - Fix compile errors on old Solaris. (GH #97)
tig-1.1
-------
View
2  test-graph.c
@@ -20,7 +20,7 @@
#include "io.h"
#include "graph.h"
-static void __NORETURN
+static void TIG_NORETURN
die(const char *err, ...)
{
va_list args;
View
10 tig.c
@@ -17,7 +17,7 @@
#include "graph.h"
#include "git.h"
-static void __NORETURN die(const char *err, ...) PRINTF_LIKE(1, 2);
+static void TIG_NORETURN die(const char *err, ...) PRINTF_LIKE(1, 2);
static void warn(const char *msg, ...) PRINTF_LIKE(1, 2);
static void report(const char *msg, ...) PRINTF_LIKE(1, 2);
#define report_clear() report("%s", "")
@@ -2445,7 +2445,7 @@ redraw_display(bool clear)
#define TOGGLE_MENU \
TOGGLE_(LINENO, '.', "line numbers", &opt_line_number, NULL) \
- TOGGLE_(DATE, 'D', "dates", &opt_date, date_map) \
+ TOGGLE_(DATE, 'D', "dates", &opt_date, date_map) \
TOGGLE_(AUTHOR, 'A', "author names", &opt_author, author_map) \
TOGGLE_(GRAPHIC, '~', "graphics", &opt_line_graphics, graphic_map) \
TOGGLE_(REV_GRAPH, 'g', "revision graph", &opt_rev_graph, NULL) \
@@ -2464,7 +2464,7 @@ toggle_option(enum request request)
const struct enum_map *map;
size_t map_size;
} data[] = {
-#define TOGGLE_(id, key, help, value, map) { REQ_TOGGLE_ ## id, map, ARRAY_SIZE(map) },
+#define TOGGLE_(id, key, help, value, map) { REQ_TOGGLE_ ## id, map, (map != NULL ? ARRAY_SIZE(map) : 0) },
TOGGLE_MENU
#undef TOGGLE_
};
@@ -8063,7 +8063,7 @@ static const char usage[] =
" -v, --version Show version and exit\n"
" -h, --help Show help message and exit";
-static void __NORETURN
+static void TIG_NORETURN
quit(int sig)
{
/* XXX: Restore tty modes and let the OS cleanup the rest! */
@@ -8072,7 +8072,7 @@ quit(int sig)
exit(0);
}
-static void __NORETURN
+static void TIG_NORETURN
die(const char *err, ...)
{
va_list args;
View
4 tig.h
@@ -78,10 +78,10 @@
#endif
#if __GNUC__ >= 3
-#define __NORETURN __attribute__((__noreturn__))
+#define TIG_NORETURN __attribute__((__noreturn__))
#define PRINTF_LIKE(fmt, args) __attribute__((format (printf, fmt, args)))
#else
-#define __NORETURN
+#define TIG_NORETURN
#define PRINTF_LIKE(fmt, args)
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.