Unverified Commit a9079314 authored by Karl Linden's avatar Karl Linden
Browse files

example-clients/transport.c: replace '#ifdef' with '#if' and '#ifndef x' with '#if !x'

parent dd7d2343
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
#include <signal.h> #include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_READLINE #if HAVE_READLINE
#include <readline/readline.h> #include <readline/readline.h>
#include <readline/history.h> #include <readline/history.h>
#endif #endif
#include <jack/jack.h> #include <jack/jack.h>
#include <jack/transport.h> #include <jack/transport.h>
#ifndef HAVE_READLINE #if !HAVE_READLINE
#define whitespace(c) (((c) == ' ') || ((c) == '\t')) #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
#endif #endif
...@@ -389,7 +389,7 @@ static char *command_generator (const char *text, int state) ...@@ -389,7 +389,7 @@ static char *command_generator (const char *text, int state)
static void command_loop() static void command_loop()
{ {
#ifdef HAVE_READLINE #if HAVE_READLINE
char *line, *cmd; char *line, *cmd;
char prompt[32]; char prompt[32];
...@@ -408,7 +408,7 @@ static void command_loop() ...@@ -408,7 +408,7 @@ static void command_loop()
/* Read and execute commands until the user quits. */ /* Read and execute commands until the user quits. */
while (!done) { while (!done) {
#ifdef HAVE_READLINE #if HAVE_READLINE
line = readline(prompt); line = readline(prompt);
if (line == NULL) { /* EOF? */ if (line == NULL) { /* EOF? */
...@@ -428,13 +428,13 @@ static void command_loop() ...@@ -428,13 +428,13 @@ static void command_loop()
/* If anything left, add to history and execute it. */ /* If anything left, add to history and execute it. */
if (*cmd) if (*cmd)
{ {
#ifdef HAVE_READLINE #if HAVE_READLINE
add_history(cmd); add_history(cmd);
#endif #endif
execute_command(cmd); execute_command(cmd);
} }
#ifdef HAVE_READLINE #if HAVE_READLINE
free(line); /* realine() called malloc() */ free(line); /* realine() called malloc() */
#endif #endif
} }
...@@ -459,7 +459,7 @@ int main(int argc, char *argv[]) ...@@ -459,7 +459,7 @@ int main(int argc, char *argv[])
return 1; return 1;
} }
#ifndef WIN32 #if !WIN32
signal(SIGQUIT, signal_handler); signal(SIGQUIT, signal_handler);
signal(SIGHUP, signal_handler); signal(SIGHUP, signal_handler);
#endif #endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment