1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Changed when to enable custom baud by default

Be very conservative when enabling custom baudrate
support (USE_CUSTOM_BAUD) by default. Only enable (by default) on
systems where we know it will cause no problems. For other systems the
user can try to enable it explicitly (see Makefile).

Currently enabled by default on:

  Linux, Kernel verison > 2.6.0, x86 and x86_64 architectures
  FreeBSD, OpenBSD, NetBSD, DragonFly BSD
This commit is contained in:
Nick Patavalis
2018-01-17 19:48:14 +02:00
parent 8f3cdcb0b0
commit 55b7019934
2 changed files with 17 additions and 4 deletions

View File

@ -30,6 +30,7 @@
#if defined (__linux__)
/* Enable by-default for kernels > 2.6.0 on x86 and x86_64 only */
#include <linux/version.h>
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
#if defined (__x86__) || defined (__x86_64__) || defined (USE_CUSTOM_BAUD)
@ -40,9 +41,20 @@
#endif /* of arch */
#endif /* of version */
#elif defined (__FreeBSD__) || defined (__OpenBSD__) || \
defined (__DragonFly__) || defined (__APPLE__)
#elif defined (__APPLE__)
/* ?? Maybe enable by-default for specific versions ?? */
#define CUSTOM_BAUD_HEAD "custbaud_bsd.h"
#elif defined (__NetBSD__)
/* Do not enable by default */
#define CUSTOM_BAUD_HEAD "custbaud_bsd.h"
#elif defined (__FreeBSD__) || defined (__OpenBSD__) || \
defined (__DragonFly__)
/* I believe it doesn't hurt to enable by-default for these */
#ifndef USE_CUSTOM_BAUD
#define USE_CUSTOM_BAUD
#endif

View File

@ -42,8 +42,9 @@
/* Note that this code might also work with other BSD variants, but I have only
* tested with those listed below. Also tested __NetBSD__ but won't work. */
#if (defined (__FreeBSD__) || defined (__OpenBSD__) || \
defined (__DragonFly__) || defined (__APPLE__)) && \
#if (defined (__FreeBSD__) || defined (__NetBSD__) || \
defined (__OpenBSD__) || defined (__DragonFly__) || \
defined (__APPLE__)) && \
defined (USE_CUSTOM_BAUD)
#include "custbaud_bsd.h"