/****************************************************************************
- * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <curses.priv.h>
#include <termcap.h> /* ospeed */
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#endif
* of the indices up to B115200 fit nicely in a 'short', allowing us to retain
* ospeed's type for compatibility.
*/
-#if NCURSES_OSPEED_COMPAT && ((defined(__FreeBSD__) && (__FreeBSD_version < 700000)) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__))
+#if NCURSES_OSPEED_COMPAT && \
+ ((defined(__FreeBSD__) && (__FreeBSD_version < 700000)) || \
+ defined(__NetBSD__) || \
+ ((defined(__OpenBSD__) && OpenBSD < 201510)) || \
+ defined(__APPLE__))
#undef B0
#undef B50
#undef B75
#undef USE_OLD_TTY
#endif /* USE_OLD_TTY */
-MODULE_ID("$Id: lib_baudrate.c,v 1.41 2016/08/28 00:35:00 tom Exp $")
+MODULE_ID("$Id: lib_baudrate.c,v 1.45 2020/09/05 21:15:32 tom Exp $")
/*
* int
int actual_speed; /* the actual speed */
};
+#if !defined(EXP_WIN32_DRIVER)
#define DATA(number) { B##number, number }
static struct speed const speeds[] =
#endif
#endif
};
+#endif /* !EXP_WIN32_DRIVER */
NCURSES_EXPORT(int)
_nc_baudrate(int OSpeed)
{
+#if defined(EXP_WIN32_DRIVER)
+ /* On Windows this is a noop */
+ (void) OSpeed;
+ return (OK);
+#else
#if !USE_REENTRANT
static int last_OSpeed;
static int last_baudrate;
#endif
}
return (result);
+#endif /* !EXP_WIN32_DRIVER */
}
NCURSES_EXPORT(int)
_nc_ospeed(int BaudRate)
{
int result = 1;
-
+#if defined(EXP_WIN32_DRIVER)
+ (void) BaudRate;
+#else
if (BaudRate >= 0) {
unsigned i;
}
}
}
+#endif
return (result);
}
T((T_CALLED("baudrate(%p)"), (void *) SP_PARM));
+#if defined(EXP_WIN32_DRIVER)
+ result = OK;
+#else
/*
* In debugging, allow the environment symbol to override when we're
* redirecting to a file, so we can construct repeatable test-cases
*/
#ifdef TRACE
if (IsValidTIScreen(SP_PARM)
- && !NC_ISATTY(fileno(SP_PARM ? SP_PARM->_ofp : stdout))
+ && !NC_ISATTY(fileno((SP_PARM && SP_PARM->_ofp) ? SP_PARM->_ofp : stdout))
&& getenv("BAUDRATE") != 0) {
int ret;
if ((ret = _nc_getenv_num("BAUDRATE")) <= 0)
} else {
result = ERR;
}
-
+#endif /* !EXP_WIN32_DRIVER */
returnCode(result);
}