Commit Graph

23 Commits

Author SHA1 Message Date
Martin Ling 6c8115820d Linux: fix for alpha where BOTHER is not defined.
Fixes bug #363.
2017-03-19 12:16:49 +00:00
Wolfram Sang 4d8195fe3f libserialport_internal: use new macro to enable timeradd, etc.
Since glibc 2.20, the usage of _BSD_SOURCE is deprecated. Fix it like
described here:

https://sourceware.org/glibc/wiki/Release/2.20#Deprecation_of__BSD_SOURCE_and__SVID_SOURCE_feature_macros

This fixes bug #716.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2015-12-29 01:16:28 +01:00
Martin Ling 127d8d0ce7 sp_wait: Avoid overflow of timeout parameter to poll(). 2015-10-13 15:04:03 +01:00
Daniel Elstner 1a584c45b0 Build: Include config.h first in all source files 2015-09-13 20:04:31 +02:00
Daniel Elstner f1c916ede1 Build: Clean up configure.ac and Makefile.am
Among other things, rename some config defines so we can take
advantage of standard Autoconf macros.
2015-08-26 21:55:10 +02:00
Uwe Hermann 613c48f191 Fix a compiler warning when -Wshadow is used.
CC       serialport.lo
  In file included from ../serialport.c:25:0:
  ../serialport.c: In function 'get_config':
  ../libserialport_internal.h:227:25: warning: declaration of 'ret' shadows a previous local [-Wshadow]
   #define TRY(x) do { int ret = x; if (ret != SP_OK) RETURN_CODEVAL(ret); } while (0)
                           ^
  ../serialport.c:1566:3: note: in expansion of macro 'TRY'
     TRY(get_baudrate(port->fd, &config->baudrate));
     ^
  ../serialport.c:1543:6: warning: shadowed declaration is here [-Wshadow]
    int ret = get_flow(port->fd, data);
        ^

Also, add -Wshadow to the list of default compiler options.
2015-04-18 21:54:42 +02:00
Uwe Hermann e019e72ec0 Fix a compiler warning.
This fixes the following scan-build warning:

  serialport.c: In function 'sp_list_ports':
  serialport.c:354:1: warning: control reaches end of non-void function [-Wreturn-type]
2015-04-03 20:50:22 +02:00
Uwe Hermann b344a40bb2 Fix indentation of a switch(). 2015-04-03 17:51:47 +02:00
Martin Ling 47fcf8ec85 windows: Revise management of WaitCommEvent() operations.
This fixes (at least parts of) bug #341.
2015-03-29 22:18:46 +02:00
Uwe Hermann 6c6aebe78c Make std_baudrates[] static (only used in one file). 2015-03-26 23:57:56 +01:00
Uwe Hermann dc422c04af Various cosmetic and consistency fixes. 2015-03-26 23:57:56 +01:00
Uwe Hermann 2b40f81454 libserialport_internal.h: Add #include guard. 2015-03-26 23:57:56 +01:00
Martin Ling 7c081505e5 Generate a config.h rather than passing defines on command line.
Fixes bug #553.
2015-03-24 23:15:32 +00:00
Martin Ling 59182fbbbf linux: Check for BOTHER macro at configure time.
This fixes bug #363.
2014-11-01 18:36:09 +01:00
Martin Ling 78940e6921 windows: Fix compile issues with multiply or not defined GUIDs.
This fixes bug #416.
2014-09-25 23:04:06 +02:00
Michael B. Trausch d179da05c0 windows: Include proper GUID defining header to fix build.
The initguid.h header must appear early or it does not have
an effect, at least on cross-build from Linux.
2014-09-07 18:51:04 +02:00
Aurelien Jacobs 653cef3ab1 linux: remove readlinkat() dependency 2014-09-04 20:13:55 +02:00
Martin Ling c51b846eee linux: Define feature macros to get required functions.
This is needed to build with -std=c99.
2014-08-24 14:06:21 +01:00
Martin Ling 7890cef6cf Revise debug macros to work in strict C99. 2014-08-24 14:06:21 +01:00
Martin Ling 9caa2e86aa Specialise RETURN_VALUE macro into RETURN_{INT,STRING,POINTER}.
This avoids the need to pass the required format string on every
call and also eliminates the need for the non-standard typeof() call.
2014-08-24 13:31:20 +01:00
Aurelien Jacobs 970f279ae4 Introduce SP_API/SP_PRIV to mark visibility of functions. 2014-07-02 14:43:32 +02:00
Aurelien Jacobs 48a4076f69 Move list_ports() implementations to OS-specific files. 2014-06-14 01:28:49 +02:00
Martin Ling e33dcf90a0 Tidy up and split most OS-specific code to separate files. 2014-06-11 15:10:29 +01:00