]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
backtrace: Inline esc() helper, making it available to all build variants
authorMartin Willi <martin@revosec.ch>
Thu, 2 Jan 2014 13:33:32 +0000 (14:33 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:52:58 +0000 (15:52 +0200)
src/libstrongswan/utils/backtrace.c

index 6101fb9c2fa60631c999de83843eb0de3a826938..3bb16354541b7cf08b053402f0307f30914053bb 100644 (file)
@@ -89,6 +89,18 @@ static void println(FILE *file, char *format, ...)
        va_end(args);
 }
 
+/**
+ * Same as tty_escape_get(), but for a potentially NULL FILE*
+ */
+static inline char* esc(FILE *file, tty_escape_t escape)
+{
+       if (file)
+       {
+               return tty_escape_get(fileno(file), escape);
+       }
+       return "";
+}
+
 #ifdef HAVE_DBGHELP
 
 #include <dbghelp.h>
@@ -118,18 +130,6 @@ void backtrace_deinit()
 #include <dlfcn.h>
 #endif
 
-/**
- * Same as tty_escape_get(), but for a potentially NULL FILE*
- */
-static char* esc(FILE *file, tty_escape_t escape)
-{
-       if (file)
-       {
-               return tty_escape_get(fileno(file), escape);
-       }
-       return "";
-}
-
 #ifdef HAVE_BFD_H
 
 #include <bfd.h>