Changeset 5479:a6348edc217a in roaraudio


Ignore:
Timestamp:
04/23/12 12:53:37 (9 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Work around bugs in win32 while using stdvios (pr0).

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5478 r5479  
    1414        * Corrected usage of -Wextra (pr0). 
    1515        * Updated build options for RAT (pr0). 
     16        * Work around bugs in win32 while using stdvios (pr0). 
    1617 
    1718v. 1.0beta0 - Fri Mar 16 2012 19:39 CET 
  • include/libroar/vio_stdvios.h

    r5381 r5479  
    3939#include "libroar.h" 
    4040 
     41#ifndef ROAR_TARGET_WIN32 
    4142extern struct roar_vio_calls * roar_stdin; 
    4243extern struct roar_vio_calls * roar_stdout; 
    4344extern struct roar_vio_calls * roar_stderr; 
     45#else 
     46struct roar_vio_calls ** libroar_stdvio_win32workaround(int fh); 
     47#define roar_stdin  (*libroar_stdvio_win32workaround(0)) 
     48#define roar_stdout (*libroar_stdvio_win32workaround(1)) 
     49#define roar_stderr (*libroar_stdvio_win32workaround(2)) 
     50#endif 
    4451 
    4552#endif 
  • libroar/vio_stdvios.c

    r5381 r5479  
    7373struct roar_vio_calls * roar_stderr = &(_libroar_vio_stdvios[2]); 
    7474 
     75#ifdef ROAR_TARGET_WIN32 
     76struct roar_vio_calls ** libroar_stdvio_win32workaround(int fh) { 
     77 switch (fh) { 
     78  case 0: return &roar_stdin;  break; 
     79  case 1: return &roar_stdout; break; 
     80  case 2: return &roar_stderr; break; 
     81  default: 
     82    roar_strap(ROAR_TRAP_GROUP_LIBROAR, "libroar_stdvio_win32workaround.bad-fh"); 
     83    roar_err_set(ROAR_ERROR_BADFH); // just in case somebody uses a debugger. 
     84    return NULL; 
     85   break; 
     86 } 
     87} 
     88#endif 
     89 
    7590//ll 
Note: See TracChangeset for help on using the changeset viewer.