From ca2f6421c848a39c7083b0f352865f828adf8476 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 29 Jan 2010 08:34:30 +0000 Subject: [PATCH] push common mingw/cygwin/stropts checks to the common sysdep.h header git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1744 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 5 +++++ urjtag/src/apps/jtag/jtag.c | 4 ---- urjtag/src/bfin/bfin.c | 7 +------ urjtag/src/svf/svf.c | 10 ++-------- urjtag/src/tap/parport/ppdev.c | 4 +--- urjtag/src/tap/usbconn/libftd2xx.c | 6 ------ urjtag/src/tap/usbconn/libftdi.c | 6 ------ urjtag/src/tap/usbconn/libusb.c | 6 ------ urjtag/sysdep.h | 13 +++++++++++++ 9 files changed, 22 insertions(+), 39 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 35b97789..a1b5b1b9 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -5,6 +5,11 @@ * configure.ac: Unify calls to AC_CHECK_FUNCS. + * src/apps/jtag/jtag.c, src/bfin/bfin.c, src/svf/svf.c, + src/tap/parport/ppdev.c, src/tap/usbconn/libftd2xx.c, + src/tap/usbconn/libftdi.c, src/tap/usbconn/libusb.c, sysdep.h: Unify + system checks in the common sysdep.h header. + 2010-01-28 Mike Frysinger * src/cmd/cmd_bfin.c: Replace one-insn-a-file option with dynamic instruction diff --git a/urjtag/src/apps/jtag/jtag.c b/urjtag/src/apps/jtag/jtag.c index fdca5b25..3a00016f 100644 --- a/urjtag/src/apps/jtag/jtag.c +++ b/urjtag/src/apps/jtag/jtag.c @@ -86,11 +86,7 @@ jtag_create_jtagdir (void) strcat (jdir, JTAGDIR); /* Create the directory if it doesn't exists. */ -#ifdef __MINGW32__ - r = mkdir (jdir); -#else r = mkdir (jdir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); -#endif if (r == -1) { if (errno == EEXIST) diff --git a/urjtag/src/bfin/bfin.c b/urjtag/src/bfin/bfin.c index 09e30cb0..b95c638c 100644 --- a/urjtag/src/bfin/bfin.c +++ b/urjtag/src/bfin/bfin.c @@ -16,7 +16,7 @@ * 02111-1307, USA. */ -#include "sysdep.h" +#include #include #include @@ -46,11 +46,6 @@ const char *scans[] = { #define SWRST 0xffc00100 -#ifdef __MINGW32__ -struct timespec { unsigned long tv_sec, tv_nsec; }; -#define nanosleep(req, rem) usleep((req)->tv_sec * 1000 * 1000 + (req)->tv_nsec / 1000) -#endif - int bfin_check_emuready = 1; static struct timespec bfin_emu_wait_ts = {0, 5000000}; diff --git a/urjtag/src/svf/svf.c b/urjtag/src/svf/svf.c index 42eca2f0..ff2cec88 100644 --- a/urjtag/src/svf/svf.c +++ b/urjtag/src/svf/svf.c @@ -49,18 +49,12 @@ #include #include #include -#if defined __MINGW32__ || ! defined HAVE_SIGACTION_SA_ONESHOT #include -#endif #include "svf.h" #include "svf_bison.h" -#ifdef __MINGW32__ -#include -#endif - /* CHAIN_CLOCK defines the clock function of the chain API that's deployed for non-timing critical, deferable "chain clocking". @@ -635,7 +629,7 @@ urj_svf_hxr (enum generic_irdr_coding ir_dr, struct ths_params *params) return URJ_STATUS_OK; } -#if ! (defined __MINGW32__ || ! defined HAVE_SIGACTION_SA_ONESHOT) +#ifdef HAVE_SIGACTION_SA_ONESHOT static int max_time_reached; static void sigalrm_handler (int signal) @@ -725,7 +719,7 @@ urj_svf_runtest (urj_chain_t *chain, urj_svf_parser_priv_t *priv, urj_svf_goto_state (chain, priv->runtest_run_state); -#if defined __MINGW32__ || ! defined HAVE_SIGACTION_SA_ONESHOT +#ifndef HAVE_SIGACTION_SA_ONESHOT if (params->max_time > 0.0) { double maxt = urj_lib_frealtime () + params->max_time; diff --git a/urjtag/src/tap/parport/ppdev.c b/urjtag/src/tap/parport/ppdev.c index eb61be27..b6078478 100644 --- a/urjtag/src/tap/parport/ppdev.c +++ b/urjtag/src/tap/parport/ppdev.c @@ -27,10 +27,8 @@ #include #include -#ifdef HAVE_STROPTS_H -#include -#endif #include +#include #include #include diff --git a/urjtag/src/tap/usbconn/libftd2xx.c b/urjtag/src/tap/usbconn/libftd2xx.c index b800cbc5..38c96f5e 100644 --- a/urjtag/src/tap/usbconn/libftd2xx.c +++ b/urjtag/src/tap/usbconn/libftd2xx.c @@ -25,14 +25,8 @@ #include #include -#if __CYGWIN__ || __MINGW32__ -#include -#endif #include #include -#ifdef HAVE_STROPTS_H -#include -#endif #include #include #include diff --git a/urjtag/src/tap/usbconn/libftdi.c b/urjtag/src/tap/usbconn/libftdi.c index b3f23be6..86a2d9aa 100644 --- a/urjtag/src/tap/usbconn/libftdi.c +++ b/urjtag/src/tap/usbconn/libftdi.c @@ -25,14 +25,8 @@ #include #include -#if __CYGWIN__ || __MINGW32__ -#include -#endif #include #include -#ifdef HAVE_STROPTS_H -#include -#endif #include #include #include diff --git a/urjtag/src/tap/usbconn/libusb.c b/urjtag/src/tap/usbconn/libusb.c index d4131cf5..edc1b3e2 100644 --- a/urjtag/src/tap/usbconn/libusb.c +++ b/urjtag/src/tap/usbconn/libusb.c @@ -27,14 +27,8 @@ #include #include -#if __CYGWIN__ || __MINGW32__ -#include -#endif #include #include -#ifdef HAVE_STROPTS_H -#include -#endif #include #include #include diff --git a/urjtag/sysdep.h b/urjtag/sysdep.h index a31a4650..6ed604d7 100644 --- a/urjtag/sysdep.h +++ b/urjtag/sysdep.h @@ -43,6 +43,10 @@ #define ngettext(s,p,n) s #endif +#if __CYGWIN__ +#include +#endif + #ifdef __MINGW32__ /* Diff versions of mingw used slightly different names */ #define NO_W32_PSEUDO_MODIFIERS @@ -53,10 +57,19 @@ /* Microsoft uses a different swprintf() than ISO C requires */ #include #define swprintf _snwprintf +/* No perms to give to mkdir */ +#include +#define mkdir(path, mode) mkdir(path) #endif #ifndef HAVE_USLEEP int usleep (long unsigned usec); #endif +#ifndef HAVE_NANOSLEEP +#include +struct timespec { unsigned long tv_sec, tv_nsec; }; +#define nanosleep(req, rem) usleep((req)->tv_sec * 1000 * 1000 + (req)->tv_nsec / 1000) +#endif + #endif /* SYSDEP_H */