remove BUILD_IOUTIL symbol

Add ioutil_stubs.c to provide an empty ioutil_init() routine.
Add ioutil.h to prevent applications from needing to declare it.

Allows unconditionally calling that function during startup, and the
resulting libocdhelper library API is now more stable.

Prints a DEBUG message when the stub implementation is included.
This commit is contained in:
Zachary T Welch
2009-12-01 19:52:00 -08:00
parent 34654359a9
commit eaf10f69de
6 changed files with 61 additions and 19 deletions
+1 -6
View File
@@ -30,6 +30,7 @@
#include "openocd.h"
#include "jtag.h"
#include "ioutil.h"
#include "configuration.h"
#include "xsvf.h"
#include "svf.h"
@@ -85,8 +86,6 @@ static int log_target_callback_event_handler(struct target *target, enum target_
return ERROR_OK;
}
int ioutil_init(struct command_context *cmd_ctx);
static bool init_at_startup = true;
COMMAND_HANDLER(handle_noinit_command)
@@ -227,12 +226,8 @@ int openocd_main(int argc, char *argv[])
cmd_ctx = setup_command_handler(NULL);
#if BUILD_IOUTIL
if (ioutil_init(cmd_ctx) != ERROR_OK)
{
return EXIT_FAILURE;
}
#endif
LOG_OUTPUT("For bug reports, read\n\t"
"http://openocd.berlios.de/doc/doxygen/bugs.html"