Changeset 3169:686441722100 in roaraudio


Ignore:
Timestamp:
01/15/10 19:47:54 (10 years ago)
Author:
phi
Branch:
default
Message:

ioctl() prototype depends on OS, test and use correct one

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroaross/libroaross.c

    r3168 r3169  
    7676#endif 
    7777 
     78#ifdef ROAR_OS_NETBSD 
     79#define IOCTL() int _oss_ioctl __P((int fd, unsigned long com, void *argp)) 
     80#define map_args int __fd = fd; unsigned long int __request = request; 
     81#else 
     82#define IOCTL() int ioctl (int __fd, unsigned long int __request, ...) 
     83#define map_args void * argp; 
     84#define va_argp 
     85#endif 
     86 
    7887#define OSS_VOLUME_SCALE 100 
    7988 
     
    750759} 
    751760 
    752 int ioctl (int __fd, unsigned long int __request, ...) { 
     761IOCTL() { 
     762 map_args; 
    753763 struct pointer * pointer; 
    754764 struct handle  * handle; 
     765 int * ip = NULL; 
     766#ifdef va_argp 
    755767 va_list args; 
    756  void *argp; 
    757  int * ip = NULL; 
     768#endif 
    758769 
    759770 _init(); 
     
    761772// ROAR_DBG("ioctl(__fd=%i, __request=%lu) = ?", __fd, (long unsigned int) __request); 
    762773 
     774#ifdef va_argp 
    763775 va_start (args, __request); 
    764776 argp = va_arg (args, void *); 
    765777 va_end (args); 
     778#endif 
    766779 
    767780// ROAR_DBG("ioctl(__fd=%i, __request=%lu): argp=%p", __fd, (long unsigned int) __request, argp); 
Note: See TracChangeset for help on using the changeset viewer.