Changeset 5480:045af2045a6d in roaraudio
- Timestamp:
- 04/23/12 13:03:59 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/vio_stdvios.c
r5479 r5480 69 69 }; 70 70 71 #ifndef ROAR_TARGET_WIN32 71 72 struct roar_vio_calls * roar_stdin = &(_libroar_vio_stdvios[0]); 72 73 struct roar_vio_calls * roar_stdout = &(_libroar_vio_stdvios[1]); 73 74 struct roar_vio_calls * roar_stderr = &(_libroar_vio_stdvios[2]); 75 #else 76 struct 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 }; 74 82 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; 86 89 } 87 90 }
Note: See TracChangeset
for help on using the changeset viewer.