X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fsc_test.c;h=e88ddca87d3964e285007de2cc388120ea90bcec;hp=390fe7d8e3ebdbe6602943c49ed6071ac7604a31;hb=5c1eb188e9cf6f0dd2e435a1f81938f258515edb;hpb=2788a4851b551e1a3efb320a2878b809f2d8a9d7 diff --git a/src/sc_test.c b/src/sc_test.c index 390fe7d..e88ddca 100644 --- a/src/sc_test.c +++ b/src/sc_test.c @@ -1,12 +1,14 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2009 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ - /** * \file sc_test.c * \brief Small test for the Windows Service Control utility */ +#if HAVE_CONFIG_H +#include +#endif #ifdef WIN32 #include @@ -15,11 +17,14 @@ #endif #include +#include #include #include #include #include +#ifdef WIN32 + /** \brief handle that is used to stop that service should be stopped */ HANDLE default_stop_event = NULL; @@ -51,19 +56,26 @@ static int default_sc_main(yaz_sc_t s, int argc, char **argv) return 0; } +#endif + /** \brief the system main function */ int main(int argc, char **argv) { +#ifdef WIN32 yaz_sc_t s = yaz_sc_create("yaz_sc_test", "YAZ Service Control Test"); yaz_sc_program(s, argc, argv, default_sc_main, default_sc_stop); yaz_sc_destroy(&s); +#else + printf("Only on Windows\n"); +#endif exit(0); } /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab