Ticket #42159: patch-v3.diff

File patch-v3.diff, 2.7 KB (added by neurodroid (Christoph Schmidt-Hieber), 11 years ago)

More general patch that uses the private getline implementation only on SL and independently of MacPorts. See ticket #42152.

  • CMakeLists.txt

    diff -ur /Users/cs/biosig4c++-1.5.10/CMakeLists.txt ./CMakeLists.txt
    old new  
    77# Version number
    88set (libbiosig_VERSION_MAJOR 1)
    99set (libbiosig_VERSION_MINOR 5)
    10 set (libbiosig_VERSION_PATCH 0)
     10set (libbiosig_VERSION_PATCH 10)
    1111
    1212find_program (GAWK NAMES gawk)
    1313
     
    2323  DEPENDS units.awk extern/units.csv
    2424)
    2525
     26add_custom_target (annexb
     27  COMMAND ${GAWK} -f annotatedECG.awk extern/11073-10102-AnnexB.txt > "11073-10102-AnnexB.i"
     28  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
     29  DEPENDS annotatedECG.awk extern/11073-10102-AnnexB.txt
     30)
     31
    2632set (headers
    2733  t210/abfheadr.h
    2834  XMLParser/tinyxml.h
     
    6167  )
    6268endif ()
    6369
     70if (APPLE)
     71  list (APPEND sources
     72    win32/getdelim.c
     73    win32/getline.c
     74  )
     75endif ()
     76
    6477# Cannot have same name for static and shared library,
    6578# so we'll correct that later on
    6679add_library (biosigstatic STATIC
     
    8093     )
    8194endif ()
    8295
    83 add_dependencies (biosigstatic eventcodes units)
    84 add_dependencies (biosigshared eventcodes units)
     96add_dependencies (biosigstatic eventcodes units annexb)
     97add_dependencies (biosigshared eventcodes units annexb)
    8598
    8699if (USE_ZLIB)
    87100  add_definitions (-D=WITH_ZLIB)
  • win32/getdelim.c

    Only in ./: patch-v3.diff
    diff -ur /Users/cs/biosig4c++-1.5.10/win32/getdelim.c ./win32/getdelim.c
    old new  
    1919
    2020/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
    2121   optimizes away the lineptr == NULL || n == NULL || fp == NULL tests below.  */
     22#if !defined(__linux__) && !defined(__OpenBSD__) && !(defined(__APPLE__) && __DARWIN_C_LEVEL >= 200809L)
     23
    2224#define _GL_ARG_NONNULL(params)
    2325
    2426#include <stdio.h>
     
    2729#include <stdint.h>
    2830#include <stdlib.h>
    2931#include <errno.h>
     32#if defined(__APPLE__) && __DARWIN_C_LEVEL < 200809L
     33    #include <unistd.h>
     34#endif
    3035
    3136#ifndef SSIZE_MAX
    3237# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
     
    131136
    132137  return result;
    133138}
     139#endif
  • win32/getline.c

    diff -ur /Users/cs/biosig4c++-1.5.10/win32/getline.c ./win32/getline.c
    old new  
    1616
    1717/* Written by Simon Josefsson. */
    1818
     19#if !defined(__linux__) && !defined(__OpenBSD__) && !(defined(__APPLE__) && __DARWIN_C_LEVEL >= 200809L)
     20
    1921#include <stdio.h>
     22#if defined(__APPLE__) && __DARWIN_C_LEVEL < 200809L
     23    #include <unistd.h>
     24#endif
    2025
    2126ssize_t
    2227getline (char **lineptr, size_t *n, FILE *stream)
    2328{
    2429  return getdelim (lineptr, n, '\n', stream);
    2530}
     31#endif