Changeset 5480:045af2045a6d in roaraudio


Ignore:
Timestamp:
04/23/12 13:03:59 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

corrected win32 fix for stdvios

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_stdvios.c

    r5479 r5480  
    6969}; 
    7070 
     71#ifndef ROAR_TARGET_WIN32 
    7172struct roar_vio_calls * roar_stdin  = &(_libroar_vio_stdvios[0]); 
    7273struct roar_vio_calls * roar_stdout = &(_libroar_vio_stdvios[1]); 
    7374struct roar_vio_calls * roar_stderr = &(_libroar_vio_stdvios[2]); 
     75#else 
     76struct roar_vio_calls ** libroar_stdvio_win32workaround(int fh) { 
     77 static struct roar_vio_calls * vios[3] = { 
     78  &(_libroar_vio_stdvios[0]), 
     79  &(_libroar_vio_stdvios[1]), 
     80  &(_libroar_vio_stdvios[2]) 
     81 }; 
    7482 
    75 #ifdef ROAR_TARGET_WIN32 
    76 struct 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; 
     83 if ( fh >= 0 && fh <= 2) { 
     84  return &(vios[fh]); 
     85 } else { 
     86  roar_strap(ROAR_TRAP_GROUP_LIBROAR, "libroar_stdvio_win32workaround.bad-fh"); 
     87  roar_err_set(ROAR_ERROR_BADFH); // just in case somebody uses a debugger. 
     88  return NULL; 
    8689 } 
    8790} 
Note: See TracChangeset for help on using the changeset viewer.