VirtualBox

Ignore:
Timestamp:
Nov 6, 2023 3:25:18 PM (15 months ago)
Author:
vboxsync
Message:

libs/xpcom: Remove unused code from nsprpub, bugref:10545

Location:
trunk/src/libs/xpcom18a4/nsprpub/pr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/pprthred.h

    r101776 r101877  
    8484#define PR_OS2_SetFloatExcpHandler VBoxNsprPR_OS2_SetFloatExcpHandler
    8585#define PR_OS2_UnsetFloatExcpHandler VBoxNsprPR_OS2_UnsetFloatExcpHandler
    86 #define PR_XLock VBoxNsprPR_XLock
    87 #define PR_XUnlock VBoxNsprPR_XUnlock
    88 #define PR_XIsLocked VBoxNsprPR_XIsLocked
    89 #define PR_XWait VBoxNsprPR_XWait
    90 #define PR_XNotify VBoxNsprPR_XNotify
    91 #define PR_XNotifyAll VBoxNsprPR_XNotifyAll
    9286#endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
    9387
     
    311305#define PR_InMonitor(m)         (PR_GetMonitorEntryCount(m) > 0)
    312306
    313 /*---------------------------------------------------------------------------
    314 ** Special X-Lock hack for client
    315 ---------------------------------------------------------------------------*/
    316 
    317 #ifdef XP_UNIX
    318 extern void PR_XLock(void);
    319 extern void PR_XUnlock(void);
    320 extern PRBool PR_XIsLocked(void);
    321 #endif /* XP_UNIX */
    322 
    323307PR_END_EXTERN_C
    324308
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/unix/unix.c

    r101874 r101877  
    9595*/
    9696static PRLock *_pr_rename_lock = NULL;
    97 static PRMonitor *_pr_Xfe_mon = NULL;
    9897
    9998static PRInt64 minus_one;
     
    468467*/
    469468
    470 #if defined(SOLARIS2_5)
    471 
    472 static PRIntn _MD_solaris25_fstat64(PRIntn osfd, _MDStat64 *buf)
    473 {
    474     PRInt32 rv;
    475     struct stat sb;
    476 
    477     rv = fstat(osfd, &sb);
    478     if (rv >= 0)
    479     {
    480         /*
    481         ** I'm only copying the fields that are immediately needed.
    482         ** If somebody else calls this function, some of the fields
    483         ** may not be defined.
    484         */
    485         (void)memset(buf, 0, sizeof(_MDStat64));
    486         buf->st_mode = sb.st_mode;
    487         buf->st_ctim = sb.st_ctim;
    488         buf->st_mtim = sb.st_mtim;
    489         buf->st_size = sb.st_size;
    490     }
    491     return rv;
    492 }  /* _MD_solaris25_fstat64 */
    493 
    494 static PRIntn _MD_solaris25_stat64(const char *fn, _MDStat64 *buf)
    495 {
    496     PRInt32 rv;
    497     struct stat sb;
    498 
    499     rv = stat(fn, &sb);
    500     if (rv >= 0)
    501     {
    502         /*
    503         ** I'm only copying the fields that are immediately needed.
    504         ** If somebody else calls this function, some of the fields
    505         ** may not be defined.
    506         */
    507         (void)memset(buf, 0, sizeof(_MDStat64));
    508         buf->st_mode = sb.st_mode;
    509         buf->st_ctim = sb.st_ctim;
    510         buf->st_mtim = sb.st_mtim;
    511         buf->st_size = sb.st_size;
    512     }
    513     return rv;
    514 }  /* _MD_solaris25_stat64 */
    515 #endif /* defined(SOLARIS2_5) */
    516 
    517 #if defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5)
     469#if defined(_PR_NO_LARGE_FILES)
    518470
    519471static PROffset64 _MD_Unix_lseek64(PRIntn osfd, PROffset64 offset, PRIntn whence)
     
    539491    return NULL;
    540492}  /* _MD_Unix_mmap64 */
    541 #endif /* defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5) */
    542 
    543 #if defined(OSF1) && defined(__GNUC__)
    544 
    545 /*
    546  * On OSF1 V5.0A, <sys/stat.h> defines stat and fstat as
    547  * macros when compiled under gcc, so it is rather tricky to
    548  * take the addresses of the real functions the macros expend
    549  * to.  A simple solution is to define forwarder functions
    550  * and take the addresses of the forwarder functions instead.
    551  */
    552 
    553 static int stat_forwarder(const char *path, struct stat *buffer)
    554 {
    555     return stat(path, buffer);
    556 }
    557 
    558 static int fstat_forwarder(int filedes, struct stat *buffer)
    559 {
    560     return fstat(filedes, buffer);
    561 }
    562 
    563 #endif
     493#endif /* defined(_PR_NO_LARGE_FILES) */
    564494
    565495static void _PR_InitIOV(void)
    566496{
    567 #if defined(SOLARIS2_5)
    568     PRLibrary *lib;
    569     void *open64_func;
    570 
    571     open64_func = PR_FindSymbolAndLibrary("open64", &lib);
    572     if (NULL != open64_func)
    573     {
    574         PR_ASSERT(NULL != lib);
    575         _md_iovector._open64 = (_MD_Open64)open64_func;
    576         _md_iovector._mmap64 = (_MD_Mmap64)PR_FindSymbol(lib, "mmap64");
    577         _md_iovector._fstat64 = (_MD_Fstat64)PR_FindSymbol(lib, "fstat64");
    578         _md_iovector._stat64 = (_MD_Stat64)PR_FindSymbol(lib, "stat64");
    579         _md_iovector._lseek64 = (_MD_Lseek64)PR_FindSymbol(lib, "lseek64");
    580         (void)PR_UnloadLibrary(lib);
    581     }
    582     else
    583     {
    584         _md_iovector._open64 = open;
    585         _md_iovector._mmap64 = _MD_Unix_mmap64;
    586         _md_iovector._fstat64 = _MD_solaris25_fstat64;
    587         _md_iovector._stat64 = _MD_solaris25_stat64;
    588         _md_iovector._lseek64 = _MD_Unix_lseek64;
    589     }
    590 #elif defined(_PR_NO_LARGE_FILES)
     497#if defined(_PR_NO_LARGE_FILES)
    591498    _md_iovector._open64 = open;
    592499    _md_iovector._mmap64 = _MD_Unix_mmap64;
     
    595502    _md_iovector._lseek64 = _MD_Unix_lseek64;
    596503#elif defined(_PR_HAVE_OFF64_T)
    597 #if defined(IRIX5_3)
    598     _md_iovector._open64 = open;
    599 #else
    600504    _md_iovector._open64 = open64;
    601 #endif
    602505    _md_iovector._mmap64 = mmap64;
    603506    _md_iovector._fstat64 = fstat64;
     
    607510    _md_iovector._open64 = open;
    608511    _md_iovector._mmap64 = mmap;
    609 #if defined(OSF1) && defined(__GNUC__)
    610     _md_iovector._fstat64 = fstat_forwarder;
    611     _md_iovector._stat64 = stat_forwarder;
    612 #else
    613512    _md_iovector._fstat64 = fstat;
    614513    _md_iovector._stat64 = stat;
    615 #endif
    616514    _md_iovector._lseek64 = lseek;
    617515#else
     
    636534    _pr_rename_lock = PR_NewLock();
    637535    PR_ASSERT(NULL != _pr_rename_lock);
    638     _pr_Xfe_mon = PR_NewMonitor();
    639     PR_ASSERT(NULL != _pr_Xfe_mon);
    640 #ifdef VBOX
    641     RTMEM_MAY_LEAK(_pr_rename_lock);
    642     RTMEM_MAY_LEAK(_pr_Xfe_mon);
    643 #endif
    644536
    645537    _PR_InitIOV();  /* one last hack */
     
    711603
    712604/************************************************************************/
    713 
    714 /*
    715 ** Special hacks for xlib. Xlib/Xt/Xm is not re-entrant nor is it thread
    716 ** safe.  Unfortunately, neither is mozilla. To make these programs work
    717 ** in a pre-emptive threaded environment, we need to use a lock.
    718 */
    719 
    720 void PR_XLock(void)
    721 {
    722     PR_EnterMonitor(_pr_Xfe_mon);
    723 }
    724 
    725 void PR_XUnlock(void)
    726 {
    727     PR_ExitMonitor(_pr_Xfe_mon);
    728 }
    729 
    730 PRBool PR_XIsLocked(void)
    731 {
    732     return (PR_InMonitor(_pr_Xfe_mon)) ? PR_TRUE : PR_FALSE;
    733 }
    734 
    735 void PR_XWait(int ms)
    736 {
    737     PR_Wait(_pr_Xfe_mon, PR_MillisecondsToInterval(ms));
    738 }
    739 
    740 void PR_XNotify(void)
    741 {
    742     PR_Notify(_pr_Xfe_mon);
    743 }
    744 
    745 void PR_XNotifyAll(void)
    746 {
    747     PR_NotifyAll(_pr_Xfe_mon);
    748 }
    749605
    750606PR_IMPLEMENT(PRStatus) _MD_gethostname(char *name, PRUint32 namelen)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette