remove #if BUILD_HTTPD

Add httpd_stubs.c to provide no-op implementations of httpd_start()
and httpd_stop().

Allows these routines to be called unconditionally and ensures the
libocdserver ABI remains unchanged regardless of whether this feature
was built-in or not.

Prints a DEBUG message when the stub implementation is included.
This commit is contained in:
Zachary T Welch
2009-12-01 19:58:32 -08:00
parent eaf10f69de
commit 6ec526e706
4 changed files with 33 additions and 10 deletions

View File

@@ -244,10 +244,8 @@ int openocd_main(int argc, char *argv[])
if (ret != ERROR_OK)
return EXIT_FAILURE;
#if BUILD_HTTPD
if (httpd_start(cmd_ctx) != ERROR_OK)
return EXIT_FAILURE;
#endif
ret = server_init(cmd_ctx);
if (ERROR_OK != ret)
@@ -266,9 +264,7 @@ int openocd_main(int argc, char *argv[])
server_quit();
#if BUILD_HTTPD
httpd_stop();
#endif
unregister_all_commands(cmd_ctx, NULL);