VirtualBox

Changeset 101869 in vbox


Ignore:
Timestamp:
Nov 6, 2023 1:38:17 PM (15 months ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/libs/xpcom18a4
Files:
1 deleted
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/Makefile.kmk

    r101863 r101869  
    221221NSPRPUB-OBS-HEADERS_IFFLAGS = -m 644
    222222NSPRPUB-OBS-HEADERS_SOURCES = \
    223         nsprpub/pr/include/obsolete/probslet.h \
    224         nsprpub/pr/include/obsolete/protypes.h
     223        nsprpub/pr/include/obsolete/probslet.h
    225224
    226225NSPRPUB-PRIV-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/nsprpub/private/
  • trunk/src/libs/xpcom18a4/nsprpub/lib/ds/plarena.c

    r58734 r101869  
    5353static PLArena *arena_freelist;
    5454
    55 #ifdef PL_ARENAMETER
    56 static PLArenaStats *arena_stats_list;
    57 
    58 #define COUNT(pool,what)  (pool)->stats.what++
    59 #else
    60 #define COUNT(pool,what)  /* nothing */
    61 #endif
    62 
     55#define COUNT(pool,what)
    6356#define PL_ARENA_DEFAULT_ALIGN  sizeof(double)
    6457
     
    108101    PLArenaPool *pool, const char *name, PRUint32 size, PRUint32 align)
    109102{
    110 #if defined(XP_MAC)
    111 #pragma unused (name)
    112 #endif
    113 
    114103    if (align == 0)
    115104        align = PL_ARENA_DEFAULT_ALIGN;
     
    122111        (PRUword)PL_ARENA_ALIGN(pool, &pool->first + 1);
    123112    pool->current = &pool->first;
    124     pool->arenasize = size;                                 
    125 #ifdef PL_ARENAMETER
    126     memset(&pool->stats, 0, sizeof pool->stats);
    127     pool->stats.name = strdup(name);
    128     pool->stats.next = arena_stats_list;
    129     arena_stats_list = &pool->stats;
    130 #endif
     113    pool->arenasize = size;
    131114}
    132115
     
    322305{
    323306    FreeArenaList(pool, &pool->first, PR_TRUE);
    324 #ifdef PL_ARENAMETER
    325     {
    326         PLArenaStats *stats, **statsp;
    327 
    328         if (pool->stats.name)
    329             PR_DELETE(pool->stats.name);
    330         for (statsp = &arena_stats_list; (stats = *statsp) != 0;
    331              statsp = &stats->next) {
    332             if (stats == &pool->stats) {
    333                 *statsp = stats->next;
    334                 return;
    335             }
    336         }
    337     }
    338 #endif
    339307}
    340308
    341309PR_IMPLEMENT(void) PL_CompactArenaPool(PLArenaPool *ap)
    342310{
    343 #if XP_MAC
    344 #pragma unused (ap)
    345 #if 0
    346     PRArena *curr = &(ap->first);
    347     while (curr) {
    348         reallocSmaller(curr, curr->avail - (uprword_t)curr);
    349         curr->limit = curr->avail;
    350         curr = curr->next;
    351     }
    352 #endif
    353 #endif
    354311}
    355312
     
    370327}
    371328
    372 #ifdef PL_ARENAMETER
    373 PR_IMPLEMENT(void) PL_ArenaCountAllocation(PLArenaPool *pool, PRUint32 nb)
    374 {
    375     pool->stats.nallocs++;
    376     pool->stats.nbytes += nb;
    377     if (nb > pool->stats.maxalloc)
    378         pool->stats.maxalloc = nb;
    379     pool->stats.variance += nb * nb;
    380 }
    381 
    382 PR_IMPLEMENT(void) PL_ArenaCountInplaceGrowth(
    383     PLArenaPool *pool, PRUint32 size, PRUint32 incr)
    384 {
    385     pool->stats.ninplace++;
    386 }
    387 
    388 PR_IMPLEMENT(void) PL_ArenaCountGrowth(
    389     PLArenaPool *pool, PRUint32 size, PRUint32 incr)
    390 {
    391     pool->stats.ngrows++;
    392     pool->stats.nbytes += incr;
    393     pool->stats.variance -= size * size;
    394     size += incr;
    395     if (size > pool->stats.maxalloc)
    396         pool->stats.maxalloc = size;
    397     pool->stats.variance += size * size;
    398 }
    399 
    400 PR_IMPLEMENT(void) PL_ArenaCountRelease(PLArenaPool *pool, char *mark)
    401 {
    402     pool->stats.nreleases++;
    403 }
    404 
    405 PR_IMPLEMENT(void) PL_ArenaCountRetract(PLArenaPool *pool, char *mark)
    406 {
    407     pool->stats.nfastrels++;
    408 }
    409 
    410 #include <math.h>
    411 #include <stdio.h>
    412 
    413 PR_IMPLEMENT(void) PL_DumpArenaStats(FILE *fp)
    414 {
    415     PLArenaStats *stats;
    416     double mean, variance;
    417 
    418     for (stats = arena_stats_list; stats; stats = stats->next) {
    419         if (stats->nallocs != 0) {
    420             mean = (double)stats->nbytes / stats->nallocs;
    421             variance = fabs(stats->variance / stats->nallocs - mean * mean);
    422         } else {
    423             mean = variance = 0;
    424         }
    425 
    426         fprintf(fp, "\n%s allocation statistics:\n", stats->name);
    427         fprintf(fp, "              number of arenas: %u\n", stats->narenas);
    428         fprintf(fp, "         number of allocations: %u\n", stats->nallocs);
    429         fprintf(fp, " number of free arena reclaims: %u\n", stats->nreclaims);
    430         fprintf(fp, "        number of malloc calls: %u\n", stats->nmallocs);
    431         fprintf(fp, "       number of deallocations: %u\n", stats->ndeallocs);
    432         fprintf(fp, "  number of allocation growths: %u\n", stats->ngrows);
    433         fprintf(fp, "    number of in-place growths: %u\n", stats->ninplace);
    434         fprintf(fp, "number of released allocations: %u\n", stats->nreleases);
    435         fprintf(fp, "       number of fast releases: %u\n", stats->nfastrels);
    436         fprintf(fp, "         total bytes allocated: %u\n", stats->nbytes);
    437         fprintf(fp, "          mean allocation size: %g\n", mean);
    438         fprintf(fp, "            standard deviation: %g\n", sqrt(variance));
    439         fprintf(fp, "       maximum allocation size: %u\n", stats->maxalloc);
    440     }
    441 }
    442 #endif /* PL_ARENAMETER */
  • trunk/src/libs/xpcom18a4/nsprpub/lib/ds/plarena.h

    r58734 r101869  
    6060};
    6161
    62 #ifdef PL_ARENAMETER
    63 typedef struct PLArenaStats PLArenaStats;
    64 
    65 struct PLArenaStats {
    66     PLArenaStats  *next;        /* next in arenaStats list */
    67     char          *name;        /* name for debugging */
    68     PRUint32      narenas;      /* number of arenas in pool */
    69     PRUint32      nallocs;      /* number of PL_ARENA_ALLOCATE() calls */
    70     PRUint32      nreclaims;    /* number of reclaims from freeArenas */
    71     PRUint32      nmallocs;     /* number of malloc() calls */
    72     PRUint32      ndeallocs;    /* number of lifetime deallocations */
    73     PRUint32      ngrows;       /* number of PL_ARENA_GROW() calls */
    74     PRUint32      ninplace;     /* number of in-place growths */
    75     PRUint32      nreleases;    /* number of PL_ARENA_RELEASE() calls */
    76     PRUint32      nfastrels;    /* number of "fast path" releases */
    77     PRUint32      nbytes;       /* total bytes allocated */
    78     PRUint32      maxalloc;     /* maximum allocation size in bytes */
    79     PRFloat64     variance;     /* size variance accumulator */
    80 };
    81 #endif
    82 
    8362struct PLArenaPool {
    8463    PLArena     first;          /* first arena in pool list */
     
    8665    PRUint32    arenasize;      /* net exact size of a new arena */
    8766    PRUword     mask;           /* alignment mask (power-of-2 - 1) */
    88 #ifdef PL_ARENAMETER
    89     PLArenaStats stats;
    90 #endif
    9167};
    9268
     
    171147    PR_END_MACRO
    172148
    173 #ifdef PL_ARENAMETER
    174 #define PL_COUNT_ARENA(pool,op) ((pool)->stats.narenas op)
    175 #else
    176149#define PL_COUNT_ARENA(pool,op)
    177 #endif
    178150
    179151#define PL_ARENA_DESTROY(pool, a, pnext) \
     
    187159    PR_END_MACRO
    188160
    189 #ifdef PL_ARENAMETER
    190 
    191 #include <stdio.h>
    192 
    193 PR_EXTERN(void) PL_ArenaCountAllocation(PLArenaPool *pool, PRUint32 nb);
    194 
    195 PR_EXTERN(void) PL_ArenaCountInplaceGrowth(
    196     PLArenaPool *pool, PRUint32 size, PRUint32 incr);
    197 
    198 PR_EXTERN(void) PL_ArenaCountGrowth(
    199     PLArenaPool *pool, PRUint32 size, PRUint32 incr);
    200 
    201 PR_EXTERN(void) PL_ArenaCountRelease(PLArenaPool *pool, char *mark);
    202 
    203 PR_EXTERN(void) PL_ArenaCountRetract(PLArenaPool *pool, char *mark);
    204 
    205 PR_EXTERN(void) PL_DumpArenaStats(FILE *fp);
    206 
    207 #else  /* !PL_ARENAMETER */
    208 
    209161#define PL_ArenaCountAllocation(ap, nb)                 /* nothing */
    210162#define PL_ArenaCountInplaceGrowth(ap, size, incr)      /* nothing */
     
    213165#define PL_ArenaCountRetract(ap, mark)                  /* nothing */
    214166
    215 #endif /* !PL_ARENAMETER */
    216 
    217167PR_END_EXTERN_C
    218168
  • trunk/src/libs/xpcom18a4/nsprpub/lib/ds/plarenas.h

    r11551 r101869  
    5656
    5757/*
    58 ** Allocate an arena pool as specified by the parameters.
    59 **
    60 ** This is equivelant to allocating the space yourself and then
    61 ** calling PL_InitArenaPool().
    62 **
    63 ** This function may fail (and return a NULL) for a variety of
    64 ** reasons. The reason for a particular failure can be discovered
    65 ** by calling PR_GetError().
    66 */
    67 #if 0  /* Not implemented */
    68 PR_EXTERN(PLArenaPool*) PL_AllocArenaPool(
    69     const char *name, PRUint32 size, PRUint32 align);
    70 #endif
    71 
    72 /*
    73 ** Destroy an arena pool previously allocated by PL_AllocArenaPool().
    74 **
    75 ** This function may fail if the arena is not empty and the caller
    76 ** wishes to check for empty upon descruction.
    77 */
    78 #if 0  /* Not implemented */
    79 PR_EXTERN(PRStatus) PL_DestroyArenaPool(PLArenaPool *pool, PRBool checkEmpty);
    80 #endif
    81 
    82 
    83 /*
    8458** Initialize an arena pool with the given name for debugging and metering,
    8559** with a minimum size per arena of size bytes.
  • trunk/src/libs/xpcom18a4/nsprpub/lib/ds/plhash.c

    r1 r101869  
    6666DefaultAllocTable(void *pool, PRSize size)
    6767{
    68 #if defined(XP_MAC)
    69 #pragma unused (pool)
    70 #endif
    71 
    7268    return PR_MALLOC(size);
    7369}
     
    7672DefaultFreeTable(void *pool, void *item)
    7773{
    78 #if defined(XP_MAC)
    79 #pragma unused (pool)
    80 #endif
    81 
    8274    PR_Free(item);
    8375}
     
    8678DefaultAllocEntry(void *pool, const void *key)
    8779{
    88 #if defined(XP_MAC)
    89 #pragma unused (pool,key)
    90 #endif
    91 
    9280    return PR_NEW(PLHashEntry);
    9381}
     
    9684DefaultFreeEntry(void *pool, PLHashEntry *he, PRUintn flag)
    9785{
    98 #if defined(XP_MAC)
    99 #pragma unused (pool)
    100 #endif
    101 
    10286    if (flag == HT_FREE_ENTRY)
    10387        PR_Free(he);
     
    133117    ht->shift = PL_HASH_BITS - n;
    134118    n = 1 << n;
    135 #if defined(WIN16)
    136     if (n > 16000) {
    137         (*allocOps->freeTable)(allocPriv, ht);
    138         return 0;
    139     }
    140 #endif  /* WIN16 */
     119
    141120    nb = n * sizeof(PLHashEntry *);
    142121    ht->buckets = (PLHashEntry**)((*allocOps->allocTable)(allocPriv, nb));
     
    191170    PLHashNumber h;
    192171
    193 #ifdef HASHMETER
    194     ht->nlookups++;
    195 #endif
    196172    h = keyHash * GOLDEN_RATIO;
    197173    h >>= ht->shift;
     
    208184        }
    209185        hep = &he->next;
    210 #ifdef HASHMETER
    211         ht->nsteps++;
    212 #endif
    213186    }
    214187    return hep;
     
    225198    PLHashNumber h;
    226199
    227 #ifdef HASHMETER
    228     ht->nlookups++;
    229 #endif
    230200    h = keyHash * GOLDEN_RATIO;
    231201    h >>= ht->shift;
     
    236206        }
    237207        hep = &he->next;
    238 #ifdef HASHMETER
    239         ht->nsteps++;
    240 #endif
    241208    }
    242209    return hep;
     
    255222    if (ht->nentries >= OVERLOADED(n)) {
    256223        oldbuckets = ht->buckets;
    257 #if defined(WIN16)
    258         if (2 * n > 16000)
    259             return 0;
    260 #endif  /* WIN16 */
     224
    261225        nb = 2 * n * sizeof(PLHashEntry *);
    262226        ht->buckets = (PLHashEntry**)
     
    267231        }
    268232        memset(ht->buckets, 0, nb);
    269 #ifdef HASHMETER
    270         ht->ngrows++;
    271 #endif
    272233        ht->shift--;
    273234
     
    345306        }
    346307        memset(ht->buckets, 0, nb);
    347 #ifdef HASHMETER
    348         ht->nshrinks++;
    349 #endif
    350308        ht->shift++;
    351309
     
    455413}
    456414
    457 #ifdef HASHMETER
    458 #include <math.h>
    459 #include <stdio.h>
    460 
    461 PR_IMPLEMENT(void)
    462 PL_HashTableDumpMeter(PLHashTable *ht, PLHashEnumerator dump, FILE *fp)
    463 {
    464     double mean, variance;
    465     PRUint32 nchains, nbuckets;
    466     PRUint32 i, n, maxChain, maxChainLen;
    467     PLHashEntry *he;
    468 
    469     variance = 0;
    470     nchains = 0;
    471     maxChainLen = 0;
    472     nbuckets = NBUCKETS(ht);
    473     for (i = 0; i < nbuckets; i++) {
    474         he = ht->buckets[i];
    475         if (!he)
    476             continue;
    477         nchains++;
    478         for (n = 0; he; he = he->next)
    479             n++;
    480         variance += n * n;
    481         if (n > maxChainLen) {
    482             maxChainLen = n;
    483             maxChain = i;
    484         }
    485     }
    486     mean = (double)ht->nentries / nchains;
    487     variance = fabs(variance / nchains - mean * mean);
    488 
    489     fprintf(fp, "\nHash table statistics:\n");
    490     fprintf(fp, "     number of lookups: %u\n", ht->nlookups);
    491     fprintf(fp, "     number of entries: %u\n", ht->nentries);
    492     fprintf(fp, "       number of grows: %u\n", ht->ngrows);
    493     fprintf(fp, "     number of shrinks: %u\n", ht->nshrinks);
    494     fprintf(fp, "   mean steps per hash: %g\n", (double)ht->nsteps
    495                                                 / ht->nlookups);
    496     fprintf(fp, "mean hash chain length: %g\n", mean);
    497     fprintf(fp, "    standard deviation: %g\n", sqrt(variance));
    498     fprintf(fp, " max hash chain length: %u\n", maxChainLen);
    499     fprintf(fp, "        max hash chain: [%u]\n", maxChain);
    500 
    501     for (he = ht->buckets[maxChain], i = 0; he; he = he->next, i++)
    502         if ((*dump)(he, i, fp) != HT_ENUMERATE_NEXT)
    503             break;
    504 }
    505 #endif /* HASHMETER */
    506 
    507415PR_IMPLEMENT(int)
    508416PL_HashTableDump(PLHashTable *ht, PLHashEnumerator dump, FILE *fp)
     
    511419
    512420    count = PL_HashTableEnumerateEntries(ht, dump, fp);
    513 #ifdef HASHMETER
    514     PL_HashTableDumpMeter(ht, dump, fp);
    515 #endif
    516421    return count;
    517422}
  • trunk/src/libs/xpcom18a4/nsprpub/lib/ds/plhash.h

    r11551 r101869  
    7070typedef PLHashNumber (PR_CALLBACK *PLHashFunction)(const void *key);
    7171typedef PRIntn (PR_CALLBACK *PLHashComparator)(const void *v1, const void *v2);
    72 
    73 #if defined(XP_OS2_VACPP) && defined(VACPP_FLIP) /* for nsSpaceManager.cpp */
    74 PR_END_EXTERN_C                                  /* and nsHTMLDocument.cpp */
    75 #endif
    7672typedef PRIntn (PR_CALLBACK *PLHashEnumerator)(PLHashEntry *he, PRIntn i, void *arg);
    77 
    78 #if defined(XP_OS2_VACPP) && defined(VACPP_FLIP)
    79 PR_BEGIN_EXTERN_C
    80 #endif
    8173
    8274/* Flag bits in PLHashEnumerator's return value */
     
    112104    const PLHashAllocOps *allocOps;     /* allocation operations */
    113105    void                *allocPriv;     /* allocation private data */
    114 #ifdef HASHMETER
    115     PRUint32              nlookups;       /* total number of lookups */
    116     PRUint32              nsteps;         /* number of hash chains traversed */
    117     PRUint32              ngrows;         /* number of table expansions */
    118     PRUint32              nshrinks;       /* number of table contractions */
    119 #endif
    120106};
    121107
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/prosdep.h

    r46043 r101869  
    4646PR_BEGIN_EXTERN_C
    4747
    48 #ifdef XP_PC
     48#if defined(XP_UNIX)
    4949
    50 #include "md/_pcos.h"
    51 #ifdef WINNT
    52 #include "md/_winnt.h"
    53 #include "md/_win32_errors.h"
    54 #elif defined(WIN95)
    55 #include "md/_win95.h"
    56 #include "md/_win32_errors.h"
    57 #elif defined(WIN16)
    58 #include "md/_win16.h"
    59 #elif defined(OS2)
    60 #include "md/_os2.h"
    61 #include "md/_os2_errors.h"
    62 #else
    63 #error unknown Windows platform
    64 #endif
    65 
    66 #elif defined XP_MAC
    67 
    68 #include "_macos.h"
    69 
    70 #elif defined(XP_UNIX)
    71 
    72 #if defined(AIX)
    73 #include "md/_aix.h"
    74 
    75 #elif defined(FREEBSD)
     50#if defined(FREEBSD)
    7651#include "md/_freebsd.h"
    7752
     
    8257#include "md/_openbsd.h"
    8358
    84 #elif defined(BSDI)
    85 #include "md/_bsdi.h"
    86 
    87 #elif defined(HPUX)
    88 #include "md/_hpux.h"
    89 
    90 #elif defined(IRIX)
    91 #include "md/_irix.h"
    92 
    9359#elif defined(LINUX)
    9460#include "md/_linux.h"
    95 
    96 #elif defined(OSF1)
    97 #include "md/_osf1.h"
    9861
    9962#elif defined(DARWIN)
    10063#include "md/_darwin.h"
    10164
    102 #elif defined(NEXTSTEP)
    103 #include "md/_nextstep.h"
    104 
    10565#elif defined(SOLARIS)
    10666#include "md/_solaris.h"
    107 
    108 #elif defined(SUNOS4)
    109 #include "md/_sunos4.h"
    110 
    111 #elif defined(SNI)
    112 #include "md/_reliantunix.h"
    113 
    114 #elif defined(SONY)
    115 #include "md/_sony.h"
    116 
    117 #elif defined(NEC)
    118 #include "md/_nec.h"
    119 
    120 #elif defined(SCO)
    121 #include "md/_scoos.h"
    122 
    123 #elif defined(UNIXWARE)
    124 #include "md/_unixware.h"
    125 
    126 #elif defined(NCR)
    127 #include "md/_ncr.h"
    128 
    129 #elif defined(DGUX)
    130 #include "md/_dgux.h"
    131 
    132 #elif defined(QNX)
    133 #include "md/_qnx.h"
    134 
    135 #elif defined(VMS)
    136 #include "md/_openvms.h"
    137 
    138 #elif defined(NTO)
    139 #include "md/_nto.h"
    14067
    14168#else
     
    14572
    14673#include "md/_unixos.h"
    147 #include "md/_unix_errors.h"
    148 
    149 #elif defined(XP_BEOS)
    150 
    151 #include "md/_beos.h"
    15274#include "md/_unix_errors.h"
    15375
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/obsolete/probslet.h

    r11551 r101869  
    173173
    174174#ifndef NO_NSPR_10_SUPPORT
    175 #ifdef XP_MAC
    176 #include <stat.h>
    177 #else
    178175#include <sys/stat.h>
    179 #endif
    180176
    181177NSPR_API(PRInt32) PR_Stat(const char *path, struct stat *buf);
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/prenv.h

    r11551 r101869  
    151151NSPR_API(PRStatus) PR_SetEnv(const char *string);
    152152
    153 /*
    154 ** DEPRECATED.  Use PR_SetEnv() instead.
    155 */
    156 #ifdef XP_MAC
    157 NSPR_API(PRIntn) PR_PutEnv(const char *string);
    158 #endif
    159 
    160153PR_END_EXTERN_C
    161154
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/prinet.h

    r1 r101869  
    6060#define prinet_h__
    6161
    62 #if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS)
     62#if defined(XP_UNIX)
    6363#ifdef LINUX
    6464#undef __STRICT_ANSI__
     
    6868#include <sys/socket.h>         /* AF_INET */
    6969#include <netinet/in.h>         /* INADDR_ANY, ..., ntohl(), ... */
    70 #ifdef XP_OS2
    71 #include <sys/ioctl.h>
    72 #endif
    73 #ifdef XP_UNIX
    74 #ifdef AIX
    75 /*
    76  * On AIX 4.3, the header <arpa/inet.h> refers to struct
    77  * ether_addr and struct sockaddr_dl that are not declared.
    78  * The following struct declarations eliminate the compiler
    79  * warnings.
    80  */
    81 struct ether_addr;
    82 struct sockaddr_dl;
    83 #endif /* AIX */
    8470#include <arpa/inet.h>
    85 #endif /* XP_UNIX */
    8671#include <netdb.h>
    8772
    88 #if defined(FREEBSD) || defined(BSDI) || defined(QNX)
     73#if defined(FREEBSD)
    8974#include <rpc/types.h> /* the only place that defines INADDR_LOOPBACK */
    9075#endif
    91 
    92 /*
    93  * OS/2 hack.  For some reason INADDR_LOOPBACK is not defined in the
    94  * socket headers.
    95  */
    96 #if defined(OS2) && !defined(INADDR_LOOPBACK)
    97 #define INADDR_LOOPBACK 0x7f000001
    98 #endif
    99 
    100 /*
    101  * Prototypes of ntohl() etc. are declared in <machine/endian.h>
    102  * on these platforms.
    103  */
    104 #if defined(BSDI) || defined(OSF1)
    105 #include <machine/endian.h>
    106 #endif
    107 
    108 #elif defined(WIN32)
    109 
    110 /* Do not include any system header files. */
    111 
    112 #elif defined(WIN16)
    113 
    114 #include <winsock.h>
    115 
    116 #elif defined(XP_MAC)
    117 
    118 #include "macsocket.h"
    11976
    12077#else
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/prio.h

    r101806 r101869  
    244244    struct {
    245245        PRUint16 family;                /* address family (0x00ff maskable) */
    246 #ifdef XP_BEOS
    247         char data[10];                  /* Be has a smaller structure */
    248 #else
    249246        char data[14];                  /* raw address data */
    250 #endif
    251247    } raw;
    252248    struct {
     
    254250        PRUint16 port;                  /* port number */
    255251        PRUint32 ip;                    /* The actual 32 bits of address */
    256 #ifdef XP_BEOS
    257         char pad[4];                    /* Be has a smaller structure */
    258 #else
    259252        char pad[8];
    260 #endif
    261253    } inet;
    262254    struct {
     
    267259        PRUint32 scope_id;              /* set of interfaces for a scope */
    268260    } ipv6;
    269 #if defined(XP_UNIX) || defined(XP_OS2_EMX)
     261#if defined(XP_UNIX)
    270262    struct {                            /* Unix domain socket address */
    271263        PRUint16 family;                /* address family (AF_UNIX) */
    272 #ifdef XP_OS2
    273         char path[108];                 /* null-terminated pathname */
    274                                         /* bind fails if size is not 108. */
    275 #else
    276264        char path[104];                 /* null-terminated pathname */
    277 #endif
    278265    } local;
    279266#endif
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/pprio.h

    r11551 r101869  
    151151*/
    152152
    153 #ifdef WIN32
    154 
    155 #define PR_SOCK_STREAM 1
    156 #define PR_SOCK_DGRAM 2
    157 
    158 #else /* WIN32 */
    159 
    160153#define PR_SOCK_STREAM SOCK_STREAM
    161154#define PR_SOCK_DGRAM SOCK_DGRAM
    162 
    163 #endif /* WIN32 */
    164155
    165156/*
     
    211202    PRTransmitFileFlags flags, PRIntervalTime timeout);
    212203
    213 #ifdef WIN32
    214 /* FUNCTION: PR_NTFast_AcceptRead
    215 ** DESCRIPTION:
    216 **    NT has the notion of an "accept context", which is only needed in
    217 **    order to make certain calls.  By default, a socket connected via
    218 **    AcceptEx can only do a limited number of things without updating
    219 **    the acceptcontext.  The generic version of PR_AcceptRead always
    220 **    updates the accept context.  This version does not.
    221 **/
    222 NSPR_API(PRInt32) PR_NTFast_AcceptRead(PRFileDesc *sd, PRFileDesc **nd,
    223               PRNetAddr **raddr, void *buf, PRInt32 amount, PRIntervalTime t);
    224 
    225 typedef void (*_PR_AcceptTimeoutCallback)(void *);
    226 
    227 /* FUNCTION: PR_NTFast_AcceptRead_WithTimeoutCallback
    228 ** DESCRIPTION:
    229 **    The AcceptEx call combines the accept with the read function.  However,
    230 **    our daemon threads need to be able to wakeup and reliably flush their
    231 **    log buffers if the Accept times out.  However, with the current blocking
    232 **    interface to AcceptRead, there is no way for us to timeout the Accept;
    233 **    this is because when we timeout the Read, we can close the newly
    234 **    socket and continue; but when we timeout the accept itself, there is no
    235 **    new socket to timeout.  So instead, this version of the function is
    236 **    provided.  After the initial timeout period elapses on the accept()
    237 **    portion of the function, it will call the callback routine and then
    238 **    continue the accept.   If the timeout occurs on the read, it will
    239 **    close the connection and return error.
    240 */
    241 NSPR_API(PRInt32) PR_NTFast_AcceptRead_WithTimeoutCallback(
    242               PRFileDesc *sd,
    243               PRFileDesc **nd,
    244               PRNetAddr **raddr,
    245               void *buf,
    246               PRInt32 amount,
    247               PRIntervalTime t,
    248               _PR_AcceptTimeoutCallback callback,
    249               void *callback_arg);
    250 
    251 /* FUNCTION: PR_NTFast_Accept
    252 ** DESCRIPTION:
    253 **    NT has the notion of an "accept context", which is only needed in
    254 **    order to make certain calls.  By default, a socket connected via
    255 **    AcceptEx can only do a limited number of things without updating
    256 **    the acceptcontext.  The generic version of PR_Accept always
    257 **    updates the accept context.  This version does not.
    258 **/
    259 NSPR_API(PRFileDesc*)   PR_NTFast_Accept(PRFileDesc *fd, PRNetAddr *addr,
    260                                                 PRIntervalTime timeout);
    261 
    262 /* FUNCTION: PR_NTFast_Update
    263 ** DESCRIPTION:
    264 **    For sockets accepted with PR_NTFast_Accept or PR_NTFastAcceptRead,
    265 **    this function will update the accept context for those sockets,
    266 **    so that the socket can make general purpose socket calls.
    267 **    Without calling this, the only operations supported on the socket
    268 **    Are PR_Read, PR_Write, PR_Transmitfile, and PR_Close.
    269 */
    270 NSPR_API(void) PR_NTFast_UpdateAcceptContext(PRFileDesc *acceptSock,
    271                                         PRFileDesc *listenSock);
    272 
    273 
    274 /* FUNCTION: PR_NT_CancelIo
    275 ** DESCRIPTION:
    276 **    Cancel IO operations on fd.
    277 */
    278 NSPR_API(PRStatus) PR_NT_CancelIo(PRFileDesc *fd);
    279 
    280 
    281 #endif /* WIN32 */
    282 
    283 /*
    284 ** Need external access to this on Mac so we can first set up our faux
    285 ** environment vars
    286 */
    287 #ifdef XP_MAC
    288 NSPR_API(void) PR_Init_Log(void);
    289 #endif
    290 
    291 
    292204PR_END_EXTERN_C
    293205
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h

    r101843 r101869  
    5454typedef struct PRSegment PRSegment;
    5555
    56 #ifdef XP_MAC
    57 #include "prosdep.h"
    58 #include "probslet.h"
    59 #else
    6056#include "md/prosdep.h"
    6157#include "obsolete/probslet.h"
    62 #endif  /* XP_MAC */
    6358
    6459#ifdef _PR_HAVE_POSIX_SEMAPHORES
     
    748743#define    _PR_MD_QUERY_FD_INHERITABLE _MD_QUERY_FD_INHERITABLE
    749744
    750 #ifdef XP_BEOS
    751 
    752 extern PRLock *_connectLock;
    753 
    754 typedef struct _ConnectListNode {
    755         PRInt32         osfd;
    756         PRNetAddr       addr;
    757         PRUint32        addrlen;
    758         PRIntervalTime  timeout;
    759 } ConnectListNode;
    760 
    761 extern ConnectListNode connectList[64];
    762 
    763 extern PRUint32 connectCount;
    764 
    765 #endif /* XP_BEOS */
    766 
    767745PR_END_EXTERN_C
    768746
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/prpriv.h

    r1 r101869  
    4343 */
    4444
    45 #ifndef XP_MAC
    4645#include "private/pprio.h"
    4746#include "private/pprthred.h"
    48 #else
    49 #include "pprio.h"
    50 #include "pprthred.h"
    51 #endif
     47
    5248
    5349#endif /* prpriv_h___ */
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/prtypes.h

    r101806 r101869  
    8282**
    8383***********************************************************************/
    84 #if defined(WIN32)
    85 
    86 #define PR_EXPORT(__type) extern __declspec(dllexport) __type
    87 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
    88 #define PR_IMPORT(__type) __declspec(dllimport) __type
    89 #define PR_IMPORT_DATA(__type) __declspec(dllimport) __type
    90 
    91 #define PR_EXTERN(__type) extern __declspec(dllexport) __type
    92 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
    93 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
    94 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
    95 
    96 #define PR_CALLBACK
    97 #define PR_CALLBACK_DECL
    98 #define PR_STATIC_CALLBACK(__x) static __x
    99 
    100 #elif defined(XP_BEOS)
    101 
    102 #define PR_EXPORT(__type) extern __declspec(dllexport) __type
    103 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
    104 #define PR_IMPORT(__type) extern __declspec(dllexport) __type
    105 #define PR_IMPORT_DATA(__type) extern __declspec(dllexport) __type
    106 
    107 #define PR_EXTERN(__type) extern __declspec(dllexport) __type
    108 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
    109 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
    110 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
    111 
    112 #define PR_CALLBACK
    113 #define PR_CALLBACK_DECL
    114 #define PR_STATIC_CALLBACK(__x) static __x
    115 
    116 #elif defined(WIN16)
    117 
    118 #define PR_CALLBACK_DECL        __cdecl
    119 
    120 #if defined(_WINDLL)
    121 #define PR_EXPORT(__type) extern __type _cdecl _export _loadds
    122 #define PR_IMPORT(__type) extern __type _cdecl _export _loadds
    123 #define PR_EXPORT_DATA(__type) extern __type _export
    124 #define PR_IMPORT_DATA(__type) extern __type _export
    125 
    126 #define PR_EXTERN(__type) extern __type _cdecl _export _loadds
    127 #define PR_IMPLEMENT(__type) __type _cdecl _export _loadds
    128 #define PR_EXTERN_DATA(__type) extern __type _export
    129 #define PR_IMPLEMENT_DATA(__type) __type _export
    130 
    131 #define PR_CALLBACK             __cdecl __loadds
    132 #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
    133 
    134 #else /* this must be .EXE */
    135 #define PR_EXPORT(__type) extern __type _cdecl _export
    136 #define PR_IMPORT(__type) extern __type _cdecl _export
    137 #define PR_EXPORT_DATA(__type) extern __type _export
    138 #define PR_IMPORT_DATA(__type) extern __type _export
    139 
    140 #define PR_EXTERN(__type) extern __type _cdecl _export
    141 #define PR_IMPLEMENT(__type) __type _cdecl _export
    142 #define PR_EXTERN_DATA(__type) extern __type _export
    143 #define PR_IMPLEMENT_DATA(__type) __type _export
    144 
    145 #define PR_CALLBACK             __cdecl __loadds
    146 #define PR_STATIC_CALLBACK(__x) __x PR_CALLBACK
    147 #endif /* _WINDLL */
    148 
    149 #elif defined(XP_MAC)
    150 
    151 #define PR_EXPORT(__type) extern __declspec(export) __type
    152 #define PR_EXPORT_DATA(__type) extern __declspec(export) __type
    153 #define PR_IMPORT(__type) extern __declspec(export) __type
    154 #define PR_IMPORT_DATA(__type) extern __declspec(export) __type
    155 
    156 #define PR_EXTERN(__type) extern __declspec(export) __type
    157 #define PR_IMPLEMENT(__type) __declspec(export) __type
    158 #define PR_EXTERN_DATA(__type) extern __declspec(export) __type
    159 #define PR_IMPLEMENT_DATA(__type) __declspec(export) __type
    160 
    161 #define PR_CALLBACK
    162 #define PR_CALLBACK_DECL
    163 #define PR_STATIC_CALLBACK(__x) static __x
    164 
    165 #elif defined(XP_OS2) && defined(__declspec)
    166 
    167 #define PR_EXPORT(__type) extern __declspec(dllexport) __type
    168 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
    169 #define PR_IMPORT(__type) __declspec(dllimport) __type
    170 #define PR_IMPORT_DATA(__type) __declspec(dllimport) __type
    171 
    172 #define PR_EXTERN(__type) extern __declspec(dllexport) __type
    173 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
    174 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
    175 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
    176 
    177 #define PR_CALLBACK
    178 #define PR_CALLBACK_DECL
    179 #define PR_STATIC_CALLBACK(__x) static __x
    180 
    181 #elif defined(XP_OS2_VACPP)
    182 
    183 #define PR_EXPORT(__type) extern __type
    184 #define PR_EXPORT_DATA(__type) extern __type
    185 #define PR_IMPORT(__type) extern __type
    186 #define PR_IMPORT_DATA(__type) extern __type
    187 
    188 #define PR_EXTERN(__type) extern __type
    189 #define PR_IMPLEMENT(__type) __type
    190 #define PR_EXTERN_DATA(__type) extern __type
    191 #define PR_IMPLEMENT_DATA(__type) __type
    192 #define PR_CALLBACK _Optlink
    193 #define PR_CALLBACK_DECL
    194 #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
    195 
    196 #else /* Unix */
    197 
    198 # ifdef VBOX_HAVE_VISIBILITY_HIDDEN
    199 #  define PR_EXPORT(__type) __attribute__((visibility("default"))) extern __type
    200 #  define PR_EXPORT_DATA(__type) __attribute__((visibility("default"))) extern __type
    201 #  define PR_IMPORT(__type) extern __type
    202 #  define PR_IMPORT_DATA(__type) extern __type
    203 #  define PR_EXTERN(__type) __attribute__((visibility("default"))) extern __type
    204 #  define PR_IMPLEMENT(__type) __attribute__((visibility("default"))) __type
    205 #  define PR_EXTERN_DATA(__type) __attribute__((visibility("default"))) extern __type
    206 #  define PR_IMPLEMENT_DATA(__type) __attribute__((visibility("default"))) __type
    207 #  define PR_CALLBACK
    208 #  define PR_CALLBACK_DECL
    209 #  define PR_STATIC_CALLBACK(__x) static __x
    210 # else
    211 #  define PR_EXPORT(__type) extern __type
    212 #  define PR_EXPORT_DATA(__type) extern __type
    213 #  define PR_IMPORT(__type) extern __type
    214 #  define PR_IMPORT_DATA(__type) extern __type
    215 #  define PR_EXTERN(__type) extern __type
    216 #  define PR_IMPLEMENT(__type) __type
    217 #  define PR_EXTERN_DATA(__type) extern __type
    218 #  define PR_IMPLEMENT_DATA(__type) __type
    219 #  define PR_CALLBACK
    220 #  define PR_CALLBACK_DECL
    221 #  define PR_STATIC_CALLBACK(__x) static __x
    222 # endif
     84
     85#ifdef VBOX_HAVE_VISIBILITY_HIDDEN
     86# define PR_EXPORT(__type) __attribute__((visibility("default"))) extern __type
     87# define PR_EXPORT_DATA(__type) __attribute__((visibility("default"))) extern __type
     88# define PR_IMPORT(__type) extern __type
     89# define PR_IMPORT_DATA(__type) extern __type
     90# define PR_EXTERN(__type) __attribute__((visibility("default"))) extern __type
     91# define PR_IMPLEMENT(__type) __attribute__((visibility("default"))) __type
     92# define PR_EXTERN_DATA(__type) __attribute__((visibility("default"))) extern __type
     93# define PR_IMPLEMENT_DATA(__type) __attribute__((visibility("default"))) __type
     94# define PR_CALLBACK
     95# define PR_CALLBACK_DECL
     96# define PR_STATIC_CALLBACK(__x) static __x
     97#else
     98# define PR_EXPORT(__type) extern __type
     99# define PR_EXPORT_DATA(__type) extern __type
     100# define PR_IMPORT(__type) extern __type
     101# define PR_IMPORT_DATA(__type) extern __type
     102# define PR_EXTERN(__type) extern __type
     103# define PR_IMPLEMENT(__type) __type
     104# define PR_EXTERN_DATA(__type) extern __type
     105# define PR_IMPLEMENT_DATA(__type) __type
     106# define PR_CALLBACK
     107# define PR_CALLBACK_DECL
     108# define PR_STATIC_CALLBACK(__x) static __x
    223109#endif
    224110
     
    390276typedef long PRInt64;
    391277typedef unsigned long PRUint64;
    392 #elif defined(WIN16)
    393 typedef __int64 PRInt64;
    394 typedef unsigned __int64 PRUint64;
    395 #elif defined(WIN32) && !defined(__GNUC__)
    396 typedef __int64  PRInt64;
    397 typedef unsigned __int64 PRUint64;
    398278#else
    399279typedef long long PRInt64;
     
    506386typedef unsigned long PRUword;
    507387
    508 #if defined(NO_NSPR_10_SUPPORT)
    509 #else
    510 /********* ???????????????? FIX ME       ??????????????????????????? *****/
    511 /********************** Some old definitions until pr=>ds transition is done ***/
    512 /********************** Also, we are still using NSPR 1.0. GC ******************/
    513 /*
    514 ** Fundamental NSPR macros, used nearly everywhere.
    515 */
    516 
    517 #define PR_PUBLIC_API           PR_IMPLEMENT
    518 
    519 /*
    520 ** Macro body brackets so that macros with compound statement definitions
    521 ** behave syntactically more like functions when called.
    522 */
    523 #define NSPR_BEGIN_MACRO        do {
    524 #define NSPR_END_MACRO          } while (0)
    525 
    526 /*
    527 ** Macro shorthands for conditional C++ extern block delimiters.
    528 */
    529 #ifdef NSPR_BEGIN_EXTERN_C
    530 #undef NSPR_BEGIN_EXTERN_C
    531 #endif
    532 #ifdef NSPR_END_EXTERN_C
    533 #undef NSPR_END_EXTERN_C
    534 #endif
    535 
    536 #ifdef __cplusplus
    537 #define NSPR_BEGIN_EXTERN_C     extern "C" {
    538 #define NSPR_END_EXTERN_C       }
    539 #else
    540 #define NSPR_BEGIN_EXTERN_C
    541 #define NSPR_END_EXTERN_C
    542 #endif
    543 
    544 #ifdef XP_MAC
    545 #include "protypes.h"
    546 #else
    547 #include "obsolete/protypes.h"
    548 #endif
    549 
    550 /********* ????????????? End Fix me ?????????????????????????????? *****/
    551 #endif /* NO_NSPR_10_SUPPORT */
     388typedef uint8_t uint8;
     389typedef uint16_t uint16;
     390typedef uint32_t uint32;
     391typedef uint64_t uint64;
     392
     393typedef int8_t int8;
     394typedef int16_t int16;
     395typedef int32_t int32;
     396typedef int64_t int64;
    552397
    553398PR_END_EXTERN_C
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/io/prlog.c

    r101805 r101869  
    7474#define _PR_LOCK_LOG() PR_Lock(_pr_logLock);
    7575#define _PR_UNLOCK_LOG() PR_Unlock(_pr_logLock);
    76 
    77 #if defined(XP_PC)
    78 #define strcasecmp stricmp
    79 #define strncasecmp strnicmp
    80 #endif
    81 
    82 /*
    83  * On NT, we can't define _PUT_LOG as PR_Write or _PR_MD_WRITE,
    84  * because every asynchronous file io operation leads to a fiber context
    85  * switch.  So we define _PUT_LOG as fputs (from stdio.h).  A side
    86  * benefit is that fputs handles the LF->CRLF translation.  This
    87  * code can also be used on other platforms with file stream io.
    88  */
    89 #if defined(WIN32) || defined(XP_OS2)
    90 #define _PR_USE_STDIO_FOR_LOGGING
    91 #endif
    92 
    93 /*
    94 ** Coerce Win32 log output to use OutputDebugString() when
    95 ** NSPR_LOG_FILE is set to "WinDebug".
    96 */
    97 #if defined(XP_PC)
    98 #define WIN32_DEBUG_FILE (FILE*)-2
    99 #endif
    10076
    10177/*
     
    131107#elif defined(_PR_PTHREADS)
    132108#define __PUT_LOG(fd, buf, nb) PR_Write(fd, buf, nb)
    133 #elif defined(XP_MAC)
    134 #define __PUT_LOG(fd, buf, nb) _PR_MD_WRITE_SYNC(fd, buf, nb)
    135109#else
    136110#define __PUT_LOG(fd, buf, nb) _PR_MD_WRITE(fd, buf, nb)
     
    165139#define LINE_BUF_SIZE           512
    166140#define DEFAULT_BUF_SIZE        16384
    167 
    168 #ifdef _PR_NEED_STRCASECMP
    169 
    170 /*
    171  * strcasecmp is defined in /usr/ucblib/libucb.a on some platforms
    172  * such as NCR and Unixware.  Linking with both libc and libucb
    173  * may cause some problem, so I just provide our own implementation
    174  * of strcasecmp here.
    175  */
    176 
    177 static const unsigned char uc[] =
    178 {
    179     '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
    180     '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
    181     '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
    182     '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
    183     ' ',    '!',    '"',    '#',    '$',    '%',    '&',    '\'',
    184     '(',    ')',    '*',    '+',    ',',    '-',    '.',    '/',
    185     '0',    '1',    '2',    '3',    '4',    '5',    '6',    '7',
    186     '8',    '9',    ':',    ';',    '<',    '=',    '>',    '?',
    187     '@',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
    188     'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
    189     'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
    190     'X',    'Y',    'Z',    '[',    '\\',   ']',    '^',    '_',
    191     '`',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
    192     'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
    193     'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
    194     'X',    'Y',    'Z',    '{',    '|',    '}',    '~',    '\177'
    195 };
    196 
    197 PRIntn strcasecmp(const char *a, const char *b)
    198 {
    199     const unsigned char *ua = (const unsigned char *)a;
    200     const unsigned char *ub = (const unsigned char *)b;
    201 
    202     if( ((const char *)0 == a) || (const char *)0 == b )
    203         return (PRIntn)(a-b);
    204 
    205     while( (uc[*ua] == uc[*ub]) && ('\0' != *a) )
    206     {
    207         a++;
    208         ua++;
    209         ub++;
    210     }
    211 
    212     return (PRIntn)(uc[*ua] - uc[*ub]);
    213 }
    214 
    215 #endif /* _PR_NEED_STRCASECMP */
    216141
    217142void _PR_InitLog(void)
     
    271196        if (ev && ev[0]) {
    272197            if (!PR_SetLogFile(ev)) {
    273 #ifdef XP_PC
    274                 char* str = PR_smprintf("Unable to create nspr log file '%s'\n", ev);
    275                 if (str) {
    276                     OutputDebugString(str);
    277                     PR_smprintf_free(str);
    278                 }
    279 #else
    280198                fprintf(stderr, "Unable to create nspr log file '%s'\n", ev);
    281 #endif
    282199            }
    283200        } else {
     
    455372        }
    456373        logFile = newLogFile;
    457 #if defined(XP_MAC)
    458         SetLogFileTypeCreator(file);
    459 #endif
    460374    }
    461375    return (PRBool) (newLogFile != 0);
     
    493407    me = PR_GetCurrentThread();
    494408    nb = PR_snprintf(line, sizeof(line)-1, "%ld[%p]: ",
    495 #if defined(_PR_DCETHREADS)
    496              /* The problem is that for _PR_DCETHREADS, pthread_t is not a
    497               * pointer, but a structure; so you can't easily print it...
    498               */
    499                      me ? &(me->id): 0L, me);
    500 #elif defined(_PR_BTHREADS)
    501                      me, me);
    502 #else
    503409                     me ? me->id : 0L, me);
    504 #endif
    505410
    506411    nb += PR_vsnprintf(line+nb, sizeof(line)-nb-1, fmt, ap);
    507412    if (nb > 0) {
    508413        if (line[nb-1] != '\n') {
    509 #ifndef XP_MAC
    510             line[nb++] = '\n';
    511 #else
    512414            line[nb++] = '\015';
    513 #endif
    514415            line[nb] = '\0';
    515         } else {
    516 #ifdef XP_MAC
    517             line[nb-1] = '\015';
    518 #endif
    519416        }
    520417    }
     
    554451}
    555452
    556 #if defined(XP_OS2)
    557 /*
    558  * Added definitions for DebugBreak() for 2 different OS/2 compilers.
    559  * Doing the int3 on purpose for Visual Age so that a developer can
    560  * step over the instruction if so desired.  Not always possible if
    561  * trapping due to exception handling IBM-AKR
    562  */
    563 #if defined(XP_OS2_VACPP)
    564 #include <builtin.h>
    565 static void DebugBreak(void) { _interrupt(3); }
    566 #elif defined(XP_OS2_EMX)
    567 static void DebugBreak(void) { asm("int $3"); }
    568 #else
    569 static void DebugBreak(void) { }
    570 #endif
    571 #endif /* XP_OS2 */
    572 
    573453PR_IMPLEMENT(void) PR_Assert(const char *s, const char *file, PRIntn ln)
    574454{
    575455    PR_LogPrint("Assertion failure: %s, at %s:%d\n", s, file, ln);
    576 #if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS)
     456#if defined(XP_UNIX)
    577457    fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln);
    578458#endif
    579 #ifdef XP_MAC
    580     dprintf("Assertion failure: %s, at %s:%d\n", s, file, ln);
    581 #endif
    582 #if defined(WIN32) || defined(XP_OS2)
    583     DebugBreak();
    584 #endif
    585 #ifndef XP_MAC
    586459    abort();
    587 #endif
    588 }
    589 
    590 #ifdef XP_MAC
    591 PR_IMPLEMENT(void) PR_Init_Log(void)
    592 {
    593         _PR_InitLog();
    594 }
    595 #endif
     460}
     461
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/io/prmapopt.c

    r101805 r101869  
    6666#include "primpl.h"
    6767
    68 #if defined(NEXTSTEP)
    69 /* NEXTSTEP is special: this must come before netinet/tcp.h. */
    70 #include <netinet/in_systm.h>  /* n_short, n_long, n_time */
    71 #endif
    72 
    73 #if defined(XP_UNIX) || defined(OS2) || (defined(XP_BEOS) && defined(BONE_VERSION))
     68#if defined(XP_UNIX)
    7469#include <netinet/tcp.h>  /* TCP_NODELAY, TCP_MAXSEG */
    7570#endif
     
    8580 *********************************************************************
    8681 */
    87 
    88 #if defined(VMS)
    89 /*
    90 ** Sad but true. The DEC C header files define the following socket options
    91 ** differently to what UCX is expecting. The values that UCX expects are
    92 ** defined in SYS$LIBRARY:UCX$INETDEF.H. We redefine them here to the values
    93 ** that UCX expects. Note that UCX V4.x will only accept these values while
    94 ** UCX V5.x will accept either. So in theory this hack can be removed once
    95 ** UCX V5 is the minimum.
    96 */
    97 #undef IP_MULTICAST_IF
    98 #undef IP_MULTICAST_TTL
    99 #undef IP_MULTICAST_LOOP
    100 #undef IP_ADD_MEMBERSHIP
    101 #undef IP_DROP_MEMBERSHIP
    102 #include <ucx$inetdef.h>
    103 #define IP_MULTICAST_IF    UCX$C_IP_MULTICAST_IF
    104 #define IP_MULTICAST_TTL   UCX$C_IP_MULTICAST_TTL
    105 #define IP_MULTICAST_LOOP  UCX$C_IP_MULTICAST_LOOP
    106 #define IP_ADD_MEMBERSHIP  UCX$C_IP_ADD_MEMBERSHIP
    107 #define IP_DROP_MEMBERSHIP UCX$C_IP_DROP_MEMBERSHIP
    108 #endif
    10982
    11083/*
     
    129102#if !defined(SO_LINGER)
    130103#error "SO_LINGER is not defined"
    131 #endif
    132 
    133 /*
    134  * Some platforms, such as NCR 2.03, don't have TCP_NODELAY defined
    135  * in <netinet/tcp.h>
    136  */
    137 #if !defined(NCR)
    138 #if !defined(TCP_NODELAY)
    139 #error "TCP_NODELAY is not defined"
    140 #endif
    141104#endif
    142105
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/linking/prlink.c

    r101840 r101869  
    196196    /* initialize pr_currentLibPath */
    197197
    198 #if defined(XP_UNIX) || defined(XP_BEOS)
    199 #if defined(USE_DLFCN) || defined(USE_MACH_DYLD) || defined(XP_BEOS)
     198#if defined(XP_UNIX)
     199#if defined(USE_DLFCN) || defined(USE_MACH_DYLD)
    200200    {
    201201    char *p=NULL;
     
    251251    char *fullname;
    252252
    253 #if defined(XP_UNIX) || defined(XP_BEOS)
     253#if defined(XP_UNIX)
    254254    if (strstr(lib, PR_DLL_SUFFIX) == NULL)
    255255    {
     
    266266        }
    267267    }
    268 #endif /* XP_UNIX || XP_BEOS */
     268#endif /* XP_UNIX */
    269269    return fullname;
    270270}
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/prosdep.c

    r1 r101869  
    4242#include <unistd.h>
    4343#endif
    44 #ifdef SUNOS4
    45 #include "md/sunos4.h"
    46 #endif
    47 #ifdef _WIN32
    48 #include <windows.h>
    49 #endif
    50 #ifdef XP_BEOS
    51 #include <OS.h>
    52 #endif
    5344
    5445PRInt32 _pr_pageShift;
     
    6859        || defined DARWIN || defined NEXTSTEP
    6960    _pr_pageSize = getpagesize();
    70 #elif defined(HPUX)
    71     /* I have no idea. Don't get me started. --Rob */
    72     _pr_pageSize = sysconf(_SC_PAGE_SIZE);
    7361#else
    7462    _pr_pageSize = sysconf(_SC_PAGESIZE);
    7563#endif
    7664#endif /* XP_UNIX */
    77 
    78 #ifdef XP_MAC
    79     _pr_pageSize = 4096;
    80 #endif /* XP_MAC */
    81 
    82 #ifdef XP_BEOS
    83     _pr_pageSize = B_PAGE_SIZE;
    84 #endif
    85 
    86 #ifdef XP_PC
    87 #ifdef _WIN32
    88     SYSTEM_INFO info;
    89     GetSystemInfo(&info);
    90     _pr_pageSize = info.dwPageSize;
    91 #else
    92     _pr_pageSize = 4096;
    93 #endif
    94 #endif /* XP_PC */
    9565
    9666        pageSize = _pr_pageSize;
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prenv.c

    r101810 r101869  
    9292}
    9393
    94 /*
    95 ** DEPRECATED.  Use PR_SetEnv() instead.
    96 */
    97 #ifdef XP_MAC
    98 PR_IMPLEMENT(PRIntn) PR_PutEnv(const char *string)
    99 {
    100     return (PR_SetEnv(string) == PR_SUCCESS) ? PR_TRUE : PR_FALSE;
    101 }
    102 #endif
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prinit.c

    r101839 r101869  
    126126PRInt32 _native_threads_only = 0;
    127127
    128 #ifdef WINNT
    129 static void _pr_SetNativeThreadsOnlyMode(void)
    130 {
    131     HMODULE mainExe;
    132     PRBool *globalp;
    133     char *envp;
    134 
    135     mainExe = GetModuleHandle(NULL);
    136     PR_ASSERT(NULL != mainExe);
    137     globalp = (PRBool *) GetProcAddress(mainExe, "nspr_native_threads_only");
    138     if (globalp) {
    139         _native_threads_only = (*globalp != PR_FALSE);
    140     } else if (envp = getenv("NSPR_NATIVE_THREADS_ONLY")) {
    141         _native_threads_only = (atoi(envp) == 1);
    142     }
    143 }
    144 #endif
    145 
    146 #if !defined(_PR_INET6) || defined(_PR_INET6_PROBE)
    147 extern PRStatus _pr_init_ipv6(void);
    148 #endif
    149 
    150128static void _PR_InitStuff(void)
    151129{
     
    156134    RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
    157135#endif
    158 #ifdef WINNT
    159     _pr_SetNativeThreadsOnlyMode();
    160 #endif
    161 
    162136
    163137    (void) PR_GetPageSize();
     
    226200    PRThreadType type, PRThreadPriority priority, PRUintn maxPTDs)
    227201{
    228 #if defined(XP_MAC)
    229 #pragma unused (type, priority, maxPTDs)
    230 #endif
    231 
    232202    _PR_ImplicitInitialization();
    233203}
     
    236206    PRPrimordialFn prmain, PRIntn argc, char **argv, PRUintn maxPTDs)
    237207{
    238 #if defined(XP_MAC)
    239 #pragma unused (maxPTDs)
    240 #endif
    241 
    242208    PRIntn rv;
    243209    _PR_ImplicitInitialization();
     
    602568{
    603569#if defined(DEBUG)
    604 #ifndef XP_MAC
    605570    PR_fprintf(
    606571        PR_STDERR, "'%s' is obsolete. Use '%s' instead.\n",
    607572        obsolete, (NULL == preferred) ? "something else" : preferred);
    608 #else
    609 #pragma unused (obsolete, preferred)
    610 #endif
    611573#endif
    612574    return PR_FALSE;
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prtime.c

    r62263 r101869  
    5151#include <string.h>
    5252#include <ctype.h>
    53 
    54 #ifdef XP_MAC
    55 #include <time.h>
    56 #endif
    57 
    58 
    59 
    6053
    6154/*
     
    247240 *------------------------------------------------------------------------
    248241 */
    249 #if defined(HAVE_WATCOM_BUG_2)
    250 PRTime __pascal __export __loadds
    251 #else
    252242PR_IMPLEMENT(PRTime)
    253 #endif
    254243PR_ImplodeTime(const PRExplodedTime *exploded)
    255244{
     
    566555#else
    567556
    568 #if defined(XP_MAC)
    569 extern struct tm *Maclocaltime(const time_t * t);
    570 #endif
    571 
    572557static PRLock *monitor = NULL;
    573558
     
    602587     */
    603588   
    604 #if defined(XP_MAC)
    605     tmPtr = Maclocaltime(clock);
    606 #else
    607589    tmPtr = localtime(clock);
    608 #endif
    609 
    610 #if defined(WIN16) || defined(XP_OS2_EMX)
    611     if ( (PRInt32) *clock < 0 ||
    612          ( (PRInt32) *clock == 0 && tmPtr->tm_year != 70))
    613         result = NULL;
    614     else
    615         *result = *tmPtr;
    616 #else
    617590    if (tmPtr) {
    618591        *result = *tmPtr;
     
    620593        result = NULL;
    621594    }
    622 #endif /* WIN16 */
    623 
    624595    if (needLock) PR_Unlock(monitor);
    625596
     
    629600#endif  /* definition of MT_safe_localtime() */
    630601
    631 #if defined(XP_UNIX) || defined(XP_PC) || defined(XP_BEOS)
     602#if defined(XP_UNIX)
    632603
    633604PR_IMPLEMENT(PRTimeParameters)
     
    764735}
    765736
    766 #endif    /* defined(XP_UNIX) !! defined(XP_PC) */
     737#endif    /* defined(XP_UNIX) */
    767738
    768739/*
     
    884855PR_GMTParameters(const PRExplodedTime *gmt)
    885856{
    886 #if defined(XP_MAC)
    887 #pragma unused (gmt)
    888 #endif
    889 
    890857    PRTimeParameters retVal = { 0, 0 };
    891858    return retVal;
     
    15891556                  if (secs != (time_t) -1)
    15901557                    {
    1591 #if defined(XP_MAC) && (__MSL__ < 0x6000)
    1592                       /*
    1593                        * The mktime() routine in MetroWerks MSL C
    1594                        * Runtime library returns seconds since midnight,
    1595                        * 1 Jan. 1900, not 1970 - in versions of MSL (Metrowerks Standard
    1596                        * Library) prior to version 6.  Only for older versions of
    1597                        * MSL do we adjust the value of secs to the NSPR epoch
    1598                        */
    1599                       secs -= ((365 * 70UL) + 17) * 24 * 60 * 60;
    1600 #endif
    16011558                      LL_I2L(*result, secs);
    16021559                      LL_I2L(usec_per_sec, PR_USEC_PER_SEC);
     
    16711628 */
    16721629
    1673 #if defined(SUNOS4) || (__GLIBC__ >= 2) || defined(XP_BEOS) \
     1630#if defined(SUNOS4) || (__GLIBC__ >= 2) \
    16741631        || defined(NETBSD) || defined(OPENBSD) || defined(FREEBSD) \
    16751632        || defined(DARWIN)
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/threads/prtpd.c

    r1 r101869  
    5858*/
    5959
    60 /*
    61 ** As of this time, BeOS has its own TPD implementation.  Integrating
    62 ** this standard one is a TODO for anyone with a bit of spare time on
    63 ** their hand.  For now, we just #ifdef out this whole file and use
    64 ** the routines in pr/src/btthreads/
    65 */
    66 
    67 #ifndef XP_BEOS
    68 
    6960#include "primpl.h"
    7061
    7162#include <string.h>
    72 
    73 #if defined(WIN95)
    74 /*
    75 ** Some local variables report warnings on Win95 because the code paths
    76 ** using them are conditioned on HAVE_CUSTOME_USER_THREADS.
    77 ** The pragma suppresses the warning.
    78 **
    79 */
    80 #pragma warning(disable : 4101)
    81 #endif
    8263
    8364#define _PR_TPD_LIMIT 128               /* arbitary limit on the TPD slots */
     
    278259}  /* _PR_DestroyThreadPrivate */
    279260
    280 #endif /* !XP_BEOS */
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