Changeset 5251:9002ab4e6a86 in roaraudio


Ignore:
Timestamp:
11/13/11 15:30:25 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

improved roar_err_store() and roar_err_restore()

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/error.h

    r5216 r5251  
    6767struct roar_error_state { 
    6868 size_t refc; 
    69  int libroar_error; 
    70  int system_errno; 
     69 int libroar_error; // roar_error 
     70 int system_error; // errno 
     71#ifdef ROAR_TARGET_WIN32 
     72 int winsock_error; // WSAGetLastError(), WSASetLastError() 
     73#else 
     74 int syssock_herror; // h_errno 
     75#endif 
     76#ifdef __YIFF__ 
     77 yiffc_error_t yiffc_error; // yiffc_error 
     78#endif 
    7179}; 
    7280 
  • libroar/error.c

    r5216 r5251  
    881881 state->refc          = 0; 
    882882 state->libroar_error = roar_error; 
    883  state->system_errno  = errno; 
     883 state->system_error  = errno; 
     884 
     885#ifdef ROAR_TARGET_WIN32 
     886 state->winsock_error = WSAGetLastError(); 
     887#else 
     888 state->syssock_herror = h_errno; 
     889#endif 
     890 
     891#ifdef __YIFF__ 
     892 state->yiffc_error = yiffc_error; 
     893#endif 
    884894 
    885895 return ROAR_ERROR_NONE; 
     
    892902 
    893903 roar_err_set(state->libroar_error); 
    894  errno = state->system_errno; 
     904 errno = state->system_error; 
     905 
     906#ifdef ROAR_TARGET_WIN32 
     907 WSASetLastError(state->winsock_error); 
     908#else 
     909 h_errno = state->syssock_herror; 
     910#endif 
     911 
     912#ifdef __YIFF__ 
     913 yiffc_error = state->yiffc_error; 
     914#endif 
    895915 
    896916 return ROAR_ERROR_NONE; 
Note: See TracChangeset for help on using the changeset viewer.