Skip to content

Commit

Permalink
Minor win32 compat
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Sep 20, 2023
1 parent dd25edc commit 7ff5449
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/mod-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <unistd.h>
#include <getopt.h>
#include <jack/jack.h>
#include <pthread.h>
#include <signal.h>

#ifndef SKIP_READLINE
Expand Down Expand Up @@ -757,7 +758,9 @@ int main(int argc, char **argv)
{
/* Command line options */
static struct option long_options[] = {
#ifndef _WIN32
{"nofork", no_argument, 0, 'n'},
#endif
{"verbose", no_argument, 0, 'v'},
{"socket-port", required_argument, 0, 'p'},
{"feedback-port", required_argument, 0, 'f'},
Expand Down Expand Up @@ -821,7 +824,9 @@ int main(int argc, char **argv)
#ifndef SKIP_READLINE
" -i, --interactive interactive mode\n"
#endif
#ifndef _WIN32
" -n, --nofork run in nonforking mode\n"
#endif
" -V, --version print program version and exit\n"
" -h, --help print this help and exit\n",
argv[0]);
Expand Down Expand Up @@ -851,6 +856,7 @@ int main(int argc, char **argv)

if (! nofork)
{
#ifndef _WIN32
int pid;
pid = fork();
if (pid != 0)
Expand All @@ -870,6 +876,7 @@ int main(int argc, char **argv)
}
exit(EXIT_SUCCESS);
}
#endif
}

if (mod_host_init(NULL, socket_port, feedback_port) != 0)
Expand All @@ -889,6 +896,8 @@ int main(int argc, char **argv)
else
#endif
{
#ifdef _WIN32
#else
struct sigaction sig;
memset(&sig, 0, sizeof(sig));

Expand All @@ -897,6 +906,7 @@ int main(int argc, char **argv)
sigemptyset(&sig.sa_mask);
sigaction(SIGTERM, &sig, NULL);
sigaction(SIGINT, &sig, NULL);
#endif
}

/* Verbose */
Expand Down
4 changes: 3 additions & 1 deletion src/sha1/sha1.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
# define SHA_BIG_ENDIAN
# endif
#else // ! defined __LITTLE_ENDIAN__
#elif defined _WIN32
/* assume little endian */
#else
# include <endian.h> // machine/endian.h
# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
# define SHA_BIG_ENDIAN
Expand Down

0 comments on commit 7ff5449

Please sign in to comment.