Changeset 5493:ed802d14a722 in roaraudio


Ignore:
Timestamp:
05/05/12 12:40:38 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

test for needed functions, not just fail on OpenBSD

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • configure

    r5490 r5493  
    18581858test_func_defmake ROAR_HAVE_SRAND     srand     'srand((unsigned int)0)'     -- stdlib.h 
    18591859test_func_defmake ROAR_HAVE_FCNTL     fcntl     'fcntl(0, 0)'                -- unistd.h fcntl.h 
     1860test_func_defmake ROAR_HAVE_POSIX_OPENPT posix_openpt 'posix_openpt(0)'      -- stdlib.h fcntl.h 
     1861test_func_defmake ROAR_HAVE_GRANTPT   grantpt   'grantpt(0)'                 -- stdlib.h 
     1862test_func_defmake ROAR_HAVE_UNLOCKPT  unlockpt  'unlockpt(0)'                -- stdlib.h 
     1863test_func_defmake ROAR_HAVE_TCGETATTR tcgetattr 'tcgetattr(0, (struct termios *)0)' -- termios.h unistd.h 
     1864test_func_defmake ROAR_HAVE_TCSETATTR tcsetattr 'tcsetattr(0, TCSANOW, (struct termios *)0)' -- termios.h unistd.h 
     1865test_func_defmake ROAR_HAVE_CFMAKERAW cfmakeraw 'cfmakeraw((struct termios *)0)' -- termios.h unistd.h 
    18601866test_func_defmake ROAR_HAVE_REBOOT    reboot    'reboot(LINUX_REBOOT_CMD_RESTART|LINUX_REBOOT_CMD_HALT|LINUX_REBOOT_CMD_POWER_OFF|LINUX_REBOOT_CMD_CAD_ON|LINUX_REBOOT_CMD_CAD_OFF)' -- unistd.h linux/reboot.h sys/reboot.h 
    18611867test_func_defmake ROAR_HAVE_LINUX_SENDFILE sendfile 'sendfile(-1, -1, (void*)0, 0)' -- sys/sendfile.h 
  • plugins/roard/listenpty.c

    r5434 r5493  
    2525 
    2626#include <roard/include/roard.h> 
     27 
     28#if defined(ROAR_HAVE_POSIX_OPENPT) && defined(ROAR_HAVE_GRANTPT) && defined(ROAR_HAVE_UNLOCKPT) && defined(ROAR_HAVE_TCGETATTR) && defined(ROAR_HAVE_TCSETATTR) && defined(ROAR_HAVE_CFMAKERAW) 
     29#define __HAVE_SUPPORT 
     30#endif 
     31 
     32#ifdef __HAVE_SUPPORT 
    2733#include <termios.h> 
     34#endif 
    2835 
    2936static int init  (struct roar_dl_librarypara * para) { 
     37#ifdef __HAVE_SUPPORT 
    3038 int serverfh = posix_openpt(O_RDWR|O_NOCTTY); 
    3139 struct termios termios; 
     
    5260 ROAR_WARN("PTY Slave: %s", ptsname(serverfh)); 
    5361 return 0; 
     62#else 
     63 ROAR_ERR("No PTY Support found so can not load listenpty plugin."); 
     64 return -1; 
     65#endif 
    5466} 
    5567 
Note: See TracChangeset for help on using the changeset viewer.