diff options
Diffstat (limited to 'chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin')
237 files changed, 0 insertions, 86355 deletions
diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/SYSCALLS.c.X b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/SYSCALLS.c.X deleted file mode 100644 index 2a59818a030..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/SYSCALLS.c.X +++ /dev/null @@ -1,1350 +0,0 @@ -/* compiled from: . */ -/* SYSCALLS.c:241:OC */ extern int TLappend (/* ??? */); -/* SYSCALLS.c:242:OC */ extern int TLassign (/* ??? */); -/* SYSCALLS.c:243:OC */ extern int TLclose (/* ??? */); -/* SYSCALLS.c:244:OC */ extern int TLdelete (/* ??? */); -/* SYSCALLS.c:245:OC */ extern int TLfreeentry (/* ??? */); -/* SYSCALLS.c:246:OC */ extern ENTRY TLgetentry (/* ??? */); -/* SYSCALLS.c:247:OC */ extern unsigned char *TLgetfield (/* ??? */); -/* SYSCALLS.c:248:OC */ extern int TLopen (/* ??? */); -/* SYSCALLS.c:249:OC */ extern int TLread (/* ??? */); -/* SYSCALLS.c:250:OC */ extern int TLsearch1 (/* ??? */); -/* SYSCALLS.c:251:OC */ extern int TLsubst (/* ??? */); -/* SYSCALLS.c:252:OC */ extern int TLsync (/* ??? */); -/* SYSCALLS.c:253:OC */ extern int TLwrite (/* ??? */); -/* SYSCALLS.c:254:NC */ extern int __acancel (int, const long int *, int); -/* SYSCALLS.c:255:NC */ extern int __aread (int, int, char *, uint, ecb_t *); -/* SYSCALLS.c:256:NC */ extern void __assert (const char *, const char *, int); -/* SYSCALLS.c:257:NC */ extern int __asyncio (int, aioop_t *, int); -/* SYSCALLS.c:258:NC */ extern int __awrite (int, int, char *, uint, ecb_t *); -/* SYSCALLS.c:259:NC */ extern int __evcntl (evver_t, evcntlcmds_t, long int, long int); -/* SYSCALLS.c:260:NC */ extern int __evexit (evver_t, idtype_t, id_t, const ecb_t *); -/* SYSCALLS.c:261:NC */ extern int __evexitset (evver_t, const procset_t *, hostid_t, const ecb_t *); -/* SYSCALLS.c:262:NC */ extern int __evpoll (evver_t, evpollcmds_t, event_t *, int, const hrtime_t *); -/* SYSCALLS.c:263:NC */ extern int __evpollmore (evver_t, event_t *, int); -/* SYSCALLS.c:264:NC */ extern int __evpost (evver_t, event_t *, int, int); -/* SYSCALLS.c:265:NC */ extern int __evqcntl (evver_t, int, evqcntlcmds_t, long int); -/* SYSCALLS.c:266:NC */ extern int __evsig (evver_t, const sigset_t *, const ecb_t *, evsiginfo_t *, int); -/* SYSCALLS.c:267:NC */ extern int __evtrap (evver_t, evpollcmds_t, event_t *, int, long int, void (*) (event_t *, int, long int, evcontext_t *), const evta_t *); -/* SYSCALLS.c:268:NC */ extern int __evtrapcancel (evver_t, long int *, int); -/* SYSCALLS.c:269:NC */ extern int __filbuf (FILE *); -/* SYSCALLS.c:270:NC */ extern int __flsbuf (int, FILE *); -/* SYSCALLS.c:271:NC */ extern major_t __major (int, dev_t); -/* SYSCALLS.c:272:NC */ extern dev_t __makedev (int, major_t, minor_t); -/* SYSCALLS.c:273:NC */ extern minor_t __minor (int, dev_t); -/* SYSCALLS.c:274:OC */ extern long int __priocntl (/* ??? */); -/* SYSCALLS.c:275:OC */ extern long int __priocntlset (/* ??? */); -/* SYSCALLS.c:276:NC */ extern void _exit (int); -/* SYSCALLS.c:277:NC */ extern int _filbuf (FILE *); -/* SYSCALLS.c:278:NC */ extern int _flsbuf (unsigned int, FILE *); -/* SYSCALLS.c:279:NC */ extern int _fxstat (int, int, struct stat *); -/* SYSCALLS.c:280:OC */ extern u_long _getlong (/* ??? */); -/* SYSCALLS.c:281:OC */ extern u_short _getshort (/* ??? */); -/* SYSCALLS.c:282:NC */ extern int _getsyx (int *, int *); -/* SYSCALLS.c:283:NC */ extern int _longjmp (jmp_buf, int); -/* SYSCALLS.c:284:NC */ extern int _lxstat (int, const char *, struct stat *); -/* SYSCALLS.c:285:NC */ extern int _meta (int); -/* SYSCALLS.c:286:NC */ extern struct nd_hostservlist _netdir_getbyaddr (struct netconfig *, struct netbuf *); -/* SYSCALLS.c:287:NC */ extern struct nd_addrlist *_netdir_getbyname (struct netconfig *, struct nd_hostserv *); -/* SYSCALLS.c:288:NC */ extern int _overlay (WINDOW *, WINDOW *, int); -/* SYSCALLS.c:289:NC */ extern int _ring (int); -/* SYSCALLS.c:290:OC */ extern int _rpc_dtbsize (/* ??? */); -/* SYSCALLS.c:291:OC */ extern int _rpc_endconf (/* ??? */); -/* SYSCALLS.c:292:OC */ extern u_int _rpc_get_a_size (/* ??? */); -/* SYSCALLS.c:293:OC */ extern u_int _rpc_get_t_size (/* ??? */); -/* SYSCALLS.c:294:OC */ extern struct netconfig *_rpc_getconf (/* ??? */); -/* SYSCALLS.c:295:OC */ extern struct netconfig *_rpc_getconfip (/* ??? */); -/* SYSCALLS.c:296:OC */ extern char *_rpc_gethostname (/* ??? */); -/* SYSCALLS.c:297:OC */ extern int _rpc_setconf (/* ??? */); -/* SYSCALLS.c:298:OC */ extern void _s_aligned_copy (/* ??? */); -/* SYSCALLS.c:299:OC */ extern struct _si_user *_s_checkfd (/* ??? */); -/* SYSCALLS.c:300:OC */ extern void _s_close (/* ??? */); -/* SYSCALLS.c:301:OC */ extern int _s_do_ioctl (/* ??? */); -/* SYSCALLS.c:302:OC */ extern int _s_getfamily (/* ??? */); -/* SYSCALLS.c:303:OC */ extern int _s_getudata (/* ??? */); -/* SYSCALLS.c:304:OC */ extern int _s_is_ok (/* ??? */); -/* SYSCALLS.c:305:OC */ extern struct netconfig *_s_match (/* ??? */); -/* SYSCALLS.c:306:OC */ extern int _s_max (/* ??? */); -/* SYSCALLS.c:307:OC */ extern int _s_min (/* ??? */); -/* SYSCALLS.c:308:OC */ extern struct _si_user *_s_open (/* ??? */); -/* SYSCALLS.c:309:OC */ extern int _s_soreceive (/* ??? */); -/* SYSCALLS.c:310:OC */ extern int _s_sosend (/* ??? */); -/* SYSCALLS.c:311:OC */ extern int _s_uxpathlen (/* ??? */); -/* SYSCALLS.c:312:NC */ extern int _setecho (int); -/* SYSCALLS.c:313:NC */ extern int _setjmp (jmp_buf); -/* SYSCALLS.c:314:NC */ extern int _setnonl (int); -/* SYSCALLS.c:315:NC */ extern void _setqiflush (int); -/* SYSCALLS.c:316:NC */ extern char *_taddr2uaddr (struct netconfig *, struct netbuf *); -/* SYSCALLS.c:317:NC */ extern int _tolower (int); -/* SYSCALLS.c:318:NC */ extern int _toupper (int); -/* SYSCALLS.c:319:NC */ extern struct netbuf *_uaddr2taddr (struct netconfig *, char *); -/* SYSCALLS.c:320:OC */ extern bool _xdr_yprequest (/* ??? */); -/* SYSCALLS.c:321:OC */ extern bool _xdr_ypresponse (/* ??? */); -/* SYSCALLS.c:322:NC */ extern int _xftw (int, const char *, int (*) (const char *, const struct stat *, int), int); -/* SYSCALLS.c:323:NC */ extern int _xmknod (int, const char *, mode_t, dev_t); -/* SYSCALLS.c:324:NC */ extern int _xstat (int, const char *, struct stat *); -/* SYSCALLS.c:325:OC */ extern int _yp_dobind (/* ??? */); -/* SYSCALLS.c:326:NC */ extern long int a64l (const char *); -/* SYSCALLS.c:327:NC */ extern char *aatos (char *, struct address *, int); -/* SYSCALLS.c:328:NC */ extern void abort (void); -/* SYSCALLS.c:329:NC */ extern int abs (int); -/* SYSCALLS.c:330:NC */ extern int access (const char *, int); -/* SYSCALLS.c:331:NC */ extern int acct (const char *); -/* SYSCALLS.c:332:NC */ extern double acos (double); -/* SYSCALLS.c:333:NC */ extern float acosf (float); -/* SYSCALLS.c:334:NC */ extern double acosh (double); -/* SYSCALLS.c:335:NC */ extern int addexportent (FILE *, char *, char *); -/* SYSCALLS.c:336:NC */ extern int addseverity (int, const char *); -/* SYSCALLS.c:337:NC */ extern int adjtime (struct timeval *, struct timeval *); -/* SYSCALLS.c:338:NC */ extern int advance (const char *, const char *); -/* SYSCALLS.c:339:NC */ extern unsigned int alarm (unsigned int); -/* SYSCALLS.c:340:NC */ extern void *alloca (size_t); -/* SYSCALLS.c:341:NC */ extern int and (void); -/* SYSCALLS.c:342:NC */ extern int ascftime (char *, const char *, const struct tm *); -/* SYSCALLS.c:343:NC */ extern char *asctime (const struct tm *); -/* SYSCALLS.c:344:NC */ extern double asin (double); -/* SYSCALLS.c:345:NC */ extern float asinf (float); -/* SYSCALLS.c:346:NC */ extern double asinh (double); -/* SYSCALLS.c:347:NC */ extern struct address *astoa (char *, struct address *); -/* SYSCALLS.c:348:NC */ extern double atan (double); -/* SYSCALLS.c:349:NC */ extern double atan2 (double, double); -/* SYSCALLS.c:350:NC */ extern float atan2f (float, float); -/* SYSCALLS.c:351:NC */ extern float atanf (float); -/* SYSCALLS.c:352:NC */ extern double atanh (double); -/* SYSCALLS.c:353:NC */ extern int atexit (void (*) (void)); -/* SYSCALLS.c:354:NC */ extern double atof (const char *); -/* SYSCALLS.c:355:NC */ extern int atoi (const char *); -/* SYSCALLS.c:356:NC */ extern long int atol (const char *); -/* SYSCALLS.c:357:NC */ extern char *atos (char *, struct netbuf *, int); -/* SYSCALLS.c:358:NC */ extern void auth_destroy (AUTH *); -/* SYSCALLS.c:359:OC */ extern AUTH *authdes_create (/* ??? */); -/* SYSCALLS.c:360:NC */ extern void authdes_getcred (struct authdes_cred *, short int *, short int *, short int *, int *); -/* SYSCALLS.c:361:OC */ extern AUTH *authdes_seccreate (/* ??? */); -/* SYSCALLS.c:362:NC */ extern AUTH *authnone_create (void); -/* SYSCALLS.c:363:NC */ extern AUTH *authsys_create (char *, int, int, int, int *); -/* SYSCALLS.c:364:NC */ extern AUTH *authsys_create_default (void); -/* SYSCALLS.c:365:NC */ extern AUTH *authunix_create (char *, int, int, int, int *); -/* SYSCALLS.c:366:NC */ extern AUTH *authunix_create_default (void); -/* SYSCALLS.c:367:NC */ extern char *basename (char *); -/* SYSCALLS.c:368:NC */ extern int baudrate (void); -/* SYSCALLS.c:369:NC */ extern int bcmp (const void *, const void *, size_t); -/* SYSCALLS.c:370:NC */ extern void bcopy (const void *, void *, size_t); -/* SYSCALLS.c:371:NC */ extern int beep (void); -/* SYSCALLS.c:372:NC */ extern void (*berk_signal (int, void (*) (int, ...))) (int, ...); -/* SYSCALLS.c:373:NC */ extern char *bgets (char *, size_t, FILE *, char *); -/* SYSCALLS.c:374:NC */ extern int bottom_panel (PANEL *); -/* SYSCALLS.c:375:NC */ extern int box32 (WINDOW *, chtype, chtype); -/* SYSCALLS.c:376:NC */ extern int brk (void *); -/* SYSCALLS.c:377:NC */ extern void *bsearch (const void *, const void *, size_t, size_t, int (*) (const void *, const void *)); -/* SYSCALLS.c:378:NC */ extern size_t bufsplit (char *, size_t, char *); -/* SYSCALLS.c:379:NC */ extern void bzero (void *, size_t); -/* SYSCALLS.c:380:OC */ extern long int calchash (/* ??? */); -/* SYSCALLS.c:381:NC */ extern void *calloc (size_t, size_t); -/* SYSCALLS.c:382:NC */ extern void callrpc (char *, long unsigned int, long unsigned int, long unsigned int, xdrproc_t, char *, xdrproc_t, char *); -/* SYSCALLS.c:383:NC */ extern bool can_change_color (void); -/* SYSCALLS.c:384:NC */ extern int catclose (nl_catd); -/* SYSCALLS.c:385:NC */ extern char *catgets (nl_catd, int, int, char *); -/* SYSCALLS.c:386:NC */ extern nl_catd catopen (const char *, int); -/* SYSCALLS.c:387:NC */ extern int cbreak (void); -/* SYSCALLS.c:388:NC */ extern double cbrt (double); -/* SYSCALLS.c:389:NC */ extern double ceil (double); -/* SYSCALLS.c:390:NC */ extern float ceilf (float); -/* SYSCALLS.c:391:NC */ extern speed_t cfgetispeed (const struct termios *); -/* SYSCALLS.c:392:NC */ extern speed_t cfgetospeed (const struct termios *); -/* SYSCALLS.c:393:NC */ extern void cfree (void *); -/* SYSCALLS.c:394:NC */ extern int cfsetispeed (struct termios *, speed_t); -/* SYSCALLS.c:395:NC */ extern int cfsetospeed (struct termios *, speed_t); -/* SYSCALLS.c:396:NC */ extern int cftime (char *, char *, const time_t *); -/* SYSCALLS.c:397:NC */ extern int chdir (const char *); -/* SYSCALLS.c:398:NC */ extern int chmod (const char *, mode_t); -/* SYSCALLS.c:399:NC */ extern int chown (const char *, uid_t, gid_t); -/* SYSCALLS.c:400:NC */ extern int chroot (const char *); -/* SYSCALLS.c:401:OC */ extern void clean_GEN_rd (/* ??? */); -/* SYSCALLS.c:402:OC */ extern void cleanup (/* ??? */); -/* SYSCALLS.c:403:NC */ extern void clearerr (FILE *); -/* SYSCALLS.c:404:NC */ extern int clearok (WINDOW *, int); -/* SYSCALLS.c:405:NC */ extern enum clnt_stat clnt_broadcast (long unsigned int, long unsigned int, long unsigned int, xdrproc_t, char *, xdrproc_t, char *, resultproc_t); -/* SYSCALLS.c:406:NC */ extern enum clnt_stat clnt_call (CLIENT *, long unsigned int, xdrproc_t, char *, xdrproc_t, char *, struct timeval); -/* SYSCALLS.c:407:NC */ extern bool_t clnt_control (CLIENT *, int, char *); -/* SYSCALLS.c:408:NC */ extern CLIENT *clnt_create (char *, long unsigned int, long unsigned int, char *); -/* SYSCALLS.c:409:NC */ extern void clnt_destroy (CLIENT *); -/* SYSCALLS.c:410:NC */ extern int clnt_freeres (CLIENT *, xdrproc_t, char *); -/* SYSCALLS.c:411:NC */ extern void clnt_geterr (CLIENT *, struct rpc_err *); -/* SYSCALLS.c:412:NC */ extern void clnt_pcreateerror (char *); -/* SYSCALLS.c:413:NC */ extern void clnt_perrno (enum clnt_stat); -/* SYSCALLS.c:414:NC */ extern void clnt_perror (CLIENT *, char *); -/* SYSCALLS.c:415:NC */ extern char *clnt_spcreateerror (char *); -/* SYSCALLS.c:416:NC */ extern char *clnt_sperrno (enum clnt_stat); -/* SYSCALLS.c:417:NC */ extern char *clnt_sperror (CLIENT *, char *); -/* SYSCALLS.c:418:OC */ extern CLIENT *clnt_tli_create (/* ??? */); -/* SYSCALLS.c:419:OC */ extern CLIENT *clnt_tp_create (/* ??? */); -/* SYSCALLS.c:420:OC */ extern CLIENT *clnt_vc_create (/* ??? */); -/* SYSCALLS.c:421:NC */ extern CLIENT *clntraw_create (long unsigned int, long unsigned int); -/* SYSCALLS.c:422:NC */ extern CLIENT *clnttcp_create (struct sockaddr_in *, long unsigned int, long unsigned int, int *, unsigned int, unsigned int *); -/* SYSCALLS.c:423:NC */ extern CLIENT *clntudp_bufcreate (struct sockaddr_in *, long unsigned int, long unsigned int, struct timeval, int *, unsigned int, unsigned int); -/* SYSCALLS.c:424:NC */ extern CLIENT *clntudp_create (struct sockaddr_in *, long unsigned int, long unsigned int, struct timeval, int *); -/* SYSCALLS.c:425:NC */ extern clock_t clock (void); -/* SYSCALLS.c:426:NC */ extern int close (int); -/* SYSCALLS.c:427:NC */ extern int closedir (DIR *); -/* SYSCALLS.c:428:NC */ extern int color_content (int, short int *, short int *, short int *); -/* SYSCALLS.c:429:NC */ extern char *compile (const char *, char *, char *); -/* SYSCALLS.c:430:NC */ extern char *copylist (const char *, off_t *); -/* SYSCALLS.c:431:NC */ extern double copysign (double, double); -/* SYSCALLS.c:432:NC */ extern int copywin (WINDOW *, WINDOW *, int, int, int, int, int, int, int); -/* SYSCALLS.c:433:NC */ extern double cos (double); -/* SYSCALLS.c:434:NC */ extern float cosf (float); -/* SYSCALLS.c:435:NC */ extern double cosh (double); -/* SYSCALLS.c:436:NC */ extern float coshf (float); -/* SYSCALLS.c:437:OC */ extern struct rd_user *cr_rduser (/* ??? */); -/* SYSCALLS.c:438:NC */ extern int creat (const char *, mode_t); -/* SYSCALLS.c:439:NC */ extern int crmode (void); -/* SYSCALLS.c:440:NC */ extern char *crypt (const char *, const char *); -/* SYSCALLS.c:441:NC */ extern int crypt_close (int *); -/* SYSCALLS.c:442:NC */ extern char *ctermid (char *); -/* SYSCALLS.c:443:NC */ extern char *ctime (const time_t *); -/* SYSCALLS.c:444:NC */ extern FIELD *current_field (FORM *); -/* SYSCALLS.c:445:NC */ extern ITEM *current_item (MENU *); -/* SYSCALLS.c:446:NC */ extern int curs_set (int); -/* SYSCALLS.c:447:NC */ extern void curserr (void); -/* SYSCALLS.c:448:NC */ extern char *cuserid (char *); -/* SYSCALLS.c:449:NC */ extern int data_ahead (FORM *); -/* SYSCALLS.c:450:NC */ extern int data_behind (FORM *); -/* SYSCALLS.c:451:NC */ extern void dbmclose (void); -/* SYSCALLS.c:452:NC */ extern void dbminit (const char *); -/* SYSCALLS.c:453:NC */ extern int def_prog_mode (void); -/* SYSCALLS.c:454:NC */ extern int def_shell_mode (void); -/* SYSCALLS.c:455:OC */ extern char *defread (/* ??? */); -/* SYSCALLS.c:456:NC */ extern int del_panel (PANEL *); -/* SYSCALLS.c:457:OC */ extern void del_rduser (/* ??? */); -/* SYSCALLS.c:458:NC */ extern void delay (long int); -/* SYSCALLS.c:459:NC */ extern int delay_output (int); -/* SYSCALLS.c:460:NC */ extern void delete (datum); -/* SYSCALLS.c:461:NC */ extern void delscreen (SCREEN *); -/* SYSCALLS.c:462:NC */ extern int delterm (TERMINAL *); -/* SYSCALLS.c:463:NC */ extern int delwin (WINDOW *); -/* SYSCALLS.c:464:NC */ extern WINDOW *derwin (WINDOW *, int, int, int, int); -/* SYSCALLS.c:465:NC */ extern char *des_crypt (const char *, const char *); -/* SYSCALLS.c:466:NC */ extern void des_encrypt (char *, int); -/* SYSCALLS.c:467:NC */ extern void des_setkey (const char *); -/* SYSCALLS.c:468:OC */ extern char *devattr (/* ??? */); -/* SYSCALLS.c:469:OC */ extern int devfree (/* ??? */); -/* SYSCALLS.c:470:OC */ extern char **devreserv (/* ??? */); -/* SYSCALLS.c:471:NC */ extern int dial (CALL); -/* SYSCALLS.c:472:NC */ extern double difftime (time_t, time_t); -/* SYSCALLS.c:473:NC */ extern char *dirname (char *); -/* SYSCALLS.c:474:NC */ extern div_t div (int, int); -/* SYSCALLS.c:475:NC */ extern int dlclose (void *); -/* SYSCALLS.c:476:NC */ extern char *dlerror (void); -/* SYSCALLS.c:477:NC */ extern void *dlopen (char *, int); -/* SYSCALLS.c:478:NC */ extern void *dlsym (void *, char *); -/* SYSCALLS.c:479:NC */ extern void dma_access (u_char, u_int, u_int, u_char, u_char); -/* SYSCALLS.c:480:NC */ extern int doupdate (void); -/* SYSCALLS.c:481:NC */ extern int drainio (int); -/* SYSCALLS.c:482:NC */ extern double drand48 (void); -/* SYSCALLS.c:483:NC */ extern double drem (double, double); -/* SYSCALLS.c:484:OC */ extern int drv_getevtoken (/* ??? */); -/* SYSCALLS.c:485:OC */ extern void drv_relevtoken (/* ??? */); -/* SYSCALLS.c:486:NC */ extern int dup (int); -/* SYSCALLS.c:487:NC */ extern int dup2 (int, int); -/* SYSCALLS.c:488:NC */ extern FIELD *dup_field (FIELD *, int, int); -/* SYSCALLS.c:489:NC */ extern WINDOW *dupwin (WINDOW *); -/* SYSCALLS.c:490:NC */ extern int dynamic_field_info (FIELD *, int *, int *, int *); -/* SYSCALLS.c:491:NC */ extern int dysize (int); -/* SYSCALLS.c:492:NC */ extern int eaccess (const char *, int); -/* SYSCALLS.c:493:NC */ extern int echo (void); -/* SYSCALLS.c:494:NC */ extern char *ecvt (double, int, int *, int *); -/* SYSCALLS.c:495:NC */ extern size_t elf32_fsize (Elf_Type, size_t, unsigned int); -/* SYSCALLS.c:496:NC */ extern Elf32_Ehdr *elf32_getehdr (Elf *); -/* SYSCALLS.c:497:NC */ extern Elf32_Phdr *elf32_getphdr (Elf *); -/* SYSCALLS.c:498:NC */ extern Elf32_Shdr *elf32_getshdr (Elf_Scn *); -/* SYSCALLS.c:499:NC */ extern Elf32_Ehdr *elf32_newehdr (Elf *); -/* SYSCALLS.c:500:NC */ extern Elf32_Phdr *elf32_newphdr (Elf *, size_t); -/* SYSCALLS.c:501:NC */ extern Elf_Data *elf32_xlatetof (Elf_Data *, const Elf_Data *, unsigned int); -/* SYSCALLS.c:502:NC */ extern Elf_Data *elf32_xlatetom (Elf_Data *, const Elf_Data *, unsigned int); -/* SYSCALLS.c:503:NC */ extern Elf *elf_begin (int, Elf_Cmd, Elf *); -/* SYSCALLS.c:504:NC */ extern int elf_cntl (Elf *, Elf_Cmd); -/* SYSCALLS.c:505:NC */ extern int elf_end (Elf *); -/* SYSCALLS.c:506:NC */ extern const char *elf_errmsg (int); -/* SYSCALLS.c:507:NC */ extern int elf_errno (void); -/* SYSCALLS.c:508:NC */ extern void elf_fill (int); -/* SYSCALLS.c:509:NC */ extern unsigned int elf_flagdata (Elf_Data *, Elf_Cmd, unsigned int); -/* SYSCALLS.c:510:NC */ extern unsigned int elf_flagehdr (Elf *, Elf_Cmd, unsigned int); -/* SYSCALLS.c:511:NC */ extern unsigned int elf_flagelf (Elf *, Elf_Cmd, unsigned int); -/* SYSCALLS.c:512:NC */ extern unsigned int elf_flagphdr (Elf *, Elf_Cmd, unsigned int); -/* SYSCALLS.c:513:NC */ extern unsigned int elf_flagscn (Elf_Scn *, Elf_Cmd, unsigned int); -/* SYSCALLS.c:514:NC */ extern unsigned int elf_flagshdr (Elf_Scn *, Elf_Cmd, unsigned int); -/* SYSCALLS.c:515:NC */ extern Elf_Arhdr *elf_getarhdr (Elf *); -/* SYSCALLS.c:516:NC */ extern Elf_Arsym *elf_getarsym (Elf *, size_t *); -/* SYSCALLS.c:517:NC */ extern off_t elf_getbase (Elf *); -/* SYSCALLS.c:518:NC */ extern Elf_Data *elf_getdata (Elf_Scn *, Elf_Data *); -/* SYSCALLS.c:519:NC */ extern char *elf_getident (Elf *, size_t *); -/* SYSCALLS.c:520:NC */ extern Elf_Scn *elf_getscn (Elf *, size_t); -/* SYSCALLS.c:521:NC */ extern long unsigned int elf_hash (const char *); -/* SYSCALLS.c:522:NC */ extern Elf_Kind elf_kind (Elf *); -/* SYSCALLS.c:523:NC */ extern size_t elf_ndxscn (Elf_Scn *); -/* SYSCALLS.c:524:NC */ extern Elf_Data *elf_newdata (Elf_Scn *); -/* SYSCALLS.c:525:NC */ extern Elf_Scn *elf_newscn (Elf *); -/* SYSCALLS.c:526:NC */ extern Elf_Cmd elf_next (Elf *); -/* SYSCALLS.c:527:NC */ extern Elf_Scn *elf_nextscn (Elf *, Elf_Scn *); -/* SYSCALLS.c:528:NC */ extern size_t elf_rand (Elf *, size_t); -/* SYSCALLS.c:529:NC */ extern Elf_Data *elf_rawdata (Elf_Scn *, Elf_Data *); -/* SYSCALLS.c:530:NC */ extern char *elf_rawfile (Elf *, size_t *); -/* SYSCALLS.c:531:NC */ extern char *elf_strptr (Elf *, size_t, size_t); -/* SYSCALLS.c:532:NC */ extern off_t elf_update (Elf *, Elf_Cmd); -/* SYSCALLS.c:533:NC */ extern unsigned int elf_version (unsigned int); -/* SYSCALLS.c:534:NC */ extern void encrypt (char *, int); -/* SYSCALLS.c:535:NC */ extern void endgrent (void); -/* SYSCALLS.c:536:NC */ extern int endnetconfig (void *); -/* SYSCALLS.c:537:NC */ extern int endnetpath (void *); -/* SYSCALLS.c:538:NC */ extern void endpwent (void); -/* SYSCALLS.c:539:NC */ extern void endrpcent (void); -/* SYSCALLS.c:540:NC */ extern void endspent (void); -/* SYSCALLS.c:541:NC */ extern void endutent (void); -/* SYSCALLS.c:542:NC */ extern void endutxent (void); -/* SYSCALLS.c:543:NC */ extern int endwin (void); -/* SYSCALLS.c:544:NC */ extern double erand (short int *); -/* SYSCALLS.c:545:NC */ extern double erand48 (short unsigned int *); -/* SYSCALLS.c:546:NC */ extern char erasechar (void); -/* SYSCALLS.c:547:NC */ extern double erf (double); -/* SYSCALLS.c:548:NC */ extern double erfc (double); -/* SYSCALLS.c:549:NC */ extern int execl (const char *, const char *, ...); -/* SYSCALLS.c:550:NC */ extern int execle (const char *, const char *, ...); -/* SYSCALLS.c:551:NC */ extern int execlp (const char *, const char *, ...); -/* SYSCALLS.c:552:NC */ extern int exect (const char *, const char **, char **); -/* SYSCALLS.c:553:NC */ extern int execv (const char *, char *const *); -/* SYSCALLS.c:554:NC */ extern int execve (const char *, char *const *, char *const *); -/* SYSCALLS.c:555:NC */ extern int execvp (const char *, char *const *); -/* SYSCALLS.c:556:NC */ extern void exit (int); -/* SYSCALLS.c:557:NC */ extern double exp (double); -/* SYSCALLS.c:558:NC */ extern float expf (float); -/* SYSCALLS.c:559:NC */ extern double fabs (double); -/* SYSCALLS.c:560:NC */ extern float fabsf (float); -/* SYSCALLS.c:561:NC */ extern int fattach (int, const char *); -/* SYSCALLS.c:562:NC */ extern int fchdir (int); -/* SYSCALLS.c:563:NC */ extern int fchmod (int, mode_t); -/* SYSCALLS.c:564:NC */ extern int fchown (int, uid_t, gid_t); -/* SYSCALLS.c:565:NC */ extern int fclose (FILE *); -/* SYSCALLS.c:566:NC */ extern int fcntl (int, int, ...); -/* SYSCALLS.c:567:NC */ extern char *fcvt (double, int, int *, int *); -/* SYSCALLS.c:568:NC */ extern int fdetach (const char *); -/* SYSCALLS.c:569:NC */ extern FILE *fdopen (int, const char *); -/* SYSCALLS.c:570:NC */ extern int feof (FILE *); -/* SYSCALLS.c:571:NC */ extern int ferror (FILE *); -/* SYSCALLS.c:572:NC */ extern datum fetch (datum); -/* SYSCALLS.c:573:NC */ extern int fflush (FILE *); -/* SYSCALLS.c:574:NC */ extern int ffs (int); -/* SYSCALLS.c:575:NC */ extern int fgetc (FILE *); -/* SYSCALLS.c:576:NC */ extern struct group *fgetgrent (FILE *); -/* SYSCALLS.c:577:NC */ extern int fgetpos (FILE *, fpos_t *); -/* SYSCALLS.c:578:NC */ extern struct passwd *fgetpwent (FILE *); -/* SYSCALLS.c:579:NC */ extern char *fgets (char *, int, FILE *); -/* SYSCALLS.c:580:NC */ extern struct spwd *fgetspent (FILE *); -/* SYSCALLS.c:581:NC */ extern char *field_arg (FIELD *); -/* SYSCALLS.c:582:NC */ extern chtype field_back (FIELD *); -/* SYSCALLS.c:583:NC */ extern char *field_buffer (FIELD *, int); -/* SYSCALLS.c:584:NC */ extern int field_count (FORM *); -/* SYSCALLS.c:585:NC */ extern chtype field_fore (FIELD *); -/* SYSCALLS.c:586:NC */ extern int field_index (FIELD *); -/* SYSCALLS.c:587:NC */ extern int field_info (FIELD *, int *, int *, int *, int *, int *, int *); -/* SYSCALLS.c:588:NC */ extern PTF_void field_init (FORM *); -/* SYSCALLS.c:589:NC */ extern int field_just (FIELD *); -/* SYSCALLS.c:590:NC */ extern OPTIONS field_opts (FIELD *); -/* SYSCALLS.c:591:NC */ extern int field_opts_off (FIELD *, OPTIONS); -/* SYSCALLS.c:592:NC */ extern int field_opts_on (FIELD *, OPTIONS); -/* SYSCALLS.c:593:NC */ extern int field_pad (FIELD *); -/* SYSCALLS.c:594:NC */ extern int field_status (FIELD *); -/* SYSCALLS.c:595:NC */ extern PTF_void field_term (FORM *); -/* SYSCALLS.c:596:NC */ extern FIELDTYPE *field_type (FIELD *); -/* SYSCALLS.c:597:NC */ extern char *field_userptr (FIELD *); -/* SYSCALLS.c:598:NC */ extern int fileno (FILE *); -/* SYSCALLS.c:599:NC */ extern int filter (void); -/* SYSCALLS.c:600:NC */ extern int finite (double); -/* SYSCALLS.c:601:OC */ extern datum firsthash (/* ??? */); -/* SYSCALLS.c:602:NC */ extern datum firstkey (void); -/* SYSCALLS.c:603:NC */ extern int flash (void); -/* SYSCALLS.c:604:NC */ extern int flock (int, int); -/* SYSCALLS.c:605:NC */ extern double floor (double); -/* SYSCALLS.c:606:NC */ extern float floorf (float); -/* SYSCALLS.c:607:NC */ extern int flushinp (void); -/* SYSCALLS.c:608:NC */ extern double fmod (double, double); -/* SYSCALLS.c:609:NC */ extern float fmodf (float, float); -/* SYSCALLS.c:610:NC */ extern int fmtmsg (long int, const char *, int, const char *, const char *, const char *); -/* SYSCALLS.c:611:NC */ extern FILE *fopen (const char *, const char *); -/* SYSCALLS.c:612:NC */ extern pid_t fork (void); -/* SYSCALLS.c:613:NC */ extern int form_driver (FORM *, int); -/* SYSCALLS.c:614:NC */ extern FIELD **form_fields (FORM *); -/* SYSCALLS.c:615:NC */ extern PTF_void form_init (FORM *); -/* SYSCALLS.c:616:NC */ extern OPTIONS form_opts (FORM *); -/* SYSCALLS.c:617:NC */ extern int form_opts_off (FORM *, OPTIONS); -/* SYSCALLS.c:618:NC */ extern int form_opts_on (FORM *, OPTIONS); -/* SYSCALLS.c:619:NC */ extern int form_page (FORM *); -/* SYSCALLS.c:620:NC */ extern WINDOW *form_sub (FORM *); -/* SYSCALLS.c:621:NC */ extern PTF_void form_term (FORM *); -/* SYSCALLS.c:622:NC */ extern char *form_userptr (FORM *); -/* SYSCALLS.c:623:NC */ extern WINDOW *form_win (FORM *); -/* SYSCALLS.c:624:NC */ extern long int fpathconf (int, int); -/* SYSCALLS.c:625:NC */ extern fpclass_t fpclass (double); -/* SYSCALLS.c:626:NC */ extern int fpgetmask (void); -/* SYSCALLS.c:627:NC */ extern fp_rnd fpgetround (void); -/* SYSCALLS.c:628:NC */ extern int fpgetsticky (void); -/* SYSCALLS.c:629:NC */ extern int fprintf (FILE *, const char *, ...); -/* SYSCALLS.c:630:NC */ extern int fpsetmask (int); -/* SYSCALLS.c:631:NC */ extern fp_rnd fpsetround (fp_rnd); -/* SYSCALLS.c:632:NC */ extern int fpsetsticky (int); -/* SYSCALLS.c:633:NC */ extern int fputc (int, FILE *); -/* SYSCALLS.c:634:NC */ extern int fputs (const char *, FILE *); -/* SYSCALLS.c:635:NC */ extern size_t fread (void *, size_t, size_t, FILE *); -/* SYSCALLS.c:636:NC */ extern void free (void *); -/* SYSCALLS.c:637:NC */ extern int free_field (FIELD *); -/* SYSCALLS.c:638:NC */ extern int free_fieldtype (FIELDTYPE *); -/* SYSCALLS.c:639:NC */ extern int free_form (FORM *); -/* SYSCALLS.c:640:NC */ extern int free_item (ITEM *); -/* SYSCALLS.c:641:NC */ extern int free_menu (MENU *); -/* SYSCALLS.c:642:NC */ extern void freenetconfigent (struct netconfig *); -/* SYSCALLS.c:643:NC */ extern FILE *freopen (const char *, const char *, FILE *); -/* SYSCALLS.c:644:NC */ extern double frexp (double, int *); -/* SYSCALLS.c:645:NC */ extern int fscanf (FILE *, const char *, ...); -/* SYSCALLS.c:646:NC */ extern int fseek (FILE *, long int, int); -/* SYSCALLS.c:647:NC */ extern int fsetpos (FILE *, const fpos_t *); -/* SYSCALLS.c:648:NC */ extern int fstat (int, struct stat *); -/* SYSCALLS.c:649:NC */ extern int fstatfs (int, struct statfs *, int, int); -/* SYSCALLS.c:650:NC */ extern int fstatvfs (int, struct statvfs *); -/* SYSCALLS.c:651:NC */ extern int fsync (int); -/* SYSCALLS.c:652:NC */ extern long int ftell (FILE *); -/* SYSCALLS.c:653:NC */ extern key_t ftok (const char *, int); -/* SYSCALLS.c:654:NC */ extern int ftruncate (int, off_t); -/* SYSCALLS.c:655:NC */ extern int ftw (const char *, int (*) (const char *, const struct stat *, int), int); -/* SYSCALLS.c:656:NC */ extern size_t fwrite (const void *, size_t, size_t, FILE *); -/* SYSCALLS.c:657:NC */ extern double gamma (double); -/* SYSCALLS.c:658:NC */ extern char *gcvt (double, int, char *); -/* SYSCALLS.c:659:OC */ extern int get_error (/* ??? */); -/* SYSCALLS.c:660:NC */ extern chtype getattrs (WINDOW *); -/* SYSCALLS.c:661:NC */ extern int getbegx (WINDOW *); -/* SYSCALLS.c:662:NC */ extern int getbegy (WINDOW *); -/* SYSCALLS.c:663:NC */ extern chtype getbkgd (WINDOW *); -/* SYSCALLS.c:664:NC */ extern long unsigned int getbmap (void); -/* SYSCALLS.c:665:NC */ extern int getc (FILE *); -/* SYSCALLS.c:666:OC */ extern char *getcap (/* ??? */); -/* SYSCALLS.c:667:NC */ extern int getchar (void); -/* SYSCALLS.c:668:NC */ extern int getcontext (ucontext_t *); -/* SYSCALLS.c:669:NC */ extern int getcurx (WINDOW *); -/* SYSCALLS.c:670:NC */ extern int getcury (WINDOW *); -/* SYSCALLS.c:671:NC */ extern char *getcwd (char *, size_t); -/* SYSCALLS.c:672:NC */ extern struct tm *getdate (const char *); -/* SYSCALLS.c:673:NC */ extern int getdents (int, struct dirent *, unsigned int); -/* SYSCALLS.c:674:OC */ extern char **getdev (/* ??? */); -/* SYSCALLS.c:675:OC */ extern char **getdgrp (/* ??? */); -/* SYSCALLS.c:676:NC */ extern int getdomainname (char *, int); -/* SYSCALLS.c:677:NC */ extern int getdtablesize (void); -/* SYSCALLS.c:678:NC */ extern gid_t getegid (void); -/* SYSCALLS.c:679:NC */ extern char *getenv (const char *); -/* SYSCALLS.c:680:OC */ extern struct errhdr *geterec (/* ??? */); -/* SYSCALLS.c:681:OC */ extern struct errhdr *geteslot (/* ??? */); -/* SYSCALLS.c:682:NC */ extern uid_t geteuid (void); -/* SYSCALLS.c:683:NC */ extern gid_t getgid (void); -/* SYSCALLS.c:684:NC */ extern struct group *getgrent (void); -/* SYSCALLS.c:685:NC */ extern struct group *getgrgid (gid_t); -/* SYSCALLS.c:686:NC */ extern struct group *getgrnam (const char *); -/* SYSCALLS.c:687:NC */ extern int getgroups (int, gid_t *); -/* SYSCALLS.c:688:OC */ extern struct hostent *gethostbyaddr (/* ??? */); -/* SYSCALLS.c:689:OC */ extern struct hostent *gethostbyname (/* ??? */); -/* SYSCALLS.c:690:OC */ extern struct hostent *gethostent (/* ??? */); -/* SYSCALLS.c:694:NC */ extern long int gethostid (void); -/* SYSCALLS.c:696:NC */ extern int gethostname (char *, size_t); -/* SYSCALLS.c:697:NC */ extern int getitimer (int, struct itimerval *); -/* SYSCALLS.c:698:NC */ extern char *getlogin (void); -/* SYSCALLS.c:699:NC */ extern int getmaxx (WINDOW *); -/* SYSCALLS.c:700:NC */ extern int getmaxy (WINDOW *); -/* SYSCALLS.c:701:NC */ extern int getmntany (FILE *, struct mnttab *, struct mnttab *); -/* SYSCALLS.c:702:OC */ extern int getmntent (/* ??? */); -/* SYSCALLS.c:703:NC */ extern long unsigned int getmouse (void); -/* SYSCALLS.c:704:NC */ extern int getmsg (int, struct strbuf *, struct strbuf *, int *); -/* SYSCALLS.c:705:OC */ extern struct netent *getnetbyaddr (/* ??? */); -/* SYSCALLS.c:706:OC */ extern struct netent *getnetbyname (/* ??? */); -/* SYSCALLS.c:707:NC */ extern struct netconfig *getnetconfig (void *); -/* SYSCALLS.c:708:NC */ extern struct netconfig *getnetconfigent (char *); -/* SYSCALLS.c:709:OC */ extern struct netent *getnetent (/* ??? */); -/* SYSCALLS.c:710:NC */ extern struct netconfig *getnetpath (void *); -/* SYSCALLS.c:711:NC */ extern int getopt (int, char *const *, const char *); -/* SYSCALLS.c:712:NC */ extern int getpagesize (void); -/* SYSCALLS.c:713:NC */ extern int getparx (WINDOW *); -/* SYSCALLS.c:714:NC */ extern int getpary (WINDOW *); -/* SYSCALLS.c:715:NC */ extern char *getpass (const char *); -/* SYSCALLS.c:716:NC */ extern pid_t getpgid (pid_t); -/* SYSCALLS.c:717:NC */ extern pid_t getpgrp (void); -/* SYSCALLS.c:718:NC */ extern pid_t getpgrp2 (pid_t); -/* SYSCALLS.c:719:NC */ extern pid_t getpid (void); -/* SYSCALLS.c:720:NC */ extern int getpmsg (int, struct strbuf *, struct strbuf *, int *, int *); -/* SYSCALLS.c:721:NC */ extern pid_t getppid (void); -/* SYSCALLS.c:722:NC */ extern int getpriority (int, int); -/* SYSCALLS.c:723:OC */ extern struct protoent *getprotobyname (/* ??? */); -/* SYSCALLS.c:724:OC */ extern struct protoent *getprotobynumber (/* ??? */); -/* SYSCALLS.c:725:OC */ extern struct protoent *getprotoent (/* ??? */); -/* SYSCALLS.c:726:NC */ extern int getpw (int, char *); -/* SYSCALLS.c:727:NC */ extern struct passwd *getpwent (void); -/* SYSCALLS.c:728:NC */ extern struct passwd *getpwnam (const char *); -/* SYSCALLS.c:729:NC */ extern struct passwd *getpwuid (uid_t); -/* SYSCALLS.c:730:NC */ extern int getrlimit (int, struct rlimit *); -/* SYSCALLS.c:731:NC */ extern int getrnge (char *); -/* SYSCALLS.c:732:NC */ extern struct rpcent *getrpcbyname (const char *); -/* SYSCALLS.c:733:NC */ extern struct rpcent *getrpcbynumber (int); -/* SYSCALLS.c:734:NC */ extern struct rpcent *getrpcent (void); -/* SYSCALLS.c:735:NC */ extern int getrusage (int, struct rusage *); -/* SYSCALLS.c:736:NC */ extern char *gets (char *); -/* SYSCALLS.c:737:OC */ extern struct servent *getservbyname (/* ??? */); -/* SYSCALLS.c:738:OC */ extern struct servent *getservbyport (/* ??? */); -/* SYSCALLS.c:739:OC */ extern struct servent *getservent (/* ??? */); -/* SYSCALLS.c:740:NC */ extern pid_t getsid (pid_t); -/* SYSCALLS.c:741:NC */ extern struct spwd *getspent (void); -/* SYSCALLS.c:742:NC */ extern struct spwd *getspnam (const char *); -/* SYSCALLS.c:743:NC */ extern int getsubopt (char **, char *const *, char **); -/* SYSCALLS.c:744:NC */ extern int gettmode (void); -/* SYSCALLS.c:745:NC */ extern char *gettxt (const char *, const char *); -/* SYSCALLS.c:746:NC */ extern uid_t getuid (void); -/* SYSCALLS.c:747:NC */ extern struct utmp *getutent (void); -/* SYSCALLS.c:748:NC */ extern struct utmp *getutid (const struct utmp *); -/* SYSCALLS.c:749:NC */ extern struct utmp *getutline (const struct utmp *); -/* SYSCALLS.c:750:NC */ extern void getutmp (const struct utmpx *, struct utmp *); -/* SYSCALLS.c:751:NC */ extern void getutmpx (const struct utmp *, struct utmpx *); -/* SYSCALLS.c:752:NC */ extern struct utmpx *getutxent (void); -/* SYSCALLS.c:753:NC */ extern struct utmpx *getutxid (const struct utmpx *); -/* SYSCALLS.c:754:NC */ extern struct utmpx *getutxline (const struct utmpx *); -/* SYSCALLS.c:755:NC */ extern int getvfsany (FILE *, struct vfstab *, struct vfstab *); -/* SYSCALLS.c:756:NC */ extern int getvfsent (FILE *, struct vfstab *); -/* SYSCALLS.c:757:NC */ extern int getvfsfile (FILE *, struct vfstab *, char *); -/* SYSCALLS.c:758:NC */ extern int getvfsspec (FILE *, struct vfstab *, char *); -/* SYSCALLS.c:759:OC */ extern int getvol (/* ??? */); -/* SYSCALLS.c:760:NC */ extern int getw (FILE *); -/* SYSCALLS.c:761:NC */ extern char *getwd (char *); -/* SYSCALLS.c:762:NC */ extern void getwidth (eucwidth_t *); -/* SYSCALLS.c:763:NC */ extern WINDOW *getwin (FILE *); -/* SYSCALLS.c:764:NC */ extern int gmatch (const char *, const char *); -/* SYSCALLS.c:765:NC */ extern struct tm *gmtime (const time_t *); -/* SYSCALLS.c:766:NC */ extern int gsignal (int); -/* SYSCALLS.c:767:NC */ extern int halfdelay (int); -/* SYSCALLS.c:768:NC */ extern bool has_colors (void); -/* SYSCALLS.c:769:NC */ extern int has_ic (void); -/* SYSCALLS.c:770:NC */ extern int has_il (void); -/* SYSCALLS.c:771:OC */ extern long int hashinc (/* ??? */); -/* SYSCALLS.c:772:OC */ extern char *hasmntopt (/* ??? */); -/* SYSCALLS.c:773:NC */ extern int hcreate (size_t); -/* SYSCALLS.c:774:NC */ extern void hdestroy (void); -/* SYSCALLS.c:775:NC */ extern int hide_panel (PANEL *); -/* SYSCALLS.c:776:NC */ extern int host2netname (char *, char *, char *); -/* SYSCALLS.c:777:NC */ extern int hrtalarm (hrtcmd_t *, int); -/* SYSCALLS.c:778:NC */ extern int hrtcancel (const long int *, int); -/* SYSCALLS.c:779:NC */ extern int hrtcntl (int, int, interval_t *, hrtime_t *); -/* SYSCALLS.c:780:NC */ extern int hrtsleep (hrtcmd_t *); -/* SYSCALLS.c:781:NC */ extern ENTRY *hsearch (ENTRY, ACTION); -/* SYSCALLS.c:782:NC */ extern long unsigned int htonl (long unsigned int); -/* SYSCALLS.c:783:NC */ extern short unsigned int htons (unsigned int); -/* SYSCALLS.c:784:NC */ extern double hypot (double, double); -/* SYSCALLS.c:785:NC */ extern void idcok (WINDOW *, int); -/* SYSCALLS.c:786:NC */ extern int idlok (WINDOW *, int); -/* SYSCALLS.c:787:NC */ extern void immedok (WINDOW *, int); -/* SYSCALLS.c:788:NC */ extern char *index (const char *, int); -/* SYSCALLS.c:789:OC */ extern long unsigned int inet_addr (/* ??? */); -/* SYSCALLS.c:790:OC */ extern struct in_addr inet_makeaddr (/* ??? */); -/* SYSCALLS.c:791:OC */ extern long unsigned int inet_network (/* ??? */); -/* SYSCALLS.c:792:OC */ extern char *inet_ntoa (/* ??? */); -/* SYSCALLS.c:793:NC */ extern int init_color (int, int, int, int); -/* SYSCALLS.c:794:NC */ extern int init_pair (int, int, int); -/* SYSCALLS.c:795:NC */ extern int initgroups (const char *, gid_t); -/* SYSCALLS.c:796:OC */ extern WINDOW *initscr (/* ??? */); -/* SYSCALLS.c:797:NC */ extern WINDOW *initscr32 (void); -/* SYSCALLS.c:798:NC */ extern char *initstate (unsigned int, char *, int); -/* SYSCALLS.c:799:NC */ extern void insque (struct qelem *, struct qelem *); -/* SYSCALLS.c:800:NC */ extern int intrflush (WINDOW *, int); -/* SYSCALLS.c:801:NC */ extern int ioctl (int, int, ...); -/* SYSCALLS.c:802:NC */ extern int is_linetouched (WINDOW *, int); -/* SYSCALLS.c:803:NC */ extern int is_wintouched (WINDOW *); -/* SYSCALLS.c:804:NC */ extern int isalnum (int); -/* SYSCALLS.c:805:NC */ extern int isalpha (int); -/* SYSCALLS.c:806:NC */ extern int isascii (int); -/* SYSCALLS.c:807:NC */ extern int isatty (int); -/* SYSCALLS.c:808:NC */ extern int iscntrl (int); -/* SYSCALLS.c:809:NC */ extern int isdigit (int); -/* SYSCALLS.c:810:NC */ extern int isencrypt (const char *, size_t); -/* SYSCALLS.c:811:NC */ extern int isendwin (void); -/* SYSCALLS.c:812:NC */ extern int isgraph (int); -/* SYSCALLS.c:813:NC */ extern int isinf (double); -/* SYSCALLS.c:814:NC */ extern int islower (int); -/* SYSCALLS.c:815:NC */ extern int isnan (double); -/* SYSCALLS.c:816:NC */ extern int isnand (double); -/* SYSCALLS.c:817:NC */ extern int isnanf (float); -/* SYSCALLS.c:818:NC */ extern int isprint (int); -/* SYSCALLS.c:819:NC */ extern int ispunct (int); -/* SYSCALLS.c:820:NC */ extern int isspace (int); -/* SYSCALLS.c:821:NC */ extern int isupper (int); -/* SYSCALLS.c:822:NC */ extern int isxdigit (int); -/* SYSCALLS.c:823:NC */ extern int item_count (MENU *); -/* SYSCALLS.c:824:NC */ extern char *item_description (ITEM *); -/* SYSCALLS.c:825:NC */ extern int item_index (ITEM *); -/* SYSCALLS.c:826:NC */ extern PTF_void item_init (MENU *); -/* SYSCALLS.c:827:NC */ extern char *item_name (ITEM *); -/* SYSCALLS.c:828:NC */ extern OPTIONS item_opts (ITEM *); -/* SYSCALLS.c:829:NC */ extern int item_opts_off (ITEM *, OPTIONS); -/* SYSCALLS.c:830:NC */ extern int item_opts_on (ITEM *, OPTIONS); -/* SYSCALLS.c:831:NC */ extern PTF_void item_term (MENU *); -/* SYSCALLS.c:832:NC */ extern char *item_userptr (ITEM *); -/* SYSCALLS.c:833:NC */ extern int item_value (ITEM *); -/* SYSCALLS.c:834:NC */ extern int item_visible (ITEM *); -/* SYSCALLS.c:835:OC */ extern long int itol (/* ??? */); -/* SYSCALLS.c:836:NC */ extern double j0 (double); -/* SYSCALLS.c:837:NC */ extern double j1 (double); -/* SYSCALLS.c:838:NC */ extern double jn (int, double); -/* SYSCALLS.c:839:NC */ extern long int jrand48 (short unsigned int *); -/* SYSCALLS.c:840:NC */ extern char *keyname (int); -/* SYSCALLS.c:841:NC */ extern int keypad (WINDOW *, int); -/* SYSCALLS.c:842:NC */ extern int kill (pid_t, int); -/* SYSCALLS.c:843:NC */ extern char killchar (void); -/* SYSCALLS.c:844:NC */ extern int killpg (int, int); -/* SYSCALLS.c:845:NC */ extern void l3tol (long int *, const char *, int); -/* SYSCALLS.c:846:NC */ extern char *l64a (long int); -/* SYSCALLS.c:847:NC */ extern long int labs (long int); -/* SYSCALLS.c:848:OC */ extern dl_t ladd (/* ??? */); -/* SYSCALLS.c:849:NC */ extern int lchown (const char *, uid_t, gid_t); -/* SYSCALLS.c:850:NC */ extern int lckpwdf (void); -/* SYSCALLS.c:851:NC */ extern void lcong48 (short unsigned int *); -/* SYSCALLS.c:852:NC */ extern int ldaclose (struct ldfile *); -/* SYSCALLS.c:853:NC */ extern int ldahread (struct ldfile *, archdr *); -/* SYSCALLS.c:854:NC */ extern struct ldfile *ldaopen (const char *, struct ldfile *); -/* SYSCALLS.c:855:NC */ extern int ldclose (struct ldfile *); -/* SYSCALLS.c:856:NC */ extern double ldexp (double, int); -/* SYSCALLS.c:857:NC */ extern int ldfhread (struct ldfile *, struct filehdr *); -/* SYSCALLS.c:858:NC */ extern char *ldgetname (struct ldfile *, const struct syment *); -/* SYSCALLS.c:859:NC */ extern ldiv_t ldiv (long int, long int); -/* SYSCALLS.c:860:OC */ extern dl_t ldivide (/* ??? */); -/* SYSCALLS.c:861:NC */ extern int ldlinit (struct ldfile *, long int); -/* SYSCALLS.c:862:NC */ extern int ldlitem (struct ldfile *, unsigned int, struct lineno *); -/* SYSCALLS.c:863:NC */ extern int ldlread (struct ldfile *, long int, unsigned int, struct lineno *); -/* SYSCALLS.c:864:NC */ extern int ldlseek (struct ldfile *, unsigned int); -/* SYSCALLS.c:865:NC */ extern int ldnlseek (struct ldfile *, const char *); -/* SYSCALLS.c:866:NC */ extern int ldnrseek (struct ldfile *, const char *); -/* SYSCALLS.c:867:NC */ extern int ldnshread (struct ldfile *, const char *, struct scnhdr *); -/* SYSCALLS.c:868:NC */ extern int ldnsseek (struct ldfile *, const char *); -/* SYSCALLS.c:869:NC */ extern int ldohseek (struct ldfile *); -/* SYSCALLS.c:870:NC */ extern struct ldfile *ldopen (const char *, struct ldfile *); -/* SYSCALLS.c:871:NC */ extern int ldrseek (struct ldfile *, unsigned int); -/* SYSCALLS.c:872:NC */ extern int ldshread (struct ldfile *, unsigned int, struct scnhdr *); -/* SYSCALLS.c:873:NC */ extern int ldsseek (struct ldfile *, unsigned int); -/* SYSCALLS.c:874:NC */ extern long int ldtbindex (struct ldfile *); -/* SYSCALLS.c:875:NC */ extern int ldtbread (struct ldfile *, long int, struct syment *); -/* SYSCALLS.c:876:NC */ extern int ldtbseek (struct ldfile *); -/* SYSCALLS.c:877:NC */ extern int leaveok (WINDOW *, int); -/* SYSCALLS.c:878:OC */ extern dl_t lexp10 (/* ??? */); -/* SYSCALLS.c:879:NC */ extern void *lfind (const void *, const void *, size_t *, size_t, int (*) (const void *, const void *)); -/* SYSCALLS.c:880:NC */ extern double lgamma (double); -/* SYSCALLS.c:881:NC */ extern int link (const char *, const char *); -/* SYSCALLS.c:882:NC */ extern FIELD *link_field (FIELD *, int, int); -/* SYSCALLS.c:883:NC */ extern FIELDTYPE *link_fieldtype (FIELDTYPE *, FIELDTYPE *); -/* SYSCALLS.c:884:OC */ extern char **listdev (/* ??? */); -/* SYSCALLS.c:885:OC */ extern char **listdgrp (/* ??? */); -/* SYSCALLS.c:886:OC */ extern dl_t llog10 (/* ??? */); -/* SYSCALLS.c:887:OC */ extern dl_t lmul (/* ??? */); -/* SYSCALLS.c:888:NC */ extern struct lconv *localeconv (void); -/* SYSCALLS.c:889:NC */ extern struct tm *localtime (const time_t *); -/* SYSCALLS.c:890:NC */ extern int lock (int, int, long int); -/* SYSCALLS.c:891:NC */ extern int lockf (int, int, off_t); -/* SYSCALLS.c:892:NC */ extern double log (double); -/* SYSCALLS.c:893:NC */ extern double log10 (double); -/* SYSCALLS.c:894:NC */ extern float log10f (float); -/* SYSCALLS.c:895:NC */ extern double logb (double); -/* SYSCALLS.c:896:NC */ extern float logf (float); -/* SYSCALLS.c:897:NC */ extern char *logname (void); -/* SYSCALLS.c:898:NC */ extern void longjmp (jmp_buf, int); -/* SYSCALLS.c:899:NC */ extern char *longname (void); -/* SYSCALLS.c:900:NC */ extern long int lrand48 (void); -/* SYSCALLS.c:901:NC */ extern void *lsearch (const void *, void *, size_t *, size_t, int (*) (const void *, const void *)); -/* SYSCALLS.c:902:NC */ extern off_t lseek (int, off_t, int); -/* SYSCALLS.c:903:OC */ extern dl_t lshiftl (/* ??? */); -/* SYSCALLS.c:904:NC */ extern int lstat (const char *, struct stat *); -/* SYSCALLS.c:905:OC */ extern dl_t lsub (/* ??? */); -/* SYSCALLS.c:906:NC */ extern void ltol3 (char *, const long int *, int); -/* SYSCALLS.c:907:NC */ extern int m_addch (int); -/* SYSCALLS.c:908:NC */ extern int m_addstr (char *); -/* SYSCALLS.c:909:NC */ extern int m_clear (void); -/* SYSCALLS.c:910:NC */ extern int m_erase (void); -/* SYSCALLS.c:911:NC */ extern WINDOW *m_initscr (void); -/* SYSCALLS.c:912:NC */ extern int m_move (int, int); -/* SYSCALLS.c:913:NC */ extern SCREEN *m_newterm (char *, FILE *, FILE *); -/* SYSCALLS.c:914:NC */ extern int m_refresh (void); -/* SYSCALLS.c:915:NC */ extern int maillock (char *, int); -/* SYSCALLS.c:916:NC */ extern int mailunlock (void); -/* SYSCALLS.c:917:NC */ extern major_t major (dev_t); -/* SYSCALLS.c:918:OC */ extern datum makdatum (/* ??? */); -/* SYSCALLS.c:919:NC */ extern void makecontext (ucontext_t *, void (*) (/* ??? */), int, ...); -/* SYSCALLS.c:920:NC */ extern dev_t makedev (major_t, minor_t); -/* SYSCALLS.c:921:NC */ extern struct utmpx *makeutx (const struct utmpx *); -/* SYSCALLS.c:922:NC */ extern struct mallinfo mallinfo (void); -/* SYSCALLS.c:923:NC */ extern void *malloc (size_t); -/* SYSCALLS.c:924:NC */ extern int mallopt (int, int); -/* SYSCALLS.c:925:NC */ extern int map_button (long unsigned int); -/* SYSCALLS.c:926:NC */ extern int matherr (struct exception *); -/* SYSCALLS.c:927:NC */ extern int mbftowc (char *, wchar_t *, int (*) (/* ??? */), int *); -/* SYSCALLS.c:928:NC */ extern int mblen (const char *, size_t); -/* SYSCALLS.c:929:NC */ extern size_t mbstowcs (wchar_t *, const char *, size_t); -/* SYSCALLS.c:930:NC */ extern int mbtowc (wchar_t *, const char *, size_t); -/* SYSCALLS.c:931:NC */ extern void *memalign (size_t, size_t); -/* SYSCALLS.c:932:NC */ extern void *memccpy (void *, const void *, int, size_t); -/* SYSCALLS.c:933:NC */ extern void *memchr (const void *, int, size_t); -/* SYSCALLS.c:934:NC */ extern int memcmp (const void *, const void *, size_t); -/* SYSCALLS.c:935:NC */ extern void *memcpy (void *, const void *, size_t); -/* SYSCALLS.c:936:OC */ extern int memlock (/* ??? */); -/* SYSCALLS.c:937:OC */ extern int memlocked (/* ??? */); -/* SYSCALLS.c:938:NC */ extern void *memmove (void *, const void *, size_t); -/* SYSCALLS.c:939:NC */ extern void *memset (void *, int, size_t); -/* SYSCALLS.c:940:OC */ extern int memunlock (/* ??? */); -/* SYSCALLS.c:941:NC */ extern chtype menu_back (MENU *); -/* SYSCALLS.c:942:NC */ extern int menu_driver (MENU *, int); -/* SYSCALLS.c:943:NC */ extern chtype menu_fore (MENU *); -/* SYSCALLS.c:944:NC */ extern void menu_format (MENU *, int *, int *); -/* SYSCALLS.c:945:NC */ extern chtype menu_grey (MENU *); -/* SYSCALLS.c:946:NC */ extern PTF_void menu_init (MENU *); -/* SYSCALLS.c:947:NC */ extern ITEM **menu_items (MENU *); -/* SYSCALLS.c:948:NC */ extern char *menu_mark (MENU *); -/* SYSCALLS.c:949:NC */ extern OPTIONS menu_opts (MENU *); -/* SYSCALLS.c:950:NC */ extern int menu_opts_off (MENU *, OPTIONS); -/* SYSCALLS.c:951:NC */ extern int menu_opts_on (MENU *, OPTIONS); -/* SYSCALLS.c:952:NC */ extern int menu_pad (MENU *); -/* SYSCALLS.c:953:NC */ extern char *menu_pattern (MENU *); -/* SYSCALLS.c:954:NC */ extern WINDOW *menu_sub (MENU *); -/* SYSCALLS.c:955:NC */ extern PTF_void menu_term (MENU *); -/* SYSCALLS.c:956:NC */ extern char *menu_userptr (MENU *); -/* SYSCALLS.c:957:NC */ extern WINDOW *menu_win (MENU *); -/* SYSCALLS.c:958:NC */ extern int meta (WINDOW *, int); -/* SYSCALLS.c:959:NC */ extern void mfree (struct map *, size_t, u_long); -/* SYSCALLS.c:960:NC */ extern int mincore (caddr_t, size_t, char *); -/* SYSCALLS.c:961:NC */ extern minor_t minor (dev_t); -/* SYSCALLS.c:962:NC */ extern int mkdir (const char *, mode_t); -/* SYSCALLS.c:963:NC */ extern int mkdirp (const char *, mode_t); -/* SYSCALLS.c:964:NC */ extern int mkfifo (const char *, mode_t); -/* SYSCALLS.c:965:NC */ extern int mknod (const char *, mode_t, dev_t); -/* SYSCALLS.c:966:NC */ extern int mkstemp (char *); -/* SYSCALLS.c:967:NC */ extern char *mktemp (char *); -/* SYSCALLS.c:968:NC */ extern time_t mktime (struct tm *); -/* SYSCALLS.c:969:OC */ extern caddr_t mmap (/* ??? */); -/* SYSCALLS.c:970:NC */ extern double modf (double, double *); -/* SYSCALLS.c:971:NC */ extern float modff (float, float *); -/* SYSCALLS.c:972:NC */ extern struct utmpx *modutx (const struct utmpx *); -/* SYSCALLS.c:973:NC */ extern void monitor (int (*) (/* ??? */), int (*) (/* ??? */), WORD *, int, int); -/* SYSCALLS.c:974:NC */ extern int mount (const char *, const char *, int, ...); -/* SYSCALLS.c:975:NC */ extern int mouse_off (long int); -/* SYSCALLS.c:976:NC */ extern int mouse_on (long int); -/* SYSCALLS.c:977:NC */ extern int mouse_set (long int); -/* SYSCALLS.c:978:NC */ extern int move_field (FIELD *, int, int); -/* SYSCALLS.c:979:NC */ extern int move_panel (PANEL *, int, int); -/* SYSCALLS.c:980:OC */ extern int mprotect (/* ??? */); -/* SYSCALLS.c:981:NC */ extern long int mrand48 (void); -/* SYSCALLS.c:982:NC */ extern int msgctl (int, int, ...); -/* SYSCALLS.c:983:NC */ extern int msgget (key_t, int); -/* SYSCALLS.c:984:NC */ extern int msgrcv (int, void *, size_t, long int, int); -/* SYSCALLS.c:985:NC */ extern int msgsnd (int, const void *, size_t, int); -/* SYSCALLS.c:986:OC */ extern int munmap (/* ??? */); -/* SYSCALLS.c:987:NC */ extern int mvcur (int, int, int, int); -/* SYSCALLS.c:988:NC */ extern int mvderwin (WINDOW *, int, int); -/* SYSCALLS.c:989:NC */ extern int mvprintw (int, int, ...); -/* SYSCALLS.c:990:NC */ extern int mvscanw (int, int, ...); -/* SYSCALLS.c:991:NC */ extern int mvwin (WINDOW *, int, int); -/* SYSCALLS.c:992:NC */ extern int mvwprintw (WINDOW *, int, int, ...); -/* SYSCALLS.c:993:NC */ extern int mvwscanw (WINDOW *, int, int, ...); -/* SYSCALLS.c:994:NC */ extern int napms (int); -/* SYSCALLS.c:995:NC */ extern void netdir_free (char *, int); -/* SYSCALLS.c:996:NC */ extern int netdir_getbyaddr (struct netconfig *, struct nd_hostservlist **, struct netbuf *); -/* SYSCALLS.c:997:NC */ extern int netdir_getbyname (struct netconfig *, struct nd_hostserv *, struct nd_addrlist **); -/* SYSCALLS.c:998:NC */ extern int netdir_options (struct netconfig *, int, int, char *); -/* SYSCALLS.c:999:NC */ extern void netdir_perror (char *); -/* SYSCALLS.c:1000:OC */ extern char *netdir_sperror (/* ??? */); -/* SYSCALLS.c:1001:NC */ extern FIELD *new_field (int, int, int, int, int, int); -/* SYSCALLS.c:1002:NC */ extern FIELDTYPE *new_fieldtype (PTF_int, PTF_int); -/* SYSCALLS.c:1003:NC */ extern FORM *new_form (FIELD **); -/* SYSCALLS.c:1004:NC */ extern ITEM *new_item (char *, char *); -/* SYSCALLS.c:1005:NC */ extern MENU *new_menu (ITEM **); -/* SYSCALLS.c:1006:NC */ extern int new_page (FIELD *); -/* SYSCALLS.c:1007:NC */ extern PANEL *new_panel (WINDOW *); -/* SYSCALLS.c:1008:NC */ extern int newkey (char *, int, int); -/* SYSCALLS.c:1009:NC */ extern WINDOW *newpad (int, int); -/* SYSCALLS.c:1010:NC */ extern SCREEN *newscreen (char *, int, int, int, FILE *, FILE *); -/* SYSCALLS.c:1011:NC */ extern SCREEN *newterm32 (char *, FILE *, FILE *); -/* SYSCALLS.c:1012:NC */ extern WINDOW *newwin (int, int, int, int); -/* SYSCALLS.c:1013:NC */ extern double nextafter (double, double); -/* SYSCALLS.c:1014:NC */ extern datum nextkey (datum); -/* SYSCALLS.c:1015:NC */ extern int nftw (const char *, int (*) (const char *, const struct stat *, int, struct FTW *), int, int); -/* SYSCALLS.c:1016:NC */ extern int nice (int); -/* SYSCALLS.c:1017:NC */ extern int nl (void); -/* SYSCALLS.c:1018:NC */ extern char *nl_langinfo (nl_item); -/* SYSCALLS.c:1019:NC */ extern int nlist (const char *, struct nlist *); -/* SYSCALLS.c:1020:NC */ extern int nocbreak (void); -/* SYSCALLS.c:1021:NC */ extern int nocrmode (void); -/* SYSCALLS.c:1022:NC */ extern int nodelay (WINDOW *, int); -/* SYSCALLS.c:1023:NC */ extern int noecho (void); -/* SYSCALLS.c:1024:NC */ extern int nonl (void); -/* SYSCALLS.c:1025:NC */ extern int noraw (void); -/* SYSCALLS.c:1026:NC */ extern int notimeout (WINDOW *, int); -/* SYSCALLS.c:1027:NC */ extern long int nrand48 (short unsigned int *); -/* SYSCALLS.c:1028:OC */ extern int ns_close (/* ??? */); -/* SYSCALLS.c:1029:OC */ extern struct nssend *ns_rcv (/* ??? */); -/* SYSCALLS.c:1030:OC */ extern int ns_send (/* ??? */); -/* SYSCALLS.c:1031:OC */ extern int ns_setup (/* ??? */); -/* SYSCALLS.c:1032:NC */ extern long unsigned int ntohl (long unsigned int); -/* SYSCALLS.c:1033:NC */ extern short unsigned int ntohs (unsigned int); -/* SYSCALLS.c:1034:NC */ extern int nuname (struct utsname *); -/* SYSCALLS.c:1035:NC */ extern int open (const char *, int, ...); -/* SYSCALLS.c:1036:NC */ extern DIR *opendir (const char *); -/* SYSCALLS.c:1037:OC */ extern int openprivwait (/* ??? */); -/* SYSCALLS.c:1038:OC */ extern int openwait (/* ??? */); -/* SYSCALLS.c:1039:NC */ extern int overlay (WINDOW *, WINDOW *); -/* SYSCALLS.c:1040:NC */ extern int overwrite (WINDOW *, WINDOW *); -/* SYSCALLS.c:1041:NC */ extern int p2close (FILE **); -/* SYSCALLS.c:1042:NC */ extern int p2open (const char *, FILE **); -/* SYSCALLS.c:1043:NC */ extern int p32echochar (WINDOW *, chtype); -/* SYSCALLS.c:1044:OC */ extern char *p_cdname (/* ??? */); -/* SYSCALLS.c:1045:OC */ extern char *p_class (/* ??? */); -/* SYSCALLS.c:1046:OC */ extern char *p_rr (/* ??? */); -/* SYSCALLS.c:1047:OC */ extern char *p_type (/* ??? */); -/* SYSCALLS.c:1048:NC */ extern int pair_content (int, short int *, short int *); -/* SYSCALLS.c:1049:NC */ extern PANEL *panel_above (PANEL *); -/* SYSCALLS.c:1050:NC */ extern PANEL *panel_below (PANEL *); -/* SYSCALLS.c:1051:NC */ extern char *panel_userptr (PANEL *); -/* SYSCALLS.c:1052:NC */ extern WINDOW *panel_window (PANEL *); -/* SYSCALLS.c:1053:NC */ extern long int pathconf (const char *, int); -/* SYSCALLS.c:1054:NC */ extern char *pathfind (const char *, const char *, const char *); -/* SYSCALLS.c:1055:NC */ extern int pause (void); -/* SYSCALLS.c:1056:NC */ extern int pclose (FILE *); -/* SYSCALLS.c:1057:NC */ extern void perror (const char *); -/* SYSCALLS.c:1058:OC */ extern struct pfdat *pfind (/* ??? */); -/* SYSCALLS.c:1059:OC */ extern int pglstlk (/* ??? */); -/* SYSCALLS.c:1060:OC */ extern int pglstunlk (/* ??? */); -/* SYSCALLS.c:1061:NC */ extern int pid_slot (proc_t *); -/* SYSCALLS.c:1062:NC */ extern int pipe (int *); -/* SYSCALLS.c:1063:NC */ extern int plock (int); -/* SYSCALLS.c:1064:OC */ extern struct pmaplist *pmap_getmaps (/* ??? */); -/* SYSCALLS.c:1065:OC */ extern u_short pmap_getport (/* ??? */); -/* SYSCALLS.c:1066:OC */ extern enum clnt_stat pmap_rmtcall (/* ??? */); -/* SYSCALLS.c:1067:OC */ extern int pmap_set (/* ??? */); -/* SYSCALLS.c:1068:OC */ extern int pmap_unset (/* ??? */); -/* SYSCALLS.c:1069:NC */ extern int pnoutrefresh (WINDOW *, int, int, int, int, int, int); -/* SYSCALLS.c:1070:NC */ extern int poll (struct pollfd *, long unsigned int, int); -/* SYSCALLS.c:1071:NC */ extern FILE *popen (const char *, const char *); -/* SYSCALLS.c:1072:NC */ extern int pos_form_cursor (FORM *); -/* SYSCALLS.c:1073:NC */ extern int pos_menu_cursor (MENU *); -/* SYSCALLS.c:1074:NC */ extern int post_form (FORM *); -/* SYSCALLS.c:1075:NC */ extern int post_menu (MENU *); -/* SYSCALLS.c:1076:NC */ extern double pow (double, double); -/* SYSCALLS.c:1077:NC */ extern float powf (float, float); -/* SYSCALLS.c:1078:NC */ extern int prefresh (WINDOW *, int, int, int, int, int, int); -/* SYSCALLS.c:1079:NC */ extern int printf (const char *, ...); -/* SYSCALLS.c:1080:NC */ extern int printw (char *, ...); -/* SYSCALLS.c:1081:OC */ extern void privsig (/* ??? */); -/* SYSCALLS.c:1082:NC */ extern void profil (short unsigned int *, size_t, int, unsigned int); -/* SYSCALLS.c:1083:NC */ extern void psiginfo (siginfo_t *, char *); -/* SYSCALLS.c:1084:NC */ extern void psignal (int, const char *); -/* SYSCALLS.c:1085:NC */ extern int ptrace (int, pid_t, int, int); -/* SYSCALLS.c:1086:NC */ extern int putc (int, FILE *); -/* SYSCALLS.c:1087:NC */ extern int putchar (int); -/* SYSCALLS.c:1088:NC */ extern int putenv (char *); -/* SYSCALLS.c:1089:NC */ extern int putmsg (int, const struct strbuf *, const struct strbuf *, int); -/* SYSCALLS.c:1090:NC */ extern int putp (char *); -/* SYSCALLS.c:1091:NC */ extern int putpmsg (int, const struct strbuf *, const struct strbuf *, int, int); -/* SYSCALLS.c:1092:NC */ extern int putpwent (const struct passwd *, FILE *); -/* SYSCALLS.c:1093:NC */ extern int puts (const char *); -/* SYSCALLS.c:1094:NC */ extern int putspent (const struct spwd *, FILE *); -/* SYSCALLS.c:1095:NC */ extern struct utmp *pututline (const struct utmp *); -/* SYSCALLS.c:1096:NC */ extern struct utmpx *pututxline (const struct utmpx *); -/* SYSCALLS.c:1097:NC */ extern int putw (int, FILE *); -/* SYSCALLS.c:1098:NC */ extern int putwin (WINDOW *, FILE *); -/* SYSCALLS.c:1099:NC */ extern void qsort (void *, size_t, size_t, int (*) (const void *, const void *)); -/* SYSCALLS.c:1100:NC */ extern int raise (int); -/* SYSCALLS.c:1101:NC */ extern int rand (void); -/* SYSCALLS.c:1102:NC */ extern long int random (void); -/* SYSCALLS.c:1103:NC */ extern int raw (void); -/* SYSCALLS.c:1104:NC */ extern int read (int, void *, size_t); -/* SYSCALLS.c:1105:NC */ extern struct dirent *readdir (DIR *); -/* SYSCALLS.c:1106:NC */ extern int readlink (const char *, char *, size_t); -/* SYSCALLS.c:1107:NC */ extern void *realloc (void *, size_t); -/* SYSCALLS.c:1108:NC */ extern char *realpath (char *, char *); -/* SYSCALLS.c:1109:NC */ extern int redrawwin (WINDOW *); -/* SYSCALLS.c:1110:NC */ extern char *regcmp (const char *, ...); -/* SYSCALLS.c:1111:NC */ extern char *regex (const char *, const char *, ...); -/* SYSCALLS.c:1112:NC */ extern double remainder (double, double); -/* SYSCALLS.c:1113:OC */ extern int remio (/* ??? */); -/* SYSCALLS.c:1114:NC */ extern int remove (const char *); -/* SYSCALLS.c:1115:NC */ extern void remque (struct qelem *); -/* SYSCALLS.c:1116:NC */ extern int rename (const char *, const char *); -/* SYSCALLS.c:1117:NC */ extern int replace_panel (PANEL *, WINDOW *); -/* SYSCALLS.c:1118:NC */ extern int request_mouse_pos (void); -/* SYSCALLS.c:1119:OC */ extern struct reservdev **reservdev (/* ??? */); -/* SYSCALLS.c:1120:NC */ extern int reset_prog_mode (void); -/* SYSCALLS.c:1121:NC */ extern int reset_shell_mode (void); -/* SYSCALLS.c:1122:NC */ extern int resetty (void); -/* SYSCALLS.c:1123:NC */ extern int restartterm (char *, int, int *); -/* SYSCALLS.c:1124:NC */ extern void rewind (FILE *); -/* SYSCALLS.c:1125:NC */ extern void rewinddir (DIR *); -/* SYSCALLS.c:1126:OC */ extern int rf_falloc (/* ??? */); -/* SYSCALLS.c:1127:NC */ extern char *rindex (const char *, int); -/* SYSCALLS.c:1128:NC */ extern double rint (double); -/* SYSCALLS.c:1129:NC */ extern int ripoffline (int, int (*) (WINDOW *, int)); -/* SYSCALLS.c:1130:NC */ extern int rmdir (const char *); -/* SYSCALLS.c:1131:NC */ extern int rmdirp (char *, char *); -/* SYSCALLS.c:1132:OC */ extern enum clnt_stat rpc_broadcast (/* ??? */); -/* SYSCALLS.c:1133:OC */ extern enum clnt_stat rpc_call (/* ??? */); -/* SYSCALLS.c:1134:OC */ extern int rpcb_getaddr (/* ??? */); -/* SYSCALLS.c:1135:OC */ extern RPCBLIST *rpcb_getmaps (/* ??? */); -/* SYSCALLS.c:1136:OC */ extern int rpcb_gettime (/* ??? */); -/* SYSCALLS.c:1137:OC */ extern enum clnt_stat rpcb_rmtcall (/* ??? */); -/* SYSCALLS.c:1138:OC */ extern int rpcb_set (/* ??? */); -/* SYSCALLS.c:1139:OC */ extern char *rpcb_taddr2uaddr (/* ??? */); -/* SYSCALLS.c:1140:OC */ extern struct netbuf *rpcb_uaddr2taddr (/* ??? */); -/* SYSCALLS.c:1141:OC */ extern int rpcb_unset (/* ??? */); -/* SYSCALLS.c:1142:OC */ extern void rpctest_service (/* ??? */); -/* SYSCALLS.c:1143:NC */ extern int run_crypt (long int, char *, unsigned int, int *); -/* SYSCALLS.c:1144:NC */ extern int run_setkey (int *, const char *); -/* SYSCALLS.c:1145:NC */ extern int savetty (void); -/* SYSCALLS.c:1146:NC */ extern void *sbrk (int); -/* SYSCALLS.c:1147:NC */ extern double scalb (double, double); -/* SYSCALLS.c:1148:NC */ extern int scale_form (FORM *, int *, int *); -/* SYSCALLS.c:1149:NC */ extern int scale_menu (MENU *, int *, int *); -/* SYSCALLS.c:1150:NC */ extern int scanf (const char *, ...); -/* SYSCALLS.c:1151:NC */ extern int scanw (char *, ...); -/* SYSCALLS.c:1152:NC */ extern int scr_dump (char *); -/* SYSCALLS.c:1153:NC */ extern int scr_init (char *); -/* SYSCALLS.c:1154:NC */ extern int scr_restore (char *); -/* SYSCALLS.c:1155:NC */ extern int scroll (WINDOW *); -/* SYSCALLS.c:1156:NC */ extern int scrollok (WINDOW *, int); -/* SYSCALLS.c:1157:NC */ extern int scrwidth (wchar_t); -/* SYSCALLS.c:1158:NC */ extern int sdfree (char *); -/* SYSCALLS.c:1159:NC */ extern char *sdget (char *, int, ...); -/* SYSCALLS.c:1160:NC */ extern short unsigned int *seed48 (short unsigned int *); -/* SYSCALLS.c:1161:NC */ extern void seekdir (DIR *, long int); -/* SYSCALLS.c:1162:NC */ extern int semctl (int, int, int, ...); -/* SYSCALLS.c:1163:NC */ extern int semget (key_t, int, int); -/* SYSCALLS.c:1164:NC */ extern int semop (int, struct sembuf *, unsigned int); -/* SYSCALLS.c:1165:NC */ extern int send (int, char *, int, int); -/* SYSCALLS.c:1166:NC */ extern int set_current_field (FORM *, FIELD *); -/* SYSCALLS.c:1167:NC */ extern int set_current_item (MENU *, ITEM *); -/* SYSCALLS.c:1168:NC */ extern int set_field_back (FIELD *, chtype); -/* SYSCALLS.c:1169:NC */ extern int set_field_buffer (FIELD *, int, char *); -/* SYSCALLS.c:1170:NC */ extern int set_field_fore (FIELD *, chtype); -/* SYSCALLS.c:1171:NC */ extern int set_field_init (FORM *, PTF_void); -/* SYSCALLS.c:1172:NC */ extern int set_field_just (FIELD *, int); -/* SYSCALLS.c:1173:NC */ extern int set_field_opts (FIELD *, OPTIONS); -/* SYSCALLS.c:1174:NC */ extern int set_field_pad (FIELD *, int); -/* SYSCALLS.c:1175:NC */ extern int set_field_status (FIELD *, int); -/* SYSCALLS.c:1176:NC */ extern int set_field_term (FORM *, PTF_void); -/* SYSCALLS.c:1177:NC */ extern int set_field_type (FIELD *, FIELDTYPE *, ...); -/* SYSCALLS.c:1178:NC */ extern int set_field_userptr (FIELD *, char *); -/* SYSCALLS.c:1179:NC */ extern int set_fieldtype_arg (FIELDTYPE *, PTF_charP, PTF_charP, PTF_void); -/* SYSCALLS.c:1180:NC */ extern int set_fieldtype_choice (FIELDTYPE *, PTF_int, PTF_int); -/* SYSCALLS.c:1181:NC */ extern int set_form_fields (FORM *, FIELD **); -/* SYSCALLS.c:1182:NC */ extern int set_form_init (FORM *, PTF_void); -/* SYSCALLS.c:1183:NC */ extern int set_form_opts (FORM *, OPTIONS); -/* SYSCALLS.c:1184:NC */ extern int set_form_page (FORM *, int); -/* SYSCALLS.c:1185:NC */ extern int set_form_sub (FORM *, WINDOW *); -/* SYSCALLS.c:1186:NC */ extern int set_form_term (FORM *, PTF_void); -/* SYSCALLS.c:1187:NC */ extern int set_form_userptr (FORM *, char *); -/* SYSCALLS.c:1188:NC */ extern int set_form_win (FORM *, WINDOW *); -/* SYSCALLS.c:1189:NC */ extern int set_item_init (MENU *, PTF_void); -/* SYSCALLS.c:1190:NC */ extern int set_item_opts (ITEM *, OPTIONS); -/* SYSCALLS.c:1191:NC */ extern int set_item_term (MENU *, PTF_void); -/* SYSCALLS.c:1192:NC */ extern int set_item_userptr (ITEM *, char *); -/* SYSCALLS.c:1193:NC */ extern int set_item_value (ITEM *, int); -/* SYSCALLS.c:1194:NC */ extern int set_max_field (FIELD *, int); -/* SYSCALLS.c:1195:NC */ extern int set_menu_back (MENU *, chtype); -/* SYSCALLS.c:1196:NC */ extern int set_menu_fore (MENU *, chtype); -/* SYSCALLS.c:1197:NC */ extern int set_menu_format (MENU *, int, int); -/* SYSCALLS.c:1198:NC */ extern int set_menu_grey (MENU *, chtype); -/* SYSCALLS.c:1199:NC */ extern int set_menu_init (MENU *, PTF_void); -/* SYSCALLS.c:1200:NC */ extern int set_menu_items (MENU *, ITEM **); -/* SYSCALLS.c:1201:NC */ extern int set_menu_mark (MENU *, char *); -/* SYSCALLS.c:1202:NC */ extern int set_menu_opts (MENU *, OPTIONS); -/* SYSCALLS.c:1203:NC */ extern int set_menu_pad (MENU *, int); -/* SYSCALLS.c:1204:NC */ extern int set_menu_pattern (MENU *, char *); -/* SYSCALLS.c:1205:NC */ extern int set_menu_sub (MENU *, WINDOW *); -/* SYSCALLS.c:1206:NC */ extern int set_menu_term (MENU *, PTF_void); -/* SYSCALLS.c:1207:NC */ extern int set_menu_userptr (MENU *, char *); -/* SYSCALLS.c:1208:NC */ extern int set_menu_win (MENU *, WINDOW *); -/* SYSCALLS.c:1209:NC */ extern int set_new_page (FIELD *, int); -/* SYSCALLS.c:1210:NC */ extern int set_panel_userptr (PANEL *, char *); -/* SYSCALLS.c:1211:NC */ extern int set_top_row (MENU *, int); -/* SYSCALLS.c:1212:NC */ extern void setbuf (FILE *, char *); -/* SYSCALLS.c:1213:NC */ extern int setcontext (ucontext_t *); -/* SYSCALLS.c:1214:NC */ extern SCREEN *setcurscreen (SCREEN *); -/* SYSCALLS.c:1215:NC */ extern TERMINAL *setcurterm (TERMINAL *); -/* SYSCALLS.c:1216:NC */ extern FILE *setexportent (void); -/* SYSCALLS.c:1217:NC */ extern int setgid (gid_t); -/* SYSCALLS.c:1218:NC */ extern void setgrent (void); -/* SYSCALLS.c:1219:NC */ extern int setgroups (int, const gid_t *); -/* SYSCALLS.c:1220:NC */ extern int sethostname (char *, int); -/* SYSCALLS.c:1221:NC */ extern int setitimer (int, struct itimerval *, struct itimerval *); -/* SYSCALLS.c:1222:NC */ extern int setjmp (jmp_buf); -/* SYSCALLS.c:1223:NC */ extern void setkey (const char *); -/* SYSCALLS.c:1224:NC */ extern char *setlocale (int, const char *); -/* SYSCALLS.c:1225:NC */ extern FILE *setmntent (char *, char *); -/* SYSCALLS.c:1226:NC */ extern void *setnetconfig (void); -/* SYSCALLS.c:1227:NC */ extern void *setnetpath (void); -/* SYSCALLS.c:1228:NC */ extern int setpgid (pid_t, pid_t); -/* SYSCALLS.c:1229:NC */ extern pid_t setpgrp (void); -/* SYSCALLS.c:1230:NC */ extern int setpgrp2 (pid_t, pid_t); -/* SYSCALLS.c:1231:NC */ extern int setpriority (int, int, int); -/* SYSCALLS.c:1232:OC */ extern int setprivwait (/* ??? */); -/* SYSCALLS.c:1233:NC */ extern void setpwent (void); -/* SYSCALLS.c:1234:NC */ extern int setregid (gid_t, gid_t); -/* SYSCALLS.c:1235:NC */ extern int setreuid (uid_t, uid_t); -/* SYSCALLS.c:1236:NC */ extern int setrlimit (int, struct rlimit *); -/* SYSCALLS.c:1237:NC */ extern int setrpcent (int); -/* SYSCALLS.c:1238:NC */ extern pid_t setsid (void); -/* SYSCALLS.c:1239:NC */ extern void setspent (void); -/* SYSCALLS.c:1240:NC */ extern char *setstate (char *); -/* SYSCALLS.c:1241:NC */ extern int setsyx (int, int); -/* SYSCALLS.c:1242:NC */ extern int setterm (char *); -/* SYSCALLS.c:1243:NC */ extern int setuid (uid_t); -/* SYSCALLS.c:1244:NC */ extern int setupterm (char *, int, int *); -/* SYSCALLS.c:1245:NC */ extern void setutent (void); -/* SYSCALLS.c:1246:NC */ extern void setutxent (void); -/* SYSCALLS.c:1247:NC */ extern int setvbuf (FILE *, char *, int, size_t); -/* SYSCALLS.c:1248:NC */ extern long int sgetl (const char *); -/* SYSCALLS.c:1249:NC */ extern void *shmat (int, void *, int); -/* SYSCALLS.c:1250:NC */ extern int shmctl (int, int, ...); -/* SYSCALLS.c:1251:NC */ extern int shmdt (void *); -/* SYSCALLS.c:1252:NC */ extern int shmget (key_t, int, int); -/* SYSCALLS.c:1253:NC */ extern int show_panel (PANEL *); -/* SYSCALLS.c:1254:NC */ extern int sigaction (int, const struct sigaction *, struct sigaction *); -/* SYSCALLS.c:1255:NC */ extern int sigaddset (sigset_t *, int); -/* SYSCALLS.c:1256:NC */ extern int sigaltstack (const stack_t *, stack_t *); -/* SYSCALLS.c:1257:NC */ extern int sigblock (int); -/* SYSCALLS.c:1258:NC */ extern int sigdelset (sigset_t *, int); -/* SYSCALLS.c:1259:NC */ extern int sigemptyset (sigset_t *); -/* SYSCALLS.c:1260:NC */ extern int sigfillset (sigset_t *); -/* SYSCALLS.c:1261:NC */ extern int sighold (int); -/* SYSCALLS.c:1262:NC */ extern int sigignore (int); -/* SYSCALLS.c:1263:NC */ extern int siginterrupt (int, int); -/* SYSCALLS.c:1264:NC */ extern int sigismember (const sigset_t *, int); -/* SYSCALLS.c:1265:NC */ extern void siglongjmp (sigjmp_buf, int); -/* SYSCALLS.c:1266:NC */ extern void (*signal (int, void (*) (int))) (int); -/* SYSCALLS.c:1267:NC */ extern int sigpause (int); -/* SYSCALLS.c:1268:NC */ extern int sigpending (sigset_t *); -/* SYSCALLS.c:1269:NC */ extern int sigprocmask (int, const sigset_t *, sigset_t *); -/* SYSCALLS.c:1270:NC */ extern int sigrelse (int); -/* SYSCALLS.c:1271:NC */ extern int sigsend (idtype_t, id_t, int); -/* SYSCALLS.c:1272:NC */ extern int sigsendset (const procset_t *, int); -/* SYSCALLS.c:1273:NC */ extern void (*sigset (int, void (*) (int))) (int); -/* SYSCALLS.c:1274:NC */ extern int sigsetjmp (sigjmp_buf, int); -/* SYSCALLS.c:1275:NC */ extern int sigsetmask (int); -/* SYSCALLS.c:1276:NC */ extern int sigsuspend (sigset_t *); -/* SYSCALLS.c:1277:NC */ extern double sin (double); -/* SYSCALLS.c:1278:NC */ extern float sinf (float); -/* SYSCALLS.c:1279:NC */ extern double sinh (double); -/* SYSCALLS.c:1280:NC */ extern float sinhf (float); -/* SYSCALLS.c:1281:NC */ extern unsigned int sleep (unsigned int); -/* SYSCALLS.c:1282:NC */ extern int slk_attroff (chtype); -/* SYSCALLS.c:1283:NC */ extern int slk_attron (chtype); -/* SYSCALLS.c:1284:NC */ extern int slk_attrset (chtype); -/* SYSCALLS.c:1285:NC */ extern int slk_clear (void); -/* SYSCALLS.c:1286:NC */ extern int slk_init (int); -/* SYSCALLS.c:1287:NC */ extern char *slk_label (int); -/* SYSCALLS.c:1288:NC */ extern int slk_noutrefresh (void); -/* SYSCALLS.c:1289:NC */ extern int slk_refresh (void); -/* SYSCALLS.c:1290:NC */ extern int slk_restore (void); -/* SYSCALLS.c:1291:NC */ extern int slk_set (int, char *, int); -/* SYSCALLS.c:1292:NC */ extern int slk_start (int, int *); -/* SYSCALLS.c:1293:NC */ extern int slk_touch (void); -/* SYSCALLS.c:1294:NC */ extern int socket (int, int, int); -/* SYSCALLS.c:1295:OC */ extern void *sprayproc_clear_1 (/* ??? */); -/* SYSCALLS.c:1296:OC */ extern spraycumul *sprayproc_get_1 (/* ??? */); -/* SYSCALLS.c:1297:OC */ extern void *sprayproc_spray_1 (/* ??? */); -/* SYSCALLS.c:1298:NC */ extern int sprintf (char *, const char *, ...); -/* SYSCALLS.c:1299:NC */ extern void sputl (long int, char *); -/* SYSCALLS.c:1300:NC */ extern double sqrt (double); -/* SYSCALLS.c:1301:NC */ extern float sqrtf (float); -/* SYSCALLS.c:1302:NC */ extern void srand (unsigned int); -/* SYSCALLS.c:1303:NC */ extern void srand48 (long int); -/* SYSCALLS.c:1304:NC */ extern void srandom (int); -/* SYSCALLS.c:1305:NC */ extern int sscanf (const char *, const char *, ...); -/* SYSCALLS.c:1306:NC */ extern int (*ssignal (int, int (*) (int))) (int); -/* SYSCALLS.c:1307:NC */ extern int start_color (void); -/* SYSCALLS.c:1308:NC */ extern int stat (const char *, struct stat *); -/* SYSCALLS.c:1309:NC */ extern int statfs (const char *, struct statfs *, int, int); -/* SYSCALLS.c:1310:NC */ extern int statvfs (const char *, struct statvfs *); -/* SYSCALLS.c:1311:NC */ extern int step (const char *, const char *); -/* SYSCALLS.c:1312:NC */ extern int stime (const time_t *); -/* SYSCALLS.c:1313:NC */ extern struct netbuf *stoa (char *, struct netbuf *); -/* SYSCALLS.c:1314:NC */ extern void store (datum, datum); -/* SYSCALLS.c:1315:NC */ extern char *strcadd (char *, const char *); -/* SYSCALLS.c:1316:NC */ extern int strcasecmp (const char *, const char *); -/* SYSCALLS.c:1317:NC */ extern char *strcat (char *, const char *); -/* SYSCALLS.c:1318:NC */ extern char *strccpy (char *, const char *); -/* SYSCALLS.c:1319:NC */ extern char *strchr (const char *, int); -/* SYSCALLS.c:1320:OC */ extern void strclearctty (/* ??? */); -/* SYSCALLS.c:1321:OC */ extern void strclearpg (/* ??? */); -/* SYSCALLS.c:1322:OC */ extern void strclearsid (/* ??? */); -/* SYSCALLS.c:1323:NC */ extern int strcmp (const char *, const char *); -/* SYSCALLS.c:1324:NC */ extern int strcoll (const char *, const char *); -/* SYSCALLS.c:1325:NC */ extern char *strcpy (char *, const char *); -/* SYSCALLS.c:1326:NC */ extern size_t strcspn (const char *, const char *); -/* SYSCALLS.c:1327:NC */ extern char *strdup (const char *); -/* SYSCALLS.c:1328:NC */ extern char *streadd (char *, const char *, const char *); -/* SYSCALLS.c:1329:NC */ extern char *strecpy (char *, const char *, const char *); -/* SYSCALLS.c:1330:NC */ extern char *strerror (int); -/* SYSCALLS.c:1331:NC */ extern int strfind (const char *, const char *); -/* SYSCALLS.c:1332:NC */ extern size_t strftime (char *, size_t, const char *, const struct tm *); -/* SYSCALLS.c:1333:NC */ extern size_t strlen (const char *); -/* SYSCALLS.c:1334:NC */ extern int strncasecmp (const char *, const char *, size_t); -/* SYSCALLS.c:1335:NC */ extern char *strncat (char *, const char *, size_t); -/* SYSCALLS.c:1336:NC */ extern int strncmp (const char *, const char *, size_t); -/* SYSCALLS.c:1337:NC */ extern char *strncpy (char *, const char *, size_t); -/* SYSCALLS.c:1338:NC */ extern char *strpbrk (const char *, const char *); -/* SYSCALLS.c:1339:NC */ extern char *strrchr (const char *, int); -/* SYSCALLS.c:1340:NC */ extern char *strrspn (const char *, const char *); -/* SYSCALLS.c:1341:NC */ extern size_t strspn (const char *, const char *); -/* SYSCALLS.c:1342:NC */ extern char *strstr (const char *, const char *); -/* SYSCALLS.c:1343:NC */ extern double strtod (const char *, char **); -/* SYSCALLS.c:1344:NC */ extern char *strtok (char *, const char *); -/* SYSCALLS.c:1345:NC */ extern long int strtol (const char *, char **, int); -/* SYSCALLS.c:1346:NC */ extern long unsigned int strtoul (const char *, char **, int); -/* SYSCALLS.c:1347:NC */ extern char *strtrns (const char *, const char *, const char *, char *); -/* SYSCALLS.c:1348:NC */ extern size_t strxfrm (char *, const char *, size_t); -/* SYSCALLS.c:1349:NC */ extern WINDOW *subpad (WINDOW *, int, int, int, int); -/* SYSCALLS.c:1350:NC */ extern WINDOW *subwin (WINDOW *, int, int, int, int); -/* SYSCALLS.c:1351:OC */ extern int svc_create (/* ??? */); -/* SYSCALLS.c:1352:OC */ extern SVCXPRT *svc_fd_create (/* ??? */); -/* SYSCALLS.c:1353:OC */ extern void svc_getreqset (/* ??? */); -/* SYSCALLS.c:1354:OC */ extern SVCXPRT *svc_raw_create (/* ??? */); -/* SYSCALLS.c:1355:OC */ extern int svc_reg (/* ??? */); -/* SYSCALLS.c:1356:OC */ extern SVCXPRT *svc_tli_create (/* ??? */); -/* SYSCALLS.c:1357:OC */ extern SVCXPRT *svc_tp_create (/* ??? */); -/* SYSCALLS.c:1358:OC */ extern void svc_unreg (/* ??? */); -/* SYSCALLS.c:1359:OC */ extern SVCXPRT *svc_vc_create (/* ??? */); -/* SYSCALLS.c:1360:OC */ extern void svcerr_systemerr (/* ??? */); -/* SYSCALLS.c:1361:OC */ extern SVCXPRT *svcfd_create (/* ??? */); -/* SYSCALLS.c:1362:OC */ extern SVCXPRT *svcraw_create (/* ??? */); -/* SYSCALLS.c:1363:OC */ extern SVCXPRT *svctcp_create (/* ??? */); -/* SYSCALLS.c:1364:OC */ extern SVCXPRT *svcudp_bufcreate (/* ??? */); -/* SYSCALLS.c:1365:OC */ extern SVCXPRT *svcudp_create (/* ??? */); -/* SYSCALLS.c:1366:NC */ extern void swab (const char *, char *, int); -/* SYSCALLS.c:1367:NC */ extern int swapcontext (ucontext_t *, ucontext_t *); -/* SYSCALLS.c:1368:NC */ extern int symlink (const char *, const char *); -/* SYSCALLS.c:1369:NC */ extern void sync (void); -/* SYSCALLS.c:1370:NC */ extern int syncok (WINDOW *, int); -/* SYSCALLS.c:1371:NC */ extern int syscall (int, ...); -/* SYSCALLS.c:1372:NC */ extern long int sysconf (int); -/* SYSCALLS.c:1373:NC */ extern int sysfs (int, ...); -/* SYSCALLS.c:1374:NC */ extern int sysinfo (int, char *, long int); -/* SYSCALLS.c:1375:NC */ extern int system (const char *); -/* SYSCALLS.c:1376:NC */ extern char *taddr2uaddr (struct netconfig *, struct netbuf *); -/* SYSCALLS.c:1377:NC */ extern double tan (double); -/* SYSCALLS.c:1378:NC */ extern float tanf (float); -/* SYSCALLS.c:1379:NC */ extern double tanh (double); -/* SYSCALLS.c:1380:NC */ extern float tanhf (float); -/* SYSCALLS.c:1381:NC */ extern int tcdrain (int); -/* SYSCALLS.c:1382:NC */ extern int tcflow (int, int); -/* SYSCALLS.c:1383:NC */ extern int tcflush (int, int); -/* SYSCALLS.c:1384:NC */ extern int tcgetattr (int, struct termios *); -/* SYSCALLS.c:1385:NC */ extern pid_t tcgetpgrp (int); -/* SYSCALLS.c:1386:NC */ extern pid_t tcgetsid (int); -/* SYSCALLS.c:1387:NC */ extern int tcsendbreak (int, int); -/* SYSCALLS.c:1388:NC */ extern int tcsetattr (int, int, const struct termios *); -/* SYSCALLS.c:1389:NC */ extern int tcsetpgrp (int, pid_t); -/* SYSCALLS.c:1390:NC */ extern void *tdelete (const void *, void **, int (*) (const void *, const void *)); -/* SYSCALLS.c:1391:NC */ extern long int telldir (DIR *); -/* SYSCALLS.c:1392:NC */ extern char *tempnam (const char *, const char *); -/* SYSCALLS.c:1393:NC */ extern chtype termattrs (void); -/* SYSCALLS.c:1394:NC */ extern void termerr (void); -/* SYSCALLS.c:1395:NC */ extern char *termname (void); -/* SYSCALLS.c:1396:NC */ extern void *tfind (const void *, void *const *, int (*) (const void *, const void *)); -/* SYSCALLS.c:1397:NC */ extern int tgetent (char *, char *); -/* SYSCALLS.c:1398:NC */ extern int tgetflag (char *); -/* SYSCALLS.c:1399:NC */ extern int tgetnum (char *); -/* SYSCALLS.c:1400:NC */ extern char *tgetstr (char *, char **); -/* SYSCALLS.c:1401:NC */ extern char *tgoto (char *, int, int); -/* SYSCALLS.c:1402:NC */ extern char *tigetstr (char *); -/* SYSCALLS.c:1403:NC */ extern time_t time (time_t *); -/* SYSCALLS.c:1404:NC */ extern clock_t times (struct tms *); -/* SYSCALLS.c:1405:NC */ extern char *timezone (int, int); -/* SYSCALLS.c:1406:NC */ extern void tinputfd (int); -/* SYSCALLS.c:1407:NC */ extern FILE *tmpfile (void); -/* SYSCALLS.c:1408:NC */ extern char *tmpnam (char *); -/* SYSCALLS.c:1409:NC */ extern int toascii (int); -/* SYSCALLS.c:1410:NC */ extern int tolower (int); -/* SYSCALLS.c:1411:NC */ extern int top_panel (PANEL *); -/* SYSCALLS.c:1412:NC */ extern int top_row (MENU *); -/* SYSCALLS.c:1413:NC */ extern int touchline (WINDOW *, int, int); -/* SYSCALLS.c:1414:NC */ extern int touchwin (WINDOW *); -/* SYSCALLS.c:1415:NC */ extern int toupper (int); -/* SYSCALLS.c:1416:OC */ extern char *tparm (/* ??? */); -/* SYSCALLS.c:1417:NC */ extern int tputs (char *, int, int (*) (char)); -/* SYSCALLS.c:1418:NC */ extern int traceoff (void); -/* SYSCALLS.c:1419:NC */ extern int traceon (void); -/* SYSCALLS.c:1420:NC */ extern int truncate (const char *, off_t); -/* SYSCALLS.c:1421:NC */ extern void *tsearch (const void *, void **, int (*) (const void *, const void *)); -/* SYSCALLS.c:1422:NC */ extern char *ttyname (int); -/* SYSCALLS.c:1423:NC */ extern int ttyslot (void); -/* SYSCALLS.c:1424:NC */ extern void twalk (void *, void (*) (void *, VISIT, int)); -/* SYSCALLS.c:1425:NC */ extern int typeahead (int); -/* SYSCALLS.c:1426:NC */ extern void tzset (void); -/* SYSCALLS.c:1427:NC */ extern struct netbuf *uaddr2taddr (struct netconfig *, char *); -/* SYSCALLS.c:1428:NC */ extern int uadmin (int, int, int); -/* SYSCALLS.c:1429:NC */ extern unsigned int ualarm (unsigned int, unsigned int); -/* SYSCALLS.c:1430:NC */ extern int ulckpwdf (void); -/* SYSCALLS.c:1431:NC */ extern long int ulimit (int, ...); -/* SYSCALLS.c:1432:NC */ extern mode_t umask (mode_t); -/* SYSCALLS.c:1433:NC */ extern int umount (const char *); -/* SYSCALLS.c:1434:NC */ extern int uname (struct utsname *); -/* SYSCALLS.c:1435:NC */ extern char *unctrl (int); -/* SYSCALLS.c:1436:NC */ extern void undial (int); -/* SYSCALLS.c:1437:NC */ extern int ungetc (int, FILE *); -/* SYSCALLS.c:1438:NC */ extern int ungetch (int); -/* SYSCALLS.c:1439:NC */ extern int unlink (const char *); -/* SYSCALLS.c:1440:NC */ extern int unordered (double, double); -/* SYSCALLS.c:1441:NC */ extern int unpost_form (FORM *); -/* SYSCALLS.c:1442:NC */ extern int unpost_menu (MENU *); -/* SYSCALLS.c:1443:OC */ extern int unremio (/* ??? */); -/* SYSCALLS.c:1444:NC */ extern int untouchwin (WINDOW *); -/* SYSCALLS.c:1445:NC */ extern void update_panels (void); -/* SYSCALLS.c:1446:NC */ extern void updwtmp (const char *, struct utmp *); -/* SYSCALLS.c:1447:NC */ extern void updwtmpx (const char *, struct utmpx *); -/* SYSCALLS.c:1448:NC */ extern void use_env (int); -/* SYSCALLS.c:1449:NC */ extern unsigned int usleep (unsigned int); -/* SYSCALLS.c:1450:NC */ extern int ustat (dev_t, struct ustat *); -/* SYSCALLS.c:1451:NC */ extern int utime (const char *, const struct utimbuf *); -/* SYSCALLS.c:1452:NC */ extern int utmpname (const char *); -/* SYSCALLS.c:1453:NC */ extern int utmpxname (const char *); -/* SYSCALLS.c:1454:NC */ extern void va_end (__gnuc_va_list); -/* SYSCALLS.c:1455:NC */ extern int vadvise (int); -/* SYSCALLS.c:1456:NC */ extern void *valloc (size_t); -/* SYSCALLS.c:1457:NC */ extern pid_t vfork (void); -/* SYSCALLS.c:1458:NC */ extern int vfprintf (FILE *, const char *, __gnuc_va_list); -/* SYSCALLS.c:1459:NC */ extern int vhangup (void); -/* SYSCALLS.c:1460:NC */ extern int vid32attr (chtype); -/* SYSCALLS.c:1461:NC */ extern int vid32puts (chtype, int (*) (char)); -/* SYSCALLS.c:1462:NC */ extern void vidupdate (chtype, chtype, int (*) (char)); -/* SYSCALLS.c:1463:OC */ extern int vn_close (/* ??? */); -/* SYSCALLS.c:1464:NC */ extern int vprintf (const char *, __gnuc_va_list); -/* SYSCALLS.c:1465:NC */ extern int vsprintf (char *, const char *, __gnuc_va_list); -/* SYSCALLS.c:1466:NC */ extern int vwprintw (WINDOW *, char *, void *); -/* SYSCALLS.c:1467:NC */ extern int vwscanw (WINDOW *, char *, void *); -/* SYSCALLS.c:1468:NC */ extern int w32addch (WINDOW *, chtype); -/* SYSCALLS.c:1469:NC */ extern int w32attroff (WINDOW *, chtype); -/* SYSCALLS.c:1470:NC */ extern int w32attron (WINDOW *, chtype); -/* SYSCALLS.c:1471:NC */ extern int w32attrset (WINDOW *, chtype); -/* SYSCALLS.c:1472:NC */ extern int w32echochar (WINDOW *, chtype); -/* SYSCALLS.c:1473:NC */ extern int w32insch (WINDOW *, chtype); -/* SYSCALLS.c:1474:NC */ extern int waddchnstr (WINDOW *, chtype *, int); -/* SYSCALLS.c:1475:NC */ extern int waddnstr (WINDOW *, char *, int); -/* SYSCALLS.c:1476:NC */ extern int waddstr (WINDOW *, char *); -/* SYSCALLS.c:1477:NC */ extern pid_t wait (int *); -/* SYSCALLS.c:1478:NC */ extern pid_t wait3 (union wait *, int, struct rusage *); -/* SYSCALLS.c:1479:NC */ extern int waitid (idtype_t, id_t, siginfo_t *, int); -/* SYSCALLS.c:1480:NC */ extern pid_t waitpid (pid_t, int *, int); -/* SYSCALLS.c:1481:OC */ extern void *wallproc_wall_1 (/* ??? */); -/* SYSCALLS.c:1482:NC */ extern int wbkgd (WINDOW *, chtype); -/* SYSCALLS.c:1483:NC */ extern void wbkgdset (WINDOW *, chtype); -/* SYSCALLS.c:1484:NC */ extern int wborder (WINDOW *, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype); -/* SYSCALLS.c:1485:NC */ extern int wclear (WINDOW *); -/* SYSCALLS.c:1486:NC */ extern int wclrtobot (WINDOW *); -/* SYSCALLS.c:1487:NC */ extern int wclrtoeol (WINDOW *); -/* SYSCALLS.c:1488:NC */ extern size_t wcstombs (char *, const wchar_t *, size_t); -/* SYSCALLS.c:1489:NC */ extern int wctomb (char *, wchar_t); -/* SYSCALLS.c:1490:NC */ extern void wcursyncup (WINDOW *); -/* SYSCALLS.c:1491:NC */ extern int wdelch (WINDOW *); -/* SYSCALLS.c:1492:NC */ extern int wdeleteln (WINDOW *); -/* SYSCALLS.c:1493:NC */ extern int werase (WINDOW *); -/* SYSCALLS.c:1494:NC */ extern int wgetch (WINDOW *); -/* SYSCALLS.c:1495:NC */ extern int wgetnstr (WINDOW *, char *, int); -/* SYSCALLS.c:1496:NC */ extern int wgetstr (WINDOW *, char *); -/* SYSCALLS.c:1497:NC */ extern int whline (WINDOW *, chtype, int); -/* SYSCALLS.c:1498:NC */ extern chtype winch (WINDOW *); -/* SYSCALLS.c:1499:NC */ extern int winchnstr (WINDOW *, chtype *, int); -/* SYSCALLS.c:1500:NC */ extern int winchstr (WINDOW *, chtype *); -/* SYSCALLS.c:1501:NC */ extern int winnstr (WINDOW *, char *, int); -/* SYSCALLS.c:1502:NC */ extern int winsdelln (WINDOW *, int); -/* SYSCALLS.c:1503:NC */ extern int winsertln (WINDOW *); -/* SYSCALLS.c:1504:NC */ extern int winsnstr (WINDOW *, char *, int); -/* SYSCALLS.c:1505:NC */ extern int winstr (WINDOW *, char *); -/* SYSCALLS.c:1506:NC */ extern int wisprint (wchar_t); -/* SYSCALLS.c:1507:NC */ extern void wmouse_position (WINDOW *, int *, int *); -/* SYSCALLS.c:1508:NC */ extern int wmove (WINDOW *, int, int); -/* SYSCALLS.c:1509:NC */ extern int wnoutrefresh (WINDOW *); -/* SYSCALLS.c:1510:NC */ extern int wprintw (WINDOW *, ...); -/* SYSCALLS.c:1511:NC */ extern int wredrawln (WINDOW *, int, int); -/* SYSCALLS.c:1512:NC */ extern int wrefresh (WINDOW *); -/* SYSCALLS.c:1513:NC */ extern int write (int, const void *, size_t); -/* SYSCALLS.c:1514:NC */ extern int wscanw (WINDOW *, ...); -/* SYSCALLS.c:1515:NC */ extern int wscrl (WINDOW *, int); -/* SYSCALLS.c:1516:NC */ extern int wsetscrreg (WINDOW *, int, int); -/* SYSCALLS.c:1517:NC */ extern int wstandend (WINDOW *); -/* SYSCALLS.c:1518:NC */ extern int wstandout (WINDOW *); -/* SYSCALLS.c:1519:NC */ extern void wsyncdown (WINDOW *); -/* SYSCALLS.c:1520:NC */ extern void wsyncup (WINDOW *); -/* SYSCALLS.c:1521:NC */ extern void wtimeout (WINDOW *, int); -/* SYSCALLS.c:1522:NC */ extern int wtouchln (WINDOW *, int, int, int); -/* SYSCALLS.c:1523:NC */ extern int wvline (WINDOW *, chtype, int); -/* SYSCALLS.c:1524:OC */ extern bool xdr_datum (/* ??? */); -/* SYSCALLS.c:1525:OC */ extern int xdr_double (/* ??? */); -/* SYSCALLS.c:1526:OC */ extern int xdr_exports (/* ??? */); -/* SYSCALLS.c:1527:OC */ extern int xdr_fhstatus (/* ??? */); -/* SYSCALLS.c:1528:OC */ extern int xdr_float (/* ??? */); -/* SYSCALLS.c:1529:OC */ extern int xdr_keybuf (/* ??? */); -/* SYSCALLS.c:1530:OC */ extern int xdr_mountlist (/* ??? */); -/* SYSCALLS.c:1531:OC */ extern int xdr_netbuf (/* ??? */); -/* SYSCALLS.c:1532:OC */ extern int xdr_path (/* ??? */); -/* SYSCALLS.c:1533:OC */ extern int xdr_pmap (/* ??? */); -/* SYSCALLS.c:1534:OC */ extern int xdr_pmaplist (/* ??? */); -/* SYSCALLS.c:1535:OC */ extern int xdr_pointer (/* ??? */); -/* SYSCALLS.c:1536:OC */ extern int xdr_reference (/* ??? */); -/* SYSCALLS.c:1537:OC */ extern int xdr_rmtcall_args (/* ??? */); -/* SYSCALLS.c:1538:OC */ extern int xdr_rmtcallres (/* ??? */); -/* SYSCALLS.c:1539:OC */ extern int xdr_rpcb (/* ??? */); -/* SYSCALLS.c:1540:OC */ extern int xdr_rpcb_rmtcallargs (/* ??? */); -/* SYSCALLS.c:1541:OC */ extern int xdr_rpcb_rmtcallres (/* ??? */); -/* SYSCALLS.c:1542:OC */ extern int xdr_rpcblist (/* ??? */); -/* SYSCALLS.c:1543:OC */ extern int xdr_sprayarr (/* ??? */); -/* SYSCALLS.c:1544:OC */ extern int xdr_spraycumul (/* ??? */); -/* SYSCALLS.c:1545:OC */ extern int xdr_spraytimeval (/* ??? */); -/* SYSCALLS.c:1546:OC */ extern int xdr_u_char (/* ??? */); -/* SYSCALLS.c:1547:OC */ extern int xdr_utmparr (/* ??? */); -/* SYSCALLS.c:1548:OC */ extern int xdr_utmpidlearr (/* ??? */); -/* SYSCALLS.c:1549:OC */ extern int xdr_vector (/* ??? */); -/* SYSCALLS.c:1550:OC */ extern int xdr_yp_buf (/* ??? */); -/* SYSCALLS.c:1551:OC */ extern bool xdr_yp_inaddr (/* ??? */); -/* SYSCALLS.c:1552:OC */ extern bool xdr_ypall (/* ??? */); -/* SYSCALLS.c:1553:OC */ extern int xdr_ypdelete_args (/* ??? */); -/* SYSCALLS.c:1554:OC */ extern bool xdr_ypdomain_wrap_string (/* ??? */); -/* SYSCALLS.c:1555:OC */ extern bool xdr_ypmap_parms (/* ??? */); -/* SYSCALLS.c:1556:OC */ extern bool xdr_ypmap_wrap_string (/* ??? */); -/* SYSCALLS.c:1557:OC */ extern bool xdr_ypowner_wrap_string (/* ??? */); -/* SYSCALLS.c:1558:OC */ extern bool xdr_yppushresp_xfr (/* ??? */); -/* SYSCALLS.c:1559:OC */ extern bool xdr_ypreq_key (/* ??? */); -/* SYSCALLS.c:1560:OC */ extern bool xdr_ypreq_newxfr (/* ??? */); -/* SYSCALLS.c:1561:OC */ extern bool xdr_ypreq_nokey (/* ??? */); -/* SYSCALLS.c:1562:OC */ extern bool xdr_ypreq_xfr (/* ??? */); -/* SYSCALLS.c:1563:OC */ extern bool xdr_ypresp_key_val (/* ??? */); -/* SYSCALLS.c:1564:OC */ extern bool xdr_ypresp_maplist (/* ??? */); -/* SYSCALLS.c:1565:OC */ extern bool xdr_ypresp_master (/* ??? */); -/* SYSCALLS.c:1566:OC */ extern bool xdr_ypresp_order (/* ??? */); -/* SYSCALLS.c:1567:OC */ extern bool xdr_ypresp_val (/* ??? */); -/* SYSCALLS.c:1568:OC */ extern int xdr_ypupdate_args (/* ??? */); -/* SYSCALLS.c:1569:OC */ extern void xdrrec_create (/* ??? */); -/* SYSCALLS.c:1570:OC */ extern int xdrrec_endofrecord (/* ??? */); -/* SYSCALLS.c:1571:OC */ extern int xdrrec_eof (/* ??? */); -/* SYSCALLS.c:1572:OC */ extern int xdrrec_skiprecord (/* ??? */); -/* SYSCALLS.c:1573:OC */ extern void xdrstdio_create (/* ??? */); -/* SYSCALLS.c:1574:OC */ extern void xprt_register (/* ??? */); -/* SYSCALLS.c:1575:OC */ extern void xprt_unregister (/* ??? */); -/* SYSCALLS.c:1576:NC */ extern double y0 (double); -/* SYSCALLS.c:1577:NC */ extern double y1 (double); -/* SYSCALLS.c:1578:NC */ extern double yn (int, double); -/* SYSCALLS.c:1579:NC */ extern int yp_all (char *, char *, struct ypall_callback *); -/* SYSCALLS.c:1580:NC */ extern int yp_bind (const char *); -/* SYSCALLS.c:1581:NC */ extern int yp_first (char *, char *, char **, int *, char **, int *); -/* SYSCALLS.c:1582:NC */ extern int yp_get_default_domain (char **); -/* SYSCALLS.c:1583:NC */ extern int yp_master (char *, char *, char **); -/* SYSCALLS.c:1584:NC */ extern int yp_match (char *, char *, char *, int, char **, int *); -/* SYSCALLS.c:1585:NC */ extern int yp_next (char *, char *, char *, int, char **, int *, char **, int *); -/* SYSCALLS.c:1586:NC */ extern int yp_order (char *, char *, int *); -/* SYSCALLS.c:1587:NC */ extern void yp_unbind (const char *); -/* SYSCALLS.c:1588:NC */ extern char *yperr_string (int); -/* SYSCALLS.c:1589:NC */ extern int ypprot_err (unsigned int); -/* SYSCALLS.c:1590:OC */ extern u_int *ypu_change_1 (/* ??? */); -/* SYSCALLS.c:1591:OC */ extern u_int *ypu_delete_1 (/* ??? */); -/* SYSCALLS.c:1592:OC */ extern u_int *ypu_insert_1 (/* ??? */); -/* SYSCALLS.c:1593:OC */ extern u_int *ypu_store_1 (/* ??? */); diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/cc1.exe b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/cc1.exe Binary files differdeleted file mode 100755 index 14730f88e82..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/cc1.exe +++ /dev/null diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/cc1plus.exe b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/cc1plus.exe Binary files differdeleted file mode 100755 index 033b171a3bf..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/cc1plus.exe +++ /dev/null diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/collect2.exe b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/collect2.exe Binary files differdeleted file mode 100755 index ecedbb05cfd..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/collect2.exe +++ /dev/null diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/README b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/README deleted file mode 100644 index 7086a7782d4..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/README +++ /dev/null @@ -1,14 +0,0 @@ -This README file is copied into the directory for GCC-only header files -when fixincludes is run by the makefile for GCC. - -Many of the files in this directory were automatically edited from the -standard system header files by the fixincludes process. They are -system-specific, and will not work on any other kind of system. They -are also not part of GCC. The reason we have to do this is because -GCC requires ANSI C headers and many vendors supply ANSI-incompatible -headers. - -Because this is an automated process, sometimes headers get "fixed" -that do not, strictly speaking, need a fix. As long as nothing is broken -by the process, it is just an unfortunate collateral inconvenience. -We would like to rectify it, if it is not "too inconvenient". diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/algorithm b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/algorithm deleted file mode 100644 index 40e6246ce7f..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/algorithm +++ /dev/null @@ -1,71 +0,0 @@ -// <algorithm> -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file algorithm - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_ALGORITHM -#define _GLIBCXX_ALGORITHM 1 - -#pragma GCC system_header - -#include <bits/stl_algobase.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_algo.h> - -#endif /* _GLIBCXX_ALGORITHM */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/algo.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/algo.h deleted file mode 100644 index 6f248356cf8..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/algo.h +++ /dev/null @@ -1,149 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_ALGO_H -#define _BACKWARD_ALGO_H 1 - -#include "backward_warning.h" -#include "algobase.h" -#include "tempbuf.h" -#include "iterator.h" -#include <bits/stl_algo.h> -#include <bits/stl_numeric.h> -#include <ext/algorithm> -#include <ext/numeric> - -// Names from <stl_algo.h> -using std::for_each; -using std::find; -using std::find_if; -using std::adjacent_find; -using std::count; -using std::count_if; -using std::search; -using std::search_n; -using std::swap_ranges; -using std::transform; -using std::replace; -using std::replace_if; -using std::replace_copy; -using std::replace_copy_if; -using std::generate; -using std::generate_n; -using std::remove; -using std::remove_if; -using std::remove_copy; -using std::remove_copy_if; -using std::unique; -using std::unique_copy; -using std::reverse; -using std::reverse_copy; -using std::rotate; -using std::rotate_copy; -using std::random_shuffle; -using std::partition; -using std::stable_partition; -using std::sort; -using std::stable_sort; -using std::partial_sort; -using std::partial_sort_copy; -using std::nth_element; -using std::lower_bound; -using std::upper_bound; -using std::equal_range; -using std::binary_search; -using std::merge; -using std::inplace_merge; -using std::includes; -using std::set_union; -using std::set_intersection; -using std::set_difference; -using std::set_symmetric_difference; -using std::min_element; -using std::max_element; -using std::next_permutation; -using std::prev_permutation; -using std::find_first_of; -using std::find_end; - -// Names from stl_heap.h -using std::push_heap; -using std::pop_heap; -using std::make_heap; -using std::sort_heap; - -// Names from stl_numeric.h -using std::accumulate; -using std::inner_product; -using std::partial_sum; -using std::adjacent_difference; - -// Names from ext/algorithm -using __gnu_cxx::random_sample; -using __gnu_cxx::random_sample_n; -using __gnu_cxx::is_sorted; -using __gnu_cxx::is_heap; -using __gnu_cxx::count; // Extension returning void -using __gnu_cxx::count_if; // Extension returning void - -// Names from ext/numeric -using __gnu_cxx::power; -using __gnu_cxx::iota; - -#endif /* _BACKWARD_ALGO_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/algobase.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/algobase.h deleted file mode 100644 index 86028a0d05c..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/algobase.h +++ /dev/null @@ -1,95 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_ALGOBASE_H -#define _BACKWARD_ALGOBASE_H 1 - -#include "backward_warning.h" -#include "pair.h" -#include "iterator.h" -#include <bits/stl_algobase.h> -#include <bits/stl_uninitialized.h> -#include <ext/algorithm> -#include <ext/memory> - -// Names from stl_algobase.h -using std::iter_swap; -using std::swap; -using std::min; -using std::max; -using std::copy; -using std::copy_backward; -using std::fill; -using std::fill_n; -using std::mismatch; -using std::equal; -using std::lexicographical_compare; - -// Names from stl_uninitialized.h -using std::uninitialized_copy; -using std::uninitialized_fill; -using std::uninitialized_fill_n; - -// Names from ext/algorithm -using __gnu_cxx::copy_n; -using __gnu_cxx::lexicographical_compare_3way; - -// Names from ext/memory -using __gnu_cxx::uninitialized_copy_n; - -#endif /* _BACKWARD_ALGOBASE_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/alloc.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/alloc.h deleted file mode 100644 index d3c3c738b95..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/alloc.h +++ /dev/null @@ -1,52 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1996-1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_ALLOC_H -#define _BACKWARD_ALLOC_H 1 - -#include "backward_warning.h" -#include <bits/c++config.h> -#include <bits/allocator.h> - -using std::allocator; - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/backward_warning.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/backward_warning.h deleted file mode 100644 index 9e1377793ea..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/backward_warning.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BACKWARD_BACKWARD_WARNING_H -#define _BACKWARD_BACKWARD_WARNING_H 1 - -#ifdef __DEPRECATED -#warning This file includes at least one deprecated or antiquated header. \ -Please consider using one of the 32 headers found in section 17.4.1.2 of the \ -C++ standard. Examples include substituting the <X> header for the <X.h> \ -header for C++ includes, or <iostream> instead of the deprecated header \ -<iostream.h>. To disable this warning use -Wno-deprecated. -#endif - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/bvector.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/bvector.h deleted file mode 100644 index 92457926788..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/bvector.h +++ /dev/null @@ -1,68 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_BVECTOR_H -#define _BACKWARD_BVECTOR_H 1 - -#include "backward_warning.h" -#include <vector> - -typedef std::vector<bool, std::allocator<bool> > bit_vector; - -#endif /* _BACKWARD_BVECTOR_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/complex.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/complex.h deleted file mode 100644 index dfc67140655..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/complex.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2000 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BACKWARD_COMPLEX_H -#define _BACKWARD_COMPLEX_H 1 - -#include "backward_warning.h" -#include <complex> - -using std::complex; -typedef complex<float> float_complex; -typedef complex<double> double_complex; -typedef complex<long double> long_double_complex; - -#endif - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/defalloc.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/defalloc.h deleted file mode 100644 index 76ea52abc9e..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/defalloc.h +++ /dev/null @@ -1,117 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -// Inclusion of this file is DEPRECATED. This is the original HP -// default allocator. It is provided only for backward compatibility. -// This file WILL BE REMOVED in a future release. -// -// DO NOT USE THIS FILE unless you have an old container implementation -// that requires an allocator with the HP-style interface. -// -// Standard-conforming allocators have a very different interface. The -// standard default allocator is declared in the header <memory>. - -#ifndef _BACKWARD_DEFALLOC_H -#define _BACKWARD_DEFALLOC_H 1 - -#include "backward_warning.h" -#include "new.h" -#include <stddef.h> -#include <stdlib.h> -#include <limits.h> -#include "iostream.h" -#include "algobase.h" - - -template <class _Tp> -inline _Tp* allocate(ptrdiff_t __size, _Tp*) { - set_new_handler(0); - _Tp* __tmp = (_Tp*)(::operator new((size_t)(__size * sizeof(_Tp)))); - if (__tmp == 0) { - cerr << "out of memory" << endl; - exit(1); - } - return __tmp; -} - - -template <class _Tp> -inline void deallocate(_Tp* __buffer) { - ::operator delete(__buffer); -} - -template <class _Tp> -class allocator { -public: - typedef _Tp value_type; - typedef _Tp* pointer; - typedef const _Tp* const_pointer; - typedef _Tp& reference; - typedef const _Tp& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - pointer allocate(size_type __n) { - return ::allocate((difference_type)__n, (pointer)0); - } - void deallocate(pointer __p) { ::deallocate(__p); } - pointer address(reference __x) { return (pointer)&__x; } - const_pointer const_address(const_reference __x) { - return (const_pointer)&__x; - } - size_type init_page_size() { - return max(size_type(1), size_type(4096/sizeof(_Tp))); - } - size_type max_size() const { - return max(size_type(1), size_type(UINT_MAX/sizeof(_Tp))); - } -}; - -class allocator<void> { -public: - typedef void* pointer; -}; - - - -#endif /* _BACKWARD_DEFALLOC_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/deque.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/deque.h deleted file mode 100644 index 36c7479ef09..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/deque.h +++ /dev/null @@ -1,70 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_DEQUE_H -#define _BACKWARD_DEQUE_H 1 - -#include "backward_warning.h" -#include "algobase.h" -#include "alloc.h" -#include <deque> - -using std::deque; - -#endif /* _BACKWARD_DEQUE_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/fstream.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/fstream.h deleted file mode 100644 index 6dfd514c2f3..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/fstream.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (C) 2000, 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BACKWARD_FSTREAM_H -#define _BACKWARD_FSTREAM_H 1 - -#include "backward_warning.h" -#include <fstream> - -using std::filebuf; -using std::ifstream; -using std::ofstream; -using std::fstream; -using std::streampos; - -#ifdef _GLIBCXX_USE_WCHAR_T -using std::wfilebuf; -using std::wifstream; -using std::wofstream; -using std::wfstream; -using std::wstreampos; -#endif - -#endif - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/function.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/function.h deleted file mode 100644 index 9fc8719c07a..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/function.h +++ /dev/null @@ -1,130 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_FUNCTION_H -#define _BACKWARD_FUNCTION_H 1 - -#include "backward_warning.h" -#include <bits/c++config.h> -#include <stddef.h> -#include <bits/stl_function.h> -#include <ext/functional> - -// Names from stl_function.h -using std::unary_function; -using std::binary_function; -using std::plus; -using std::minus; -using std::multiplies; -using std::divides; -using std::modulus; -using std::negate; -using std::equal_to; -using std::not_equal_to; -using std::greater; -using std::less; -using std::greater_equal; -using std::less_equal; -using std::logical_and; -using std::logical_or; -using std::logical_not; -using std::unary_negate; -using std::binary_negate; -using std::not1; -using std::not2; -using std::binder1st; -using std::binder2nd; -using std::bind1st; -using std::bind2nd; -using std::pointer_to_unary_function; -using std::pointer_to_binary_function; -using std::ptr_fun; -using std::mem_fun_t; -using std::const_mem_fun_t; -using std::mem_fun_ref_t; -using std::const_mem_fun_ref_t; -using std::mem_fun1_t; -using std::const_mem_fun1_t; -using std::mem_fun1_ref_t; -using std::const_mem_fun1_ref_t; -using std::mem_fun; -using std::mem_fun_ref; - -// Names from ext/functional -using __gnu_cxx::identity_element; -using __gnu_cxx::unary_compose; -using __gnu_cxx::binary_compose; -using __gnu_cxx::compose1; -using __gnu_cxx::compose2; -using __gnu_cxx::identity; -using __gnu_cxx::select1st; -using __gnu_cxx::select2nd; -using __gnu_cxx::project1st; -using __gnu_cxx::project2nd; -using __gnu_cxx::constant_void_fun; -using __gnu_cxx::constant_unary_fun; -using __gnu_cxx::constant_binary_fun; -using __gnu_cxx::constant0; -using __gnu_cxx::constant1; -using __gnu_cxx::constant2; -using __gnu_cxx::subtractive_rng; -using __gnu_cxx::mem_fun1; -using __gnu_cxx::mem_fun1_ref; - -#endif /* _BACKWARD_FUNCTION_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/hash_map.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/hash_map.h deleted file mode 100644 index bc9c1482c8a..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/hash_map.h +++ /dev/null @@ -1,72 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -#ifndef _BACKWARD_HASH_MAP_H -#define _BACKWARD_HASH_MAP_H 1 - -#include "backward_warning.h" -#include "algobase.h" -#include <ext/hash_map> - -using __gnu_cxx::hash; -using __gnu_cxx::hashtable; -using __gnu_cxx::hash_map; -using __gnu_cxx::hash_multimap; - -#endif /* _BACKWARD_HASH_MAP_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/hash_set.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/hash_set.h deleted file mode 100644 index 89307de0402..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/hash_set.h +++ /dev/null @@ -1,69 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -#ifndef _BACKWARD_HASH_SET_H -#define _BACKWARD_HASH_SET_H 1 - -#include "backward_warning.h" -#include "algobase.h" -#include <ext/hash_set> - -using __gnu_cxx::hash; -using __gnu_cxx::hashtable; -using __gnu_cxx::hash_set; -using __gnu_cxx::hash_multiset; - -#endif /* _BACKWARD_HASH_SET_H */ - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/hashtable.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/hashtable.h deleted file mode 100644 index abedd55b001..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/hashtable.h +++ /dev/null @@ -1,76 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -/* NOTE: This is an internal header file, included by other STL headers. - * You should not attempt to use it directly. - */ - -#ifndef _BACKWARD_HASHTABLE_H -#define _BACKWARD_HASHTABLE_H 1 - -#include "backward_warning.h" -#include <ext/hashtable.h> -#include "algo.h" -#include "alloc.h" -#include "vector.h" - -using __gnu_cxx::hash; -using __gnu_cxx::hashtable; - -#endif /* _BACKWARD_HASHTABLE_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/heap.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/heap.h deleted file mode 100644 index 2f19545d0d7..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/heap.h +++ /dev/null @@ -1,71 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_HEAP_H -#define _BACKWARD_HEAP_H 1 - -#include "backward_warning.h" -#include <bits/c++config.h> -#include <bits/stl_heap.h> - -using std::push_heap; -using std::pop_heap; -using std::make_heap; -using std::sort_heap; - -#endif /* _BACKWARD_HEAP_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iomanip.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iomanip.h deleted file mode 100644 index 160dbebcdbf..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iomanip.h +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (C) 2000 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BACKWARD_IOMANIP_H -#define _BACKWARD_IOMANIP_H 1 - -#include "backward_warning.h" -#include "iostream.h" -#include <iomanip> - -// These are from <ios> as per [27.4]. -using std::boolalpha; -using std::noboolalpha; -using std::showbase; -using std::noshowbase; -using std::showpoint; -using std::noshowpoint; -using std::showpos; -using std::noshowpos; -using std::skipws; -using std::noskipws; -using std::uppercase; -using std::nouppercase; -using std::internal; -using std::left; -using std::right; -using std::dec; -using std::hex; -using std::oct; -using std::fixed; -using std::scientific; - -// These are from <iomanip> as per [27.6]. Manipulators from <istream> -// and <ostream> (e.g., endl) are made available via <iostream.h>. -using std::resetiosflags; -using std::setiosflags; -using std::setbase; -using std::setfill; -using std::setprecision; -using std::setw; - -#endif - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iostream.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iostream.h deleted file mode 100644 index 5a5ccea62b7..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iostream.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BACKWARD_IOSTREAM_H -#define _BACKWARD_IOSTREAM_H 1 - -#include "backward_warning.h" -#include <iostream> - -using std::iostream; -using std::ostream; -using std::istream; -using std::ios; -using std::streambuf; - -using std::cout; -using std::cin; -using std::cerr; -using std::clog; -#ifdef _GLIBCXX_USE_WCHAR_T -using std::wcout; -using std::wcin; -using std::wcerr; -using std::wclog; -#endif - -using std::ws; -using std::endl; -using std::ends; -using std::flush; - -#endif - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/istream.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/istream.h deleted file mode 100644 index 707b575a5bd..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/istream.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2000 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BACKWARD_ISTREAM_H -#define _BACKWARD_ISTREAM_H 1 - -#include "backward_warning.h" -#include "iostream.h" - -#endif - -// Local Variables: -// mode:C++ -// End: - - - - - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iterator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iterator.h deleted file mode 100644 index 8316a83d698..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iterator.h +++ /dev/null @@ -1,191 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_ITERATOR_H -#define _BACKWARD_ITERATOR_H 1 - -#include "backward_warning.h" -#include "function.h" -#include <stddef.h> -#include "iostream.h" -#include <iterator> - -#include <bits/stl_construct.h> -#include <bits/stl_raw_storage_iter.h> - -#include <ext/iterator> // For 3-parameter distance extension - -// Names from stl_iterator.h -using std::input_iterator_tag; -using std::output_iterator_tag; -using std::forward_iterator_tag; -using std::bidirectional_iterator_tag; -using std::random_access_iterator_tag; - -#if 0 -using std::iterator; -#endif - -// The base classes input_iterator, output_iterator, forward_iterator, -// bidirectional_iterator, and random_access_iterator are not part of -// the C++ standard. (They have been replaced by struct iterator.) -// They are included for backward compatibility with the HP STL. -template<typename _Tp, typename _Distance> - struct input_iterator { - typedef input_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Distance difference_type; - typedef _Tp* pointer; - typedef _Tp& reference; - }; - -struct output_iterator { - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; -}; - -template<typename _Tp, typename _Distance> - struct forward_iterator { - typedef forward_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Distance difference_type; - typedef _Tp* pointer; - typedef _Tp& reference; - }; - -template<typename _Tp, typename _Distance> - struct bidirectional_iterator { - typedef bidirectional_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Distance difference_type; - typedef _Tp* pointer; - typedef _Tp& reference; - }; - -template<typename _Tp, typename _Distance> - struct random_access_iterator { - typedef random_access_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Distance difference_type; - typedef _Tp* pointer; - typedef _Tp& reference; - }; - -using std::iterator_traits; - -template <class _Iter> - inline typename iterator_traits<_Iter>::iterator_category - iterator_category(const _Iter& __i) - { return __iterator_category(__i); } - -template <class _Iter> - inline typename iterator_traits<_Iter>::difference_type* - distance_type(const _Iter&) - { return static_cast<typename iterator_traits<_Iter>::difference_type*>(0); } - -template<class _Iter> - inline typename iterator_traits<_Iter>::value_type* - value_type(const _Iter& __i) - { return static_cast<typename iterator_traits<_Iter>::value_type*>(0); } - -using std::distance; -using __gnu_cxx::distance; // 3-parameter extension -using std::advance; - -using std::insert_iterator; -using std::front_insert_iterator; -using std::back_insert_iterator; -using std::inserter; -using std::front_inserter; -using std::back_inserter; - -using std::reverse_iterator; - -using std::istream_iterator; -using std::ostream_iterator; - -// Names from stl_construct.h -template<class _T1, class _T2> - inline void - construct(_T1* __p, const _T2& __value) - { std::_Construct(__p, __value); } - -template<class _T1> - inline void - construct(_T1* __p) - { std::_Construct(__p); } - -template <class _Tp> - inline void - destroy(_Tp* __pointer) - { std::_Destroy(__pointer); } - -template <class _ForwardIterator> - inline void - destroy(_ForwardIterator __first, _ForwardIterator __last) - { std::_Destroy(__first, __last); } - - -// Names from stl_raw_storage_iter.h -using std::raw_storage_iterator; - -#endif /* _BACKWARD_ITERATOR_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/list.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/list.h deleted file mode 100644 index 00c11a6987d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/list.h +++ /dev/null @@ -1,70 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_LIST_H -#define _BACKWARD_LIST_H 1 - -#include "backward_warning.h" -#include "algobase.h" -#include "alloc.h" -#include <list> - -using std::list; - -#endif /* _BACKWARD_LIST_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/map.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/map.h deleted file mode 100644 index 56d5c69973b..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/map.h +++ /dev/null @@ -1,69 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_MAP_H -#define _BACKWARD_MAP_H 1 - -#include "backward_warning.h" -#include "tree.h" -#include <map> - -using std::map; - -#endif /* _BACKWARD_MAP_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/multimap.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/multimap.h deleted file mode 100644 index aba42f7217f..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/multimap.h +++ /dev/null @@ -1,69 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_MULTIMAP_H -#define _BACKWARD_MULTIMAP_H 1 - -#include "backward_warning.h" -#include "tree.h" -#include <map> - -using std::multimap; - -#endif /* _BACKWARD_MULTIMAP_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/multiset.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/multiset.h deleted file mode 100644 index 7ec0c9476c9..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/multiset.h +++ /dev/null @@ -1,69 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_MULTISET_H -#define _BACKWARD_MULTISET_H 1 - -#include "backward_warning.h" -#include "tree.h" -#include <set> - -using std::multiset; - -#endif /* _BACKWARD_MULTISET_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/new.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/new.h deleted file mode 100644 index 00a4819a0bb..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/new.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- forwarding header. -// Copyright (C) 2000 Free Software Foundation - -// This file is part of GCC. -// -// GCC is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2, or (at your option) -// any later version. -// -// GCC is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GCC; see the file COPYING. If not, write to -// the Free Software Foundation, 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BACKWARD_NEW_H -#define _BACKWARD_NEW_H 1 - -#include "backward_warning.h" -#include <new> - -using std::bad_alloc; -using std::nothrow_t; -using std::nothrow; -using std::new_handler; -using std::set_new_handler; - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/ostream.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/ostream.h deleted file mode 100644 index a72de09d9eb..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/ostream.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2000 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BACKWARD_OSTREAM_H -#define _BACKWARD_OSTREAM_H 1 - -#include "backward_warning.h" -#include "iostream.h" - -#endif - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/pair.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/pair.h deleted file mode 100644 index cbb3bc7ed6d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/pair.h +++ /dev/null @@ -1,70 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_PAIR_H -#define _BACKWARD_PAIR_H 1 - -#include "backward_warning.h" -#include <bits/c++config.h> -#include <bits/stl_pair.h> - -using std::pair; -using std::make_pair; - -#endif /* _BACKWARD_PAIR_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/queue.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/queue.h deleted file mode 100644 index a3e2ff3af09..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/queue.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BACKWARD_QUEUE_H -#define _BACKWARD_QUEUE_H 1 - -#include "backward_warning.h" -#include <queue> - -using std::queue; -using std::priority_queue; - -#endif - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/rope.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/rope.h deleted file mode 100644 index fc6715aa750..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/rope.h +++ /dev/null @@ -1,60 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_ROPE_H -#define _BACKWARD_ROPE_H 1 - -#include "backward_warning.h" -#include "hashtable.h" -#include <ext/rope> - -using __gnu_cxx::char_producer; -using __gnu_cxx::sequence_buffer; -using __gnu_cxx::rope; -using __gnu_cxx::crope; -using __gnu_cxx::wrope; - -#endif /* _BACKWARD_ROPE_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/set.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/set.h deleted file mode 100644 index 6a8320ba42f..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/set.h +++ /dev/null @@ -1,69 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_SET_H -#define _BACKWARD_SET_H 1 - -#include "backward_warning.h" -#include "tree.h" -#include <set> - -using std::set; - -#endif /* _BACKWARD_SET_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/slist.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/slist.h deleted file mode 100644 index 63db065fe35..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/slist.h +++ /dev/null @@ -1,56 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -#ifndef _BACKWARD_SLIST_H -#define _BACKWARD_SLIST_H 1 - -#include "backward_warning.h" -#include <ext/slist> - -using __gnu_cxx::slist; - -#endif /* _BACKWARD_SLIST_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/stack.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/stack.h deleted file mode 100644 index 0ff53a43572..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/stack.h +++ /dev/null @@ -1,72 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_STACK_H -#define _BACKWARD_STACK_H 1 - -#include "backward_warning.h" -#include "vector.h" -#include "deque.h" -#include "heap.h" -#include "queue.h" -#include <stack> - -using std::stack; - -#endif /* _BACKWARD_STACK_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/stream.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/stream.h deleted file mode 100644 index 5540c7eebd1..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/stream.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2000 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BACKWARD_STREAM_H -#define _BACKWARD_STREAM_H 1 - -#include "backward_warning.h" -#include "iostream.h" - -#endif - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/streambuf.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/streambuf.h deleted file mode 100644 index fc9825ef0a3..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/streambuf.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2000 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BACKWARD_STREAMBUF_H -#define _BACKWARD_STREAMBUF_H 1 - -#include "backward_warning.h" -#include <streambuf> - -using std::streambuf; - -#endif - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/strstream b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/strstream deleted file mode 100644 index a5b95c5e4e9..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/strstream +++ /dev/null @@ -1,179 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1998 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -// WARNING: The classes defined in this header are DEPRECATED. This -// header is defined in section D.7.1 of the C++ standard, and it -// MAY BE REMOVED in a future standard revision. You should use the -// header <sstream> instead. - -#ifndef __SGI_STL_STRSTREAM -#define __SGI_STL_STRSTREAM - -#include "backward_warning.h" -#include <iosfwd> -#include <ios> -#include <istream> -#include <ostream> -#include <string> - -namespace std -{ - // Class strstreambuf, a streambuf class that manages an array of char. - // Note that this class is not a template. - class strstreambuf : public basic_streambuf<char, char_traits<char> > - { - public: - // Types. - typedef char_traits<char> _Traits; - typedef basic_streambuf<char, _Traits> _Base; - - public: - // Constructor, destructor - explicit strstreambuf(streamsize __initial_capacity = 0); - strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*)); - - strstreambuf(char* __get, streamsize __n, char* __put = 0); - strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0); - strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0); - - strstreambuf(const char* __get, streamsize __n); - strstreambuf(const signed char* __get, streamsize __n); - strstreambuf(const unsigned char* __get, streamsize __n); - - virtual ~strstreambuf(); - - public: - void freeze(bool = true); - char* str(); - int pcount() const; - - protected: - virtual int_type overflow(int_type __c = _Traits::eof()); - virtual int_type pbackfail(int_type __c = _Traits::eof()); - virtual int_type underflow(); - virtual _Base* setbuf(char* __buf, streamsize __n); - virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir, - ios_base::openmode __mode - = ios_base::in | ios_base::out); - virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode - = ios_base::in | ios_base::out); - - private: - strstreambuf& - operator=(const strstreambuf&); - - strstreambuf(const strstreambuf&); - - // Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun. - char* _M_alloc(size_t); - void _M_free(char*); - - // Helper function used in constructors. - void _M_setup(char* __get, char* __put, streamsize __n); - - private: - // Data members. - void* (*_M_alloc_fun)(size_t); - void (*_M_free_fun)(void*); - - bool _M_dynamic : 1; - bool _M_frozen : 1; - bool _M_constant : 1; - }; - - // Class istrstream, an istream that manages a strstreambuf. - class istrstream : public basic_istream<char> - { - public: - explicit istrstream(char*); - explicit istrstream(const char*); - istrstream(char* , streamsize); - istrstream(const char*, streamsize); - virtual ~istrstream(); - - strstreambuf* rdbuf() const; - char* str(); - - private: - strstreambuf _M_buf; - }; - - // Class ostrstream - class ostrstream : public basic_ostream<char> - { - public: - ostrstream(); - ostrstream(char*, int, ios_base::openmode = ios_base::out); - virtual ~ostrstream(); - - strstreambuf* rdbuf() const; - void freeze(bool = true); - char* str(); - int pcount() const; - - private: - strstreambuf _M_buf; - }; - - // Class strstream - class strstream : public basic_iostream<char> - { - public: - typedef char char_type; - typedef char_traits<char>::int_type int_type; - typedef char_traits<char>::pos_type pos_type; - typedef char_traits<char>::off_type off_type; - - strstream(); - strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out); - virtual ~strstream(); - - strstreambuf* rdbuf() const; - void freeze(bool = true); - int pcount() const; - char* str(); - - private: - strstreambuf _M_buf; - }; -} // namespace std -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/tempbuf.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/tempbuf.h deleted file mode 100644 index 06de2bd39d4..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/tempbuf.h +++ /dev/null @@ -1,78 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_TEMPBUF_H -#define _BACKWARD_TEMPBUF_H 1 - -#include "backward_warning.h" -#include "pair.h" -#include "iterator.h" -#include <limits.h> -#include <stddef.h> -#include <stdlib.h> -#include <bits/type_traits.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <ext/memory> - -using std::get_temporary_buffer; -using std::return_temporary_buffer; -using __gnu_cxx::temporary_buffer; - -#endif /* _BACKWARD_TEMPBUF_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/tree.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/tree.h deleted file mode 100644 index fcfcbf48dc4..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/tree.h +++ /dev/null @@ -1,55 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -#ifndef _BACKWARD_TREE -#define _BACKWARD_TREE 1 - -#include "backward_warning.h" -#include <ext/rb_tree> - -using __gnu_cxx::rb_tree; - -#endif -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/vector.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/vector.h deleted file mode 100644 index ba9b704c1dc..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/vector.h +++ /dev/null @@ -1,70 +0,0 @@ -// Backward-compat support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -#ifndef _BACKWARD_VECTOR_H -#define _BACKWARD_VECTOR_H 1 - -#include "backward_warning.h" -#include "algobase.h" -#include "alloc.h" -#include <vector> - -using std::vector; - -#endif /* _BACKWARD_VECTOR_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/allocator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/allocator.h deleted file mode 100644 index c9200ecd994..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/allocator.h +++ /dev/null @@ -1,130 +0,0 @@ -// Allocators -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1996-1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file allocator.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _ALLOCATOR_H -#define _ALLOCATOR_H 1 - -// Define the base class to std::allocator. -#include <bits/c++allocator.h> - -namespace std -{ - template<typename _Tp> - class allocator; - - template<> - class allocator<void> - { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef void* pointer; - typedef const void* const_pointer; - typedef void value_type; - - template<typename _Tp1> - struct rebind - { typedef allocator<_Tp1> other; }; - }; - - /** - * @brief The "standard" allocator, as per [20.4]. - * - * (See @link Allocators allocators info @endlink for more.) - */ - template<typename _Tp> - class allocator: public ___glibcxx_base_allocator<_Tp> - { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef _Tp* pointer; - typedef const _Tp* const_pointer; - typedef _Tp& reference; - typedef const _Tp& const_reference; - typedef _Tp value_type; - - template<typename _Tp1> - struct rebind - { typedef allocator<_Tp1> other; }; - - allocator() throw() { } - - allocator(const allocator& a) throw() - : ___glibcxx_base_allocator<_Tp>(a) { } - - template<typename _Tp1> - allocator(const allocator<_Tp1>&) throw() { } - - ~allocator() throw() { } - - // Inherit everything else. - }; - - template<typename _T1, typename _T2> - inline bool - operator==(const allocator<_T1>&, const allocator<_T2>&) - { return true; } - - template<typename _T1, typename _T2> - inline bool - operator!=(const allocator<_T1>&, const allocator<_T2>&) - { return false; } - - // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. -#if _GLIBCXX_EXTERN_TEMPLATE - extern template class allocator<char>; - extern template class allocator<wchar_t>; -#endif - - // Undefine. -#undef ___glibcxx_base_allocator -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/atomicity.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/atomicity.h deleted file mode 100644 index d2620b08e5d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/atomicity.h +++ /dev/null @@ -1,46 +0,0 @@ -// Low-level functions for atomic operations -*- C++ -*- - -// Copyright (C) 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _GLIBCXX_ATOMICITY_H -#define _GLIBCXX_ATOMICITY_H 1 - -#include <bits/atomic_word.h> - -namespace __gnu_cxx -{ - _Atomic_word - __attribute__ ((__unused__)) - __exchange_and_add(volatile _Atomic_word* __mem, int __val); - - void - __attribute__ ((__unused__)) - __atomic_add(volatile _Atomic_word* __mem, int __val); -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_ios.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_ios.h deleted file mode 100644 index 7ffe40ef166..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_ios.h +++ /dev/null @@ -1,467 +0,0 @@ -// Iostreams base classes -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file basic_ios.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _BASIC_IOS_H -#define _BASIC_IOS_H 1 - -#pragma GCC system_header - -#include <bits/streambuf_iterator.h> -#include <bits/localefwd.h> -#include <bits/locale_classes.h> -#include <bits/locale_facets.h> - -namespace std -{ - // 27.4.5 Template class basic_ios - /** - * @brief Virtual base class for all stream classes. - * - * Most of the member functions called dispatched on stream objects - * (e.g., @c std::cout.foo(bar);) are consolidated in this class. - */ - template<typename _CharT, typename _Traits> - class basic_ios : public ios_base - { - public: - //@{ - /** - * These are standard types. They permit a standardized way of - * referring to names of (or names dependant on) the template - * parameters, which are specific to the implementation. - */ - typedef _CharT char_type; - typedef typename _Traits::int_type int_type; - typedef typename _Traits::pos_type pos_type; - typedef typename _Traits::off_type off_type; - typedef _Traits traits_type; - //@} - - //@{ - /** - * @if maint - * These are non-standard types. - * @endif - */ - typedef ctype<_CharT> __ctype_type; - typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > - __num_put_type; - typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > - __num_get_type; - //@} - - // Data members: - protected: - basic_ostream<_CharT, _Traits>* _M_tie; - mutable char_type _M_fill; - mutable bool _M_fill_init; - basic_streambuf<_CharT, _Traits>* _M_streambuf; - - // Cached use_facet<ctype>, which is based on the current locale info. - const __ctype_type* _M_ctype; - // For ostream. - const __num_put_type* _M_num_put; - // For istream. - const __num_get_type* _M_num_get; - - public: - //@{ - /** - * @brief The quick-and-easy status check. - * - * This allows you to write constructs such as - * "if (!a_stream) ..." and "while (a_stream) ..." - */ - operator void*() const - { return this->fail() ? 0 : const_cast<basic_ios*>(this); } - - bool - operator!() const - { return this->fail(); } - //@} - - /** - * @brief Returns the error state of the stream buffer. - * @return A bit pattern (well, isn't everything?) - * - * See std::ios_base::iostate for the possible bit values. Most - * users will call one of the interpreting wrappers, e.g., good(). - */ - iostate - rdstate() const - { return _M_streambuf_state; } - - /** - * @brief [Re]sets the error state. - * @param state The new state flag(s) to set. - * - * See std::ios_base::iostate for the possible bit values. Most - * users will not need to pass an argument. - */ - void - clear(iostate __state = goodbit); - - /** - * @brief Sets additional flags in the error state. - * @param state The additional state flag(s) to set. - * - * See std::ios_base::iostate for the possible bit values. - */ - void - setstate(iostate __state) - { this->clear(this->rdstate() | __state); } - - // Flip the internal state on for the proper state bits, then re - // throws the propagated exception if bit also set in - // exceptions(). - void - _M_setstate(iostate __state) - { - // 27.6.1.2.1 Common requirements. - // Turn this on without causing an ios::failure to be thrown. - _M_streambuf_state |= __state; - if (this->exceptions() & __state) - __throw_exception_again; - } - - /** - * @brief Fast error checking. - * @return True if no error flags are set. - * - * A wrapper around rdstate. - */ - bool - good() const - { return this->rdstate() == 0; } - - /** - * @brief Fast error checking. - * @return True if the eofbit is set. - * - * Note that other iostate flags may also be set. - */ - bool - eof() const - { return (this->rdstate() & eofbit) != 0; } - - /** - * @brief Fast error checking. - * @return True if either the badbit or the failbit is set. - * - * Checking the badbit in fail() is historical practice. - * Note that other iostate flags may also be set. - */ - bool - fail() const - { return (this->rdstate() & (badbit | failbit)) != 0; } - - /** - * @brief Fast error checking. - * @return True if the badbit is set. - * - * Note that other iostate flags may also be set. - */ - bool - bad() const - { return (this->rdstate() & badbit) != 0; } - - /** - * @brief Throwing exceptions on errors. - * @return The current exceptions mask. - * - * This changes nothing in the stream. See the one-argument version - * of exceptions(iostate) for the meaning of the return value. - */ - iostate - exceptions() const - { return _M_exception; } - - /** - * @brief Throwing exceptions on errors. - * @param except The new exceptions mask. - * - * By default, error flags are set silently. You can set an - * exceptions mask for each stream; if a bit in the mask becomes set - * in the error flags, then an exception of type - * std::ios_base::failure is thrown. - * - * If the error flage is already set when the exceptions mask is - * added, the exception is immediately thrown. Try running the - * following under GCC 3.1 or later: - * @code - * #include <iostream> - * #include <fstream> - * #include <exception> - * - * int main() - * { - * std::set_terminate (__gnu_cxx::__verbose_terminate_handler); - * - * std::ifstream f ("/etc/motd"); - * - * std::cerr << "Setting badbit\n"; - * f.setstate (std::ios_base::badbit); - * - * std::cerr << "Setting exception mask\n"; - * f.exceptions (std::ios_base::badbit); - * } - * @endcode - */ - void - exceptions(iostate __except) - { - _M_exception = __except; - this->clear(_M_streambuf_state); - } - - // Constructor/destructor: - /** - * @brief Constructor performs initialization. - * - * The parameter is passed by derived streams. - */ - explicit - basic_ios(basic_streambuf<_CharT, _Traits>* __sb) - : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0), - _M_ctype(0), _M_num_put(0), _M_num_get(0) - { this->init(__sb); } - - /** - * @brief Empty. - * - * The destructor does nothing. More specifically, it does not - * destroy the streambuf held by rdbuf(). - */ - virtual - ~basic_ios() { } - - // Members: - /** - * @brief Fetches the current @e tied stream. - * @return A pointer to the tied stream, or NULL if the stream is - * not tied. - * - * A stream may be @e tied (or synchronized) to a second output - * stream. When this stream performs any I/O, the tied stream is - * first flushed. For example, @c std::cin is tied to @c std::cout. - */ - basic_ostream<_CharT, _Traits>* - tie() const - { return _M_tie; } - - /** - * @brief Ties this stream to an output stream. - * @param tiestr The output stream. - * @return The previously tied output stream, or NULL if the stream - * was not tied. - * - * This sets up a new tie; see tie() for more. - */ - basic_ostream<_CharT, _Traits>* - tie(basic_ostream<_CharT, _Traits>* __tiestr) - { - basic_ostream<_CharT, _Traits>* __old = _M_tie; - _M_tie = __tiestr; - return __old; - } - - /** - * @brief Accessing the underlying buffer. - * @return The current stream buffer. - * - * This does not change the state of the stream. - */ - basic_streambuf<_CharT, _Traits>* - rdbuf() const - { return _M_streambuf; } - - /** - * @brief Changing the underlying buffer. - * @param sb The new stream buffer. - * @return The previous stream buffer. - * - * Associates a new buffer with the current stream, and clears the - * error state. - * - * Due to historical accidents which the LWG refuses to correct, the - * I/O library suffers from a design error: this function is hidden - * in derived classes by overrides of the zero-argument @c rdbuf(), - * which is non-virtual for hysterical raisins. As a result, you - * must use explicit qualifications to access this function via any - * derived class. For example: - * - * @code - * std::fstream foo; // or some other derived type - * std::streambuf* p = .....; - * - * foo.ios::rdbuf(p); // ios == basic_ios<char> - * @endcode - */ - basic_streambuf<_CharT, _Traits>* - rdbuf(basic_streambuf<_CharT, _Traits>* __sb); - - /** - * @brief Copies fields of __rhs into this. - * @param __rhs The source values for the copies. - * @return Reference to this object. - * - * All fields of __rhs are copied into this object except that rdbuf() - * and rdstate() remain unchanged. All values in the pword and iword - * arrays are copied. Before copying, each callback is invoked with - * erase_event. After copying, each (new) callback is invoked with - * copyfmt_event. The final step is to copy exceptions(). - */ - basic_ios& - copyfmt(const basic_ios& __rhs); - - /** - * @brief Retreives the "empty" character. - * @return The current fill character. - * - * It defaults to a space (' ') in the current locale. - */ - char_type - fill() const - { - if (!_M_fill_init) - { - _M_fill = this->widen(' '); - _M_fill_init = true; - } - return _M_fill; - } - - /** - * @brief Sets a new "empty" character. - * @param ch The new character. - * @return The previous fill character. - * - * The fill character is used to fill out space when P+ characters - * have been requested (e.g., via setw), Q characters are actually - * used, and Q<P. It defaults to a space (' ') in the current locale. - */ - char_type - fill(char_type __ch) - { - char_type __old = this->fill(); - _M_fill = __ch; - return __old; - } - - // Locales: - /** - * @brief Moves to a new locale. - * @param loc The new locale. - * @return The previous locale. - * - * Calls @c ios_base::imbue(loc), and if a stream buffer is associated - * with this stream, calls that buffer's @c pubimbue(loc). - * - * Additional l10n notes are at - * http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html - */ - locale - imbue(const locale& __loc); - - /** - * @brief Squeezes characters. - * @param c The character to narrow. - * @param dfault The character to narrow. - * @return The narrowed character. - * - * Maps a character of @c char_type to a character of @c char, - * if possible. - * - * Returns the result of - * @code - * std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault) - * @endcode - * - * Additional l10n notes are at - * http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html - */ - char - narrow(char_type __c, char __dfault) const; - - /** - * @brief Widens characters. - * @param c The character to widen. - * @return The widened character. - * - * Maps a character of @c char to a character of @c char_type. - * - * Returns the result of - * @code - * std::use_facet<ctype<char_type> >(getloc()).widen(c) - * @endcode - * - * Additional l10n notes are at - * http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html - */ - char_type - widen(char __c) const; - - protected: - // 27.4.5.1 basic_ios constructors - /** - * @brief Empty. - * - * The default constructor does nothing and is not normally - * accessible to users. - */ - basic_ios() - : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false), - _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0) - { } - - /** - * @brief All setup is performed here. - * - * This is called from the public constructor. It is not virtual and - * cannot be redefined. - */ - void - init(basic_streambuf<_CharT, _Traits>* __sb); - - void - _M_cache_locale(const locale& __loc); - }; -} // namespace std - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -#include <bits/basic_ios.tcc> -#endif - -#endif /* _BASIC_IOS_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_ios.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_ios.tcc deleted file mode 100644 index fcb4b02493f..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_ios.tcc +++ /dev/null @@ -1,200 +0,0 @@ -// basic_ios member functions -*- C++ -*- - -// Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _BASIC_IOS_TCC -#define _BASIC_IOS_TCC 1 - -#pragma GCC system_header - -namespace std -{ - template<typename _CharT, typename _Traits> - void - basic_ios<_CharT, _Traits>::clear(iostate __state) - { - if (this->rdbuf()) - _M_streambuf_state = __state; - else - _M_streambuf_state = __state | badbit; - if (this->exceptions() & this->rdstate()) - __throw_ios_failure(__N("basic_ios::clear")); - } - - template<typename _CharT, typename _Traits> - basic_streambuf<_CharT, _Traits>* - basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb) - { - basic_streambuf<_CharT, _Traits>* __old = _M_streambuf; - _M_streambuf = __sb; - this->clear(); - return __old; - } - - template<typename _CharT, typename _Traits> - basic_ios<_CharT, _Traits>& - basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 292. effects of a.copyfmt (a) - if (this != &__rhs) - { - // Per 27.1.1, do not call imbue, yet must trash all caches - // associated with imbue() - - // Alloc any new word array first, so if it fails we have "rollback". - _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ? - _M_local_word : new _Words[__rhs._M_word_size]; - - // Bump refs before doing callbacks, for safety. - _Callback_list* __cb = __rhs._M_callbacks; - if (__cb) - __cb->_M_add_reference(); - _M_call_callbacks(erase_event); - if (_M_word != _M_local_word) - { - delete [] _M_word; - _M_word = 0; - } - _M_dispose_callbacks(); - - // NB: Don't want any added during above. - _M_callbacks = __cb; - for (int __i = 0; __i < __rhs._M_word_size; ++__i) - __words[__i] = __rhs._M_word[__i]; - if (_M_word != _M_local_word) - { - delete [] _M_word; - _M_word = 0; - } - _M_word = __words; - _M_word_size = __rhs._M_word_size; - - this->flags(__rhs.flags()); - this->width(__rhs.width()); - this->precision(__rhs.precision()); - this->tie(__rhs.tie()); - this->fill(__rhs.fill()); - _M_ios_locale = __rhs.getloc(); - _M_cache_locale(_M_ios_locale); - - _M_call_callbacks(copyfmt_event); - - // The next is required to be the last assignment. - this->exceptions(__rhs.exceptions()); - } - return *this; - } - - template<typename _CharT, typename _Traits> - char - basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const - { return __check_facet(_M_ctype).narrow(__c, __dfault); } - - template<typename _CharT, typename _Traits> - _CharT - basic_ios<_CharT, _Traits>::widen(char __c) const - { return __check_facet(_M_ctype).widen(__c); } - - // Locales: - template<typename _CharT, typename _Traits> - locale - basic_ios<_CharT, _Traits>::imbue(const locale& __loc) - { - locale __old(this->getloc()); - ios_base::imbue(__loc); - _M_cache_locale(__loc); - if (this->rdbuf() != 0) - this->rdbuf()->pubimbue(__loc); - return __old; - } - - template<typename _CharT, typename _Traits> - void - basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb) - { - // NB: This may be called more than once on the same object. - ios_base::_M_init(); - - // Cache locale data and specific facets used by iostreams. - _M_cache_locale(_M_ios_locale); - - // NB: The 27.4.4.1 Postconditions Table specifies requirements - // after basic_ios::init() has been called. As part of this, - // fill() must return widen(' ') any time after init() has been - // called, which needs an imbued ctype facet of char_type to - // return without throwing an exception. Unfortunately, - // ctype<char_type> is not necessarily a required facet, so - // streams with char_type != [char, wchar_t] will not have it by - // default. Because of this, the correct value for _M_fill is - // constructed on the first call of fill(). That way, - // unformatted input and output with non-required basic_ios - // instantiations is possible even without imbuing the expected - // ctype<char_type> facet. - _M_fill = _CharT(); - _M_fill_init = false; - - _M_tie = 0; - _M_exception = goodbit; - _M_streambuf = __sb; - _M_streambuf_state = __sb ? goodbit : badbit; - } - - template<typename _CharT, typename _Traits> - void - basic_ios<_CharT, _Traits>::_M_cache_locale(const locale& __loc) - { - if (__builtin_expect(has_facet<__ctype_type>(__loc), true)) - _M_ctype = &use_facet<__ctype_type>(__loc); - else - _M_ctype = 0; - - if (__builtin_expect(has_facet<__num_put_type>(__loc), true)) - _M_num_put = &use_facet<__num_put_type>(__loc); - else - _M_num_put = 0; - - if (__builtin_expect(has_facet<__num_get_type>(__loc), true)) - _M_num_get = &use_facet<__num_get_type>(__loc); - else - _M_num_get = 0; - } - - // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. -#if _GLIBCXX_EXTERN_TEMPLATE - extern template class basic_ios<char>; - -#ifdef _GLIBCXX_USE_WCHAR_T - extern template class basic_ios<wchar_t>; -#endif -#endif -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_string.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_string.h deleted file mode 100644 index 00df53a025a..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_string.h +++ /dev/null @@ -1,2355 +0,0 @@ -// Components for manipulating sequences of characters -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 21 Strings library -// - -/** @file basic_string.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _BASIC_STRING_H -#define _BASIC_STRING_H 1 - -#pragma GCC system_header - -#include <bits/atomicity.h> -#include <debug/debug.h> - -namespace std -{ - /** - * @class basic_string basic_string.h <string> - * @brief Managing sequences of characters and character-like objects. - * - * @ingroup Containers - * @ingroup Sequences - * - * Meets the requirements of a <a href="tables.html#65">container</a>, a - * <a href="tables.html#66">reversible container</a>, and a - * <a href="tables.html#67">sequence</a>. Of the - * <a href="tables.html#68">optional sequence requirements</a>, only - * @c push_back, @c at, and array access are supported. - * - * @doctodo - * - * - * @if maint - * Documentation? What's that? - * Nathan Myers <ncm@cantrip.org>. - * - * A string looks like this: - * - * @code - * [_Rep] - * _M_length - * [basic_string<char_type>] _M_capacity - * _M_dataplus _M_refcount - * _M_p ----------------> unnamed array of char_type - * @endcode - * - * Where the _M_p points to the first character in the string, and - * you cast it to a pointer-to-_Rep and subtract 1 to get a - * pointer to the header. - * - * This approach has the enormous advantage that a string object - * requires only one allocation. All the ugliness is confined - * within a single pair of inline functions, which each compile to - * a single "add" instruction: _Rep::_M_data(), and - * string::_M_rep(); and the allocation function which gets a - * block of raw bytes and with room enough and constructs a _Rep - * object at the front. - * - * The reason you want _M_data pointing to the character array and - * not the _Rep is so that the debugger can see the string - * contents. (Probably we should add a non-inline member to get - * the _Rep for the debugger to use, so users can check the actual - * string length.) - * - * Note that the _Rep object is a POD so that you can have a - * static "empty string" _Rep object already "constructed" before - * static constructors have run. The reference-count encoding is - * chosen so that a 0 indicates one reference, so you never try to - * destroy the empty-string _Rep object. - * - * All but the last paragraph is considered pretty conventional - * for a C++ string implementation. - * @endif - */ - // 21.3 Template class basic_string - template<typename _CharT, typename _Traits, typename _Alloc> - class basic_string - { - // Types: - public: - typedef _Traits traits_type; - typedef typename _Traits::char_type value_type; - typedef _Alloc allocator_type; - typedef typename _Alloc::size_type size_type; - typedef typename _Alloc::difference_type difference_type; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; - typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator; - typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string> - const_iterator; - typedef std::reverse_iterator<const_iterator> const_reverse_iterator; - typedef std::reverse_iterator<iterator> reverse_iterator; - - private: - // _Rep: string representation - // Invariants: - // 1. String really contains _M_length + 1 characters: due to 21.3.4 - // must be kept null-terminated. - // 2. _M_capacity >= _M_length - // Allocated memory is always (_M_capacity + 1) * sizeof(_CharT). - // 3. _M_refcount has three states: - // -1: leaked, one reference, no ref-copies allowed, non-const. - // 0: one reference, non-const. - // n>0: n + 1 references, operations require a lock, const. - // 4. All fields==0 is an empty string, given the extra storage - // beyond-the-end for a null terminator; thus, the shared - // empty string representation needs no constructor. - - struct _Rep_base - { - size_type _M_length; - size_type _M_capacity; - _Atomic_word _M_refcount; - }; - - struct _Rep : _Rep_base - { - // Types: - typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc; - - // (Public) Data members: - - // The maximum number of individual char_type elements of an - // individual string is determined by _S_max_size. This is the - // value that will be returned by max_size(). (Whereas npos - // is the maximum number of bytes the allocator can allocate.) - // If one was to divvy up the theoretical largest size string, - // with a terminating character and m _CharT elements, it'd - // look like this: - // npos = sizeof(_Rep) + (m * sizeof(_CharT)) + sizeof(_CharT) - // Solving for m: - // m = ((npos - sizeof(_Rep))/sizeof(CharT)) - 1 - // In addition, this implementation quarters this amount. - static const size_type _S_max_size; - static const _CharT _S_terminal; - - // The following storage is init'd to 0 by the linker, resulting - // (carefully) in an empty string with one reference. - static size_type _S_empty_rep_storage[]; - - static _Rep& - _S_empty_rep() - { return *reinterpret_cast<_Rep*>(&_S_empty_rep_storage); } - - bool - _M_is_leaked() const - { return this->_M_refcount < 0; } - - bool - _M_is_shared() const - { return this->_M_refcount > 0; } - - void - _M_set_leaked() - { this->_M_refcount = -1; } - - void - _M_set_sharable() - { this->_M_refcount = 0; } - - _CharT* - _M_refdata() throw() - { return reinterpret_cast<_CharT*>(this + 1); } - - _CharT* - _M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2) - { - return (!_M_is_leaked() && __alloc1 == __alloc2) - ? _M_refcopy() : _M_clone(__alloc1); - } - - // Create & Destroy - static _Rep* - _S_create(size_type, size_type, const _Alloc&); - - void - _M_dispose(const _Alloc& __a) - { - if (__gnu_cxx::__exchange_and_add(&this->_M_refcount, -1) <= 0) - _M_destroy(__a); - } // XXX MT - - void - _M_destroy(const _Alloc&) throw(); - - _CharT* - _M_refcopy() throw() - { - __gnu_cxx::__atomic_add(&this->_M_refcount, 1); - return _M_refdata(); - } // XXX MT - - _CharT* - _M_clone(const _Alloc&, size_type __res = 0); - }; - - // Use empty-base optimization: http://www.cantrip.org/emptyopt.html - struct _Alloc_hider : _Alloc - { - _Alloc_hider(_CharT* __dat, const _Alloc& __a) - : _Alloc(__a), _M_p(__dat) { } - - _CharT* _M_p; // The actual data. - }; - - public: - // Data Members (public): - // NB: This is an unsigned type, and thus represents the maximum - // size that the allocator can hold. - /// @var - /// Value returned by various member functions when they fail. - static const size_type npos = static_cast<size_type>(-1); - - private: - // Data Members (private): - mutable _Alloc_hider _M_dataplus; - - _CharT* - _M_data() const - { return _M_dataplus._M_p; } - - _CharT* - _M_data(_CharT* __p) - { return (_M_dataplus._M_p = __p); } - - _Rep* - _M_rep() const - { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); } - - // For the internal use we have functions similar to `begin'/`end' - // but they do not call _M_leak. - iterator - _M_ibegin() const { return iterator(_M_data()); } - - iterator - _M_iend() const { return iterator(_M_data() + this->size()); } - - void - _M_leak() // for use in begin() & non-const op[] - { - if (!_M_rep()->_M_is_leaked()) - _M_leak_hard(); - } - - size_type - _M_check(size_type __pos, const char* __s) const - { - if (__pos > this->size()) - __throw_out_of_range(__N(__s)); - return __pos; - } - - // NB: _M_limit doesn't check for a bad __pos value. - size_type - _M_limit(size_type __pos, size_type __off) const - { - const bool __testoff = __off < this->size() - __pos; - return __testoff ? __off : this->size() - __pos; - } - - // _S_copy_chars is a separate template to permit specialization - // to optimize for the common case of pointers as iterators. - template<class _Iterator> - static void - _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2) - { - for (; __k1 != __k2; ++__k1, ++__p) - traits_type::assign(*__p, *__k1); // These types are off. - } - - static void - _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) - { _S_copy_chars(__p, __k1.base(), __k2.base()); } - - static void - _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2) - { _S_copy_chars(__p, __k1.base(), __k2.base()); } - - static void - _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) - { traits_type::copy(__p, __k1, __k2 - __k1); } - - static void - _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2) - { traits_type::copy(__p, __k1, __k2 - __k1); } - - void - _M_mutate(size_type __pos, size_type __len1, size_type __len2); - - void - _M_leak_hard(); - - static _Rep& - _S_empty_rep() - { return _Rep::_S_empty_rep(); } - - public: - // Construct/copy/destroy: - // NB: We overload ctors in some cases instead of using default - // arguments, per 17.4.4.4 para. 2 item 2. - - /** - * @brief Default constructor creates an empty string. - */ - inline - basic_string(); - - /** - * @brief Construct an empty string using allocator a. - */ - explicit - basic_string(const _Alloc& __a); - - // NB: per LWG issue 42, semantics different from IS: - /** - * @brief Construct string with copy of value of @a str. - * @param str Source string. - */ - basic_string(const basic_string& __str); - /** - * @brief Construct string as copy of a substring. - * @param str Source string. - * @param pos Index of first character to copy from. - * @param n Number of characters to copy (default remainder). - */ - basic_string(const basic_string& __str, size_type __pos, - size_type __n = npos); - /** - * @brief Construct string as copy of a substring. - * @param str Source string. - * @param pos Index of first character to copy from. - * @param n Number of characters to copy. - * @param a Allocator to use. - */ - basic_string(const basic_string& __str, size_type __pos, - size_type __n, const _Alloc& __a); - - /** - * @brief Construct string initialized by a character array. - * @param s Source character array. - * @param n Number of characters to copy. - * @param a Allocator to use (default is default allocator). - * - * NB: s must have at least n characters, '\0' has no special - * meaning. - */ - basic_string(const _CharT* __s, size_type __n, - const _Alloc& __a = _Alloc()); - /** - * @brief Construct string as copy of a C string. - * @param s Source C string. - * @param a Allocator to use (default is default allocator). - */ - basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()); - /** - * @brief Construct string as multiple characters. - * @param n Number of characters. - * @param c Character to use. - * @param a Allocator to use (default is default allocator). - */ - basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()); - - /** - * @brief Construct string as copy of a range. - * @param beg Start of range. - * @param end End of range. - * @param a Allocator to use (default is default allocator). - */ - template<class _InputIterator> - basic_string(_InputIterator __beg, _InputIterator __end, - const _Alloc& __a = _Alloc()); - - /** - * @brief Destroy the string instance. - */ - ~basic_string() - { _M_rep()->_M_dispose(this->get_allocator()); } - - /** - * @brief Assign the value of @a str to this string. - * @param str Source string. - */ - basic_string& - operator=(const basic_string& __str) - { - this->assign(__str); - return *this; - } - - /** - * @brief Copy contents of @a s into this string. - * @param s Source null-terminated string. - */ - basic_string& - operator=(const _CharT* __s) - { - this->assign(__s); - return *this; - } - - /** - * @brief Set value to string of length 1. - * @param c Source character. - * - * Assigning to a character makes this string length 1 and - * (*this)[0] == @a c. - */ - basic_string& - operator=(_CharT __c) - { - this->assign(1, __c); - return *this; - } - - // Iterators: - /** - * Returns a read/write iterator that points to the first character in - * the %string. Unshares the string. - */ - iterator - begin() - { - _M_leak(); - return iterator(_M_data()); - } - - /** - * Returns a read-only (constant) iterator that points to the first - * character in the %string. - */ - const_iterator - begin() const - { return const_iterator(_M_data()); } - - /** - * Returns a read/write iterator that points one past the last - * character in the %string. Unshares the string. - */ - iterator - end() - { - _M_leak(); - return iterator(_M_data() + this->size()); - } - - /** - * Returns a read-only (constant) iterator that points one past the - * last character in the %string. - */ - const_iterator - end() const - { return const_iterator(_M_data() + this->size()); } - - /** - * Returns a read/write reverse iterator that points to the last - * character in the %string. Iteration is done in reverse element - * order. Unshares the string. - */ - reverse_iterator - rbegin() - { return reverse_iterator(this->end()); } - - /** - * Returns a read-only (constant) reverse iterator that points - * to the last character in the %string. Iteration is done in - * reverse element order. - */ - const_reverse_iterator - rbegin() const - { return const_reverse_iterator(this->end()); } - - /** - * Returns a read/write reverse iterator that points to one before the - * first character in the %string. Iteration is done in reverse - * element order. Unshares the string. - */ - reverse_iterator - rend() - { return reverse_iterator(this->begin()); } - - /** - * Returns a read-only (constant) reverse iterator that points - * to one before the first character in the %string. Iteration - * is done in reverse element order. - */ - const_reverse_iterator - rend() const - { return const_reverse_iterator(this->begin()); } - - public: - // Capacity: - /// Returns the number of characters in the string, not including any - /// null-termination. - size_type - size() const { return _M_rep()->_M_length; } - - /// Returns the number of characters in the string, not including any - /// null-termination. - size_type - length() const { return _M_rep()->_M_length; } - - /// Returns the size() of the largest possible %string. - size_type - max_size() const { return _Rep::_S_max_size; } - - /** - * @brief Resizes the %string to the specified number of characters. - * @param n Number of characters the %string should contain. - * @param c Character to fill any new elements. - * - * This function will %resize the %string to the specified - * number of characters. If the number is smaller than the - * %string's current size the %string is truncated, otherwise - * the %string is extended and new elements are set to @a c. - */ - void - resize(size_type __n, _CharT __c); - - /** - * @brief Resizes the %string to the specified number of characters. - * @param n Number of characters the %string should contain. - * - * This function will resize the %string to the specified length. If - * the new size is smaller than the %string's current size the %string - * is truncated, otherwise the %string is extended and new characters - * are default-constructed. For basic types such as char, this means - * setting them to 0. - */ - void - resize(size_type __n) { this->resize(__n, _CharT()); } - - /** - * Returns the total number of characters that the %string can hold - * before needing to allocate more memory. - */ - size_type - capacity() const { return _M_rep()->_M_capacity; } - - /** - * @brief Attempt to preallocate enough memory for specified number of - * characters. - * @param n Number of characters required. - * @throw std::length_error If @a n exceeds @c max_size(). - * - * This function attempts to reserve enough memory for the - * %string to hold the specified number of characters. If the - * number requested is more than max_size(), length_error is - * thrown. - * - * The advantage of this function is that if optimal code is a - * necessity and the user can determine the string length that will be - * required, the user can reserve the memory in %advance, and thus - * prevent a possible reallocation of memory and copying of %string - * data. - */ - void - reserve(size_type __res_arg = 0); - - /** - * Erases the string, making it empty. - */ - void - clear() { _M_mutate(0, this->size(), 0); } - - /** - * Returns true if the %string is empty. Equivalent to *this == "". - */ - bool - empty() const { return this->size() == 0; } - - // Element access: - /** - * @brief Subscript access to the data contained in the %string. - * @param n The index of the character to access. - * @return Read-only (constant) reference to the character. - * - * This operator allows for easy, array-style, data access. - * Note that data access with this operator is unchecked and - * out_of_range lookups are not defined. (For checked lookups - * see at().) - */ - const_reference - operator[] (size_type __pos) const - { - _GLIBCXX_DEBUG_ASSERT(__pos <= size()); - return _M_data()[__pos]; - } - - /** - * @brief Subscript access to the data contained in the %string. - * @param n The index of the character to access. - * @return Read/write reference to the character. - * - * This operator allows for easy, array-style, data access. - * Note that data access with this operator is unchecked and - * out_of_range lookups are not defined. (For checked lookups - * see at().) Unshares the string. - */ - reference - operator[](size_type __pos) - { - _GLIBCXX_DEBUG_ASSERT(__pos < size()); - _M_leak(); - return _M_data()[__pos]; - } - - /** - * @brief Provides access to the data contained in the %string. - * @param n The index of the character to access. - * @return Read-only (const) reference to the character. - * @throw std::out_of_range If @a n is an invalid index. - * - * This function provides for safer data access. The parameter is - * first checked that it is in the range of the string. The function - * throws out_of_range if the check fails. - */ - const_reference - at(size_type __n) const - { - if (__n >= this->size()) - __throw_out_of_range(__N("basic_string::at")); - return _M_data()[__n]; - } - - /** - * @brief Provides access to the data contained in the %string. - * @param n The index of the character to access. - * @return Read/write reference to the character. - * @throw std::out_of_range If @a n is an invalid index. - * - * This function provides for safer data access. The parameter is - * first checked that it is in the range of the string. The function - * throws out_of_range if the check fails. Success results in - * unsharing the string. - */ - reference - at(size_type __n) - { - if (__n >= size()) - __throw_out_of_range(__N("basic_string::at")); - _M_leak(); - return _M_data()[__n]; - } - - // Modifiers: - /** - * @brief Append a string to this string. - * @param str The string to append. - * @return Reference to this string. - */ - basic_string& - operator+=(const basic_string& __str) { return this->append(__str); } - - /** - * @brief Append a C string. - * @param s The C string to append. - * @return Reference to this string. - */ - basic_string& - operator+=(const _CharT* __s) { return this->append(__s); } - - /** - * @brief Append a character. - * @param s The character to append. - * @return Reference to this string. - */ - basic_string& - operator+=(_CharT __c) { return this->append(size_type(1), __c); } - - /** - * @brief Append a string to this string. - * @param str The string to append. - * @return Reference to this string. - */ - basic_string& - append(const basic_string& __str); - - /** - * @brief Append a substring. - * @param str The string to append. - * @param pos Index of the first character of str to append. - * @param n The number of characters to append. - * @return Reference to this string. - * @throw std::out_of_range if @a pos is not a valid index. - * - * This function appends @a n characters from @a str starting at @a pos - * to this string. If @a n is is larger than the number of available - * characters in @a str, the remainder of @a str is appended. - */ - basic_string& - append(const basic_string& __str, size_type __pos, size_type __n); - - /** - * @brief Append a C substring. - * @param s The C string to append. - * @param n The number of characters to append. - * @return Reference to this string. - */ - basic_string& - append(const _CharT* __s, size_type __n); - - /** - * @brief Append a C string. - * @param s The C string to append. - * @return Reference to this string. - */ - basic_string& - append(const _CharT* __s) - { - __glibcxx_requires_string(__s); - return this->append(__s, traits_type::length(__s)); - } - - /** - * @brief Append multiple characters. - * @param n The number of characters to append. - * @param c The character to use. - * @return Reference to this string. - * - * Appends n copies of c to this string. - */ - basic_string& - append(size_type __n, _CharT __c) - { return _M_replace_aux(this->size(), size_type(0), __n, __c); } - - /** - * @brief Append a range of characters. - * @param first Iterator referencing the first character to append. - * @param last Iterator marking the end of the range. - * @return Reference to this string. - * - * Appends characters in the range [first,last) to this string. - */ - template<class _InputIterator> - basic_string& - append(_InputIterator __first, _InputIterator __last) - { return this->replace(_M_iend(), _M_iend(), __first, __last); } - - /** - * @brief Append a single character. - * @param c Character to append. - */ - void - push_back(_CharT __c) - { _M_replace_aux(this->size(), size_type(0), size_type(1), __c); } - - /** - * @brief Set value to contents of another string. - * @param str Source string to use. - * @return Reference to this string. - */ - basic_string& - assign(const basic_string& __str); - - /** - * @brief Set value to a substring of a string. - * @param str The string to use. - * @param pos Index of the first character of str. - * @param n Number of characters to use. - * @return Reference to this string. - * @throw std::out_of_range if @a pos is not a valid index. - * - * This function sets this string to the substring of @a str consisting - * of @a n characters at @a pos. If @a n is is larger than the number - * of available characters in @a str, the remainder of @a str is used. - */ - basic_string& - assign(const basic_string& __str, size_type __pos, size_type __n) - { return this->assign(__str._M_data() - + __str._M_check(__pos, "basic_string::assign"), - __str._M_limit(__pos, __n)); } - - /** - * @brief Set value to a C substring. - * @param s The C string to use. - * @param n Number of characters to use. - * @return Reference to this string. - * - * This function sets the value of this string to the first @a n - * characters of @a s. If @a n is is larger than the number of - * available characters in @a s, the remainder of @a s is used. - */ - basic_string& - assign(const _CharT* __s, size_type __n); - - /** - * @brief Set value to contents of a C string. - * @param s The C string to use. - * @return Reference to this string. - * - * This function sets the value of this string to the value of @a s. - * The data is copied, so there is no dependence on @a s once the - * function returns. - */ - basic_string& - assign(const _CharT* __s) - { - __glibcxx_requires_string(__s); - return this->assign(__s, traits_type::length(__s)); - } - - /** - * @brief Set value to multiple characters. - * @param n Length of the resulting string. - * @param c The character to use. - * @return Reference to this string. - * - * This function sets the value of this string to @a n copies of - * character @a c. - */ - basic_string& - assign(size_type __n, _CharT __c) - { return _M_replace_aux(size_type(0), this->size(), __n, __c); } - - /** - * @brief Set value to a range of characters. - * @param first Iterator referencing the first character to append. - * @param last Iterator marking the end of the range. - * @return Reference to this string. - * - * Sets value of string to characters in the range [first,last). - */ - template<class _InputIterator> - basic_string& - assign(_InputIterator __first, _InputIterator __last) - { return this->replace(_M_ibegin(), _M_iend(), __first, __last); } - - /** - * @brief Insert multiple characters. - * @param p Iterator referencing location in string to insert at. - * @param n Number of characters to insert - * @param c The character to insert. - * @throw std::length_error If new length exceeds @c max_size(). - * - * Inserts @a n copies of character @a c starting at the position - * referenced by iterator @a p. If adding characters causes the length - * to exceed max_size(), length_error is thrown. The value of the - * string doesn't change if an error is thrown. - */ - void - insert(iterator __p, size_type __n, _CharT __c) - { this->replace(__p, __p, __n, __c); } - - /** - * @brief Insert a range of characters. - * @param p Iterator referencing location in string to insert at. - * @param beg Start of range. - * @param end End of range. - * @throw std::length_error If new length exceeds @c max_size(). - * - * Inserts characters in range [beg,end). If adding characters causes - * the length to exceed max_size(), length_error is thrown. The value - * of the string doesn't change if an error is thrown. - */ - template<class _InputIterator> - void insert(iterator __p, _InputIterator __beg, _InputIterator __end) - { this->replace(__p, __p, __beg, __end); } - - /** - * @brief Insert value of a string. - * @param pos1 Iterator referencing location in string to insert at. - * @param str The string to insert. - * @return Reference to this string. - * @throw std::length_error If new length exceeds @c max_size(). - * - * Inserts value of @a str starting at @a pos1. If adding characters - * causes the length to exceed max_size(), length_error is thrown. The - * value of the string doesn't change if an error is thrown. - */ - basic_string& - insert(size_type __pos1, const basic_string& __str) - { return this->insert(__pos1, __str, size_type(0), __str.size()); } - - /** - * @brief Insert a substring. - * @param pos1 Iterator referencing location in string to insert at. - * @param str The string to insert. - * @param pos2 Start of characters in str to insert. - * @param n Number of characters to insert. - * @return Reference to this string. - * @throw std::length_error If new length exceeds @c max_size(). - * @throw std::out_of_range If @a pos1 > size() or - * @a pos2 > @a str.size(). - * - * Starting at @a pos1, insert @a n character of @a str beginning with - * @a pos2. If adding characters causes the length to exceed - * max_size(), length_error is thrown. If @a pos1 is beyond the end of - * this string or @a pos2 is beyond the end of @a str, out_of_range is - * thrown. The value of the string doesn't change if an error is - * thrown. - */ - basic_string& - insert(size_type __pos1, const basic_string& __str, - size_type __pos2, size_type __n) - { return this->insert(__pos1, __str._M_data() - + __str._M_check(__pos2, "basic_string::insert"), - __str._M_limit(__pos2, __n)); } - - /** - * @brief Insert a C substring. - * @param pos Iterator referencing location in string to insert at. - * @param s The C string to insert. - * @param n The number of characters to insert. - * @return Reference to this string. - * @throw std::length_error If new length exceeds @c max_size(). - * @throw std::out_of_range If @a pos is beyond the end of this - * string. - * - * Inserts the first @a n characters of @a s starting at @a pos. If - * adding characters causes the length to exceed max_size(), - * length_error is thrown. If @a pos is beyond end(), out_of_range is - * thrown. The value of the string doesn't change if an error is - * thrown. - */ - basic_string& - insert(size_type __pos, const _CharT* __s, size_type __n); - - /** - * @brief Insert a C string. - * @param pos Iterator referencing location in string to insert at. - * @param s The C string to insert. - * @return Reference to this string. - * @throw std::length_error If new length exceeds @c max_size(). - * @throw std::out_of_range If @a pos is beyond the end of this - * string. - * - * Inserts the first @a n characters of @a s starting at @a pos. If - * adding characters causes the length to exceed max_size(), - * length_error is thrown. If @a pos is beyond end(), out_of_range is - * thrown. The value of the string doesn't change if an error is - * thrown. - */ - basic_string& - insert(size_type __pos, const _CharT* __s) - { - __glibcxx_requires_string(__s); - return this->insert(__pos, __s, traits_type::length(__s)); - } - - /** - * @brief Insert multiple characters. - * @param pos Index in string to insert at. - * @param n Number of characters to insert - * @param c The character to insert. - * @return Reference to this string. - * @throw std::length_error If new length exceeds @c max_size(). - * @throw std::out_of_range If @a pos is beyond the end of this - * string. - * - * Inserts @a n copies of character @a c starting at index @a pos. If - * adding characters causes the length to exceed max_size(), - * length_error is thrown. If @a pos > length(), out_of_range is - * thrown. The value of the string doesn't change if an error is - * thrown. - */ - basic_string& - insert(size_type __pos, size_type __n, _CharT __c) - { return _M_replace_aux(_M_check(__pos, "basic_string::insert"), - size_type(0), __n, __c); } - - /** - * @brief Insert one character. - * @param p Iterator referencing position in string to insert at. - * @param c The character to insert. - * @return Iterator referencing newly inserted char. - * @throw std::length_error If new length exceeds @c max_size(). - * - * Inserts character @a c at position referenced by @a p. If adding - * character causes the length to exceed max_size(), length_error is - * thrown. If @a p is beyond end of string, out_of_range is thrown. - * The value of the string doesn't change if an error is thrown. - */ - iterator - insert(iterator __p, _CharT __c) - { - _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend()); - const size_type __pos = __p - _M_ibegin(); - _M_replace_aux(__pos, size_type(0), size_type(1), __c); - _M_rep()->_M_set_leaked(); - return this->_M_ibegin() + __pos; - } - - /** - * @brief Remove characters. - * @param pos Index of first character to remove (default 0). - * @param n Number of characters to remove (default remainder). - * @return Reference to this string. - * @throw std::out_of_range If @a pos is beyond the end of this - * string. - * - * Removes @a n characters from this string starting at @a pos. The - * length of the string is reduced by @a n. If there are < @a n - * characters to remove, the remainder of the string is truncated. If - * @a p is beyond end of string, out_of_range is thrown. The value of - * the string doesn't change if an error is thrown. - */ - basic_string& - erase(size_type __pos = 0, size_type __n = npos) - { return _M_replace_safe(_M_check(__pos, "basic_string::erase"), - _M_limit(__pos, __n), NULL, size_type(0)); } - - /** - * @brief Remove one character. - * @param position Iterator referencing the character to remove. - * @return iterator referencing same location after removal. - * - * Removes the character at @a position from this string. The value - * of the string doesn't change if an error is thrown. - */ - iterator - erase(iterator __position) - { - _GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin() - && __position < _M_iend()); - const size_type __pos = __position - _M_ibegin(); - _M_replace_safe(__pos, size_type(1), NULL, size_type(0)); - _M_rep()->_M_set_leaked(); - return _M_ibegin() + __pos; - } - - /** - * @brief Remove a range of characters. - * @param first Iterator referencing the first character to remove. - * @param last Iterator referencing the end of the range. - * @return Iterator referencing location of first after removal. - * - * Removes the characters in the range [first,last) from this string. - * The value of the string doesn't change if an error is thrown. - */ - iterator - erase(iterator __first, iterator __last) - { - _GLIBCXX_DEBUG_PEDASSERT(__first >= _M_ibegin() && __first <= __last - && __last <= _M_iend()); - const size_type __pos = __first - _M_ibegin(); - _M_replace_safe(__pos, __last - __first, NULL, size_type(0)); - _M_rep()->_M_set_leaked(); - return _M_ibegin() + __pos; - } - - /** - * @brief Replace characters with value from another string. - * @param pos Index of first character to replace. - * @param n Number of characters to be replaced. - * @param str String to insert. - * @return Reference to this string. - * @throw std::out_of_range If @a pos is beyond the end of this - * string. - * @throw std::length_error If new length exceeds @c max_size(). - * - * Removes the characters in the range [pos,pos+n) from this string. - * In place, the value of @a str is inserted. If @a pos is beyond end - * of string, out_of_range is thrown. If the length of the result - * exceeds max_size(), length_error is thrown. The value of the string - * doesn't change if an error is thrown. - */ - basic_string& - replace(size_type __pos, size_type __n, const basic_string& __str) - { return this->replace(__pos, __n, __str._M_data(), __str.size()); } - - /** - * @brief Replace characters with value from another string. - * @param pos1 Index of first character to replace. - * @param n1 Number of characters to be replaced. - * @param str String to insert. - * @param pos2 Index of first character of str to use. - * @param n2 Number of characters from str to use. - * @return Reference to this string. - * @throw std::out_of_range If @a pos1 > size() or @a pos2 > - * str.size(). - * @throw std::length_error If new length exceeds @c max_size(). - * - * Removes the characters in the range [pos1,pos1 + n) from this - * string. In place, the value of @a str is inserted. If @a pos is - * beyond end of string, out_of_range is thrown. If the length of the - * result exceeds max_size(), length_error is thrown. The value of the - * string doesn't change if an error is thrown. - */ - basic_string& - replace(size_type __pos1, size_type __n1, const basic_string& __str, - size_type __pos2, size_type __n2) - { return this->replace(__pos1, __n1, __str._M_data() - + __str._M_check(__pos2, "basic_string::replace"), - __str._M_limit(__pos2, __n2)); } - - /** - * @brief Replace characters with value of a C substring. - * @param pos Index of first character to replace. - * @param n1 Number of characters to be replaced. - * @param str C string to insert. - * @param n2 Number of characters from str to use. - * @return Reference to this string. - * @throw std::out_of_range If @a pos1 > size(). - * @throw std::length_error If new length exceeds @c max_size(). - * - * Removes the characters in the range [pos,pos + n1) from this string. - * In place, the first @a n2 characters of @a str are inserted, or all - * of @a str if @a n2 is too large. If @a pos is beyond end of string, - * out_of_range is thrown. If the length of result exceeds max_size(), - * length_error is thrown. The value of the string doesn't change if - * an error is thrown. - */ - basic_string& - replace(size_type __pos, size_type __n1, const _CharT* __s, - size_type __n2); - - /** - * @brief Replace characters with value of a C string. - * @param pos Index of first character to replace. - * @param n1 Number of characters to be replaced. - * @param str C string to insert. - * @return Reference to this string. - * @throw std::out_of_range If @a pos > size(). - * @throw std::length_error If new length exceeds @c max_size(). - * - * Removes the characters in the range [pos,pos + n1) from this string. - * In place, the first @a n characters of @a str are inserted. If @a - * pos is beyond end of string, out_of_range is thrown. If the length - * of result exceeds max_size(), length_error is thrown. The value of - * the string doesn't change if an error is thrown. - */ - basic_string& - replace(size_type __pos, size_type __n1, const _CharT* __s) - { - __glibcxx_requires_string(__s); - return this->replace(__pos, __n1, __s, traits_type::length(__s)); - } - - /** - * @brief Replace characters with multiple characters. - * @param pos Index of first character to replace. - * @param n1 Number of characters to be replaced. - * @param n2 Number of characters to insert. - * @param c Character to insert. - * @return Reference to this string. - * @throw std::out_of_range If @a pos > size(). - * @throw std::length_error If new length exceeds @c max_size(). - * - * Removes the characters in the range [pos,pos + n1) from this string. - * In place, @a n2 copies of @a c are inserted. If @a pos is beyond - * end of string, out_of_range is thrown. If the length of result - * exceeds max_size(), length_error is thrown. The value of the string - * doesn't change if an error is thrown. - */ - basic_string& - replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c) - { return _M_replace_aux(_M_check(__pos, "basic_string::replace"), - _M_limit(__pos, __n1), __n2, __c); } - - /** - * @brief Replace range of characters with string. - * @param i1 Iterator referencing start of range to replace. - * @param i2 Iterator referencing end of range to replace. - * @param str String value to insert. - * @return Reference to this string. - * @throw std::length_error If new length exceeds @c max_size(). - * - * Removes the characters in the range [i1,i2). In place, the value of - * @a str is inserted. If the length of result exceeds max_size(), - * length_error is thrown. The value of the string doesn't change if - * an error is thrown. - */ - basic_string& - replace(iterator __i1, iterator __i2, const basic_string& __str) - { return this->replace(__i1, __i2, __str._M_data(), __str.size()); } - - /** - * @brief Replace range of characters with C substring. - * @param i1 Iterator referencing start of range to replace. - * @param i2 Iterator referencing end of range to replace. - * @param s C string value to insert. - * @param n Number of characters from s to insert. - * @return Reference to this string. - * @throw std::length_error If new length exceeds @c max_size(). - * - * Removes the characters in the range [i1,i2). In place, the first @a - * n characters of @a s are inserted. If the length of result exceeds - * max_size(), length_error is thrown. The value of the string doesn't - * change if an error is thrown. - */ - basic_string& - replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n) - { - _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 - && __i2 <= _M_iend()); - return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n); - } - - /** - * @brief Replace range of characters with C string. - * @param i1 Iterator referencing start of range to replace. - * @param i2 Iterator referencing end of range to replace. - * @param s C string value to insert. - * @return Reference to this string. - * @throw std::length_error If new length exceeds @c max_size(). - * - * Removes the characters in the range [i1,i2). In place, the - * characters of @a s are inserted. If the length of result exceeds - * max_size(), length_error is thrown. The value of the string doesn't - * change if an error is thrown. - */ - basic_string& - replace(iterator __i1, iterator __i2, const _CharT* __s) - { - __glibcxx_requires_string(__s); - return this->replace(__i1, __i2, __s, traits_type::length(__s)); - } - - /** - * @brief Replace range of characters with multiple characters - * @param i1 Iterator referencing start of range to replace. - * @param i2 Iterator referencing end of range to replace. - * @param n Number of characters to insert. - * @param c Character to insert. - * @return Reference to this string. - * @throw std::length_error If new length exceeds @c max_size(). - * - * Removes the characters in the range [i1,i2). In place, @a n copies - * of @a c are inserted. If the length of result exceeds max_size(), - * length_error is thrown. The value of the string doesn't change if - * an error is thrown. - */ - basic_string& - replace(iterator __i1, iterator __i2, size_type __n, _CharT __c) - { - _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 - && __i2 <= _M_iend()); - return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c); - } - - /** - * @brief Replace range of characters with range. - * @param i1 Iterator referencing start of range to replace. - * @param i2 Iterator referencing end of range to replace. - * @param k1 Iterator referencing start of range to insert. - * @param k2 Iterator referencing end of range to insert. - * @return Reference to this string. - * @throw std::length_error If new length exceeds @c max_size(). - * - * Removes the characters in the range [i1,i2). In place, characters - * in the range [k1,k2) are inserted. If the length of result exceeds - * max_size(), length_error is thrown. The value of the string doesn't - * change if an error is thrown. - */ - template<class _InputIterator> - basic_string& - replace(iterator __i1, iterator __i2, - _InputIterator __k1, _InputIterator __k2) - { - _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 - && __i2 <= _M_iend()); - __glibcxx_requires_valid_range(__k1, __k2); - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral()); - } - - // Specializations for the common case of pointer and iterator: - // useful to avoid the overhead of temporary buffering in _M_replace. - basic_string& - replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2) - { - _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 - && __i2 <= _M_iend()); - __glibcxx_requires_valid_range(__k1, __k2); - return this->replace(__i1 - _M_ibegin(), __i2 - __i1, - __k1, __k2 - __k1); - } - - basic_string& - replace(iterator __i1, iterator __i2, - const _CharT* __k1, const _CharT* __k2) - { - _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 - && __i2 <= _M_iend()); - __glibcxx_requires_valid_range(__k1, __k2); - return this->replace(__i1 - _M_ibegin(), __i2 - __i1, - __k1, __k2 - __k1); - } - - basic_string& - replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2) - { - _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 - && __i2 <= _M_iend()); - __glibcxx_requires_valid_range(__k1, __k2); - return this->replace(__i1 - _M_ibegin(), __i2 - __i1, - __k1.base(), __k2 - __k1); - } - - basic_string& - replace(iterator __i1, iterator __i2, - const_iterator __k1, const_iterator __k2) - { - _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 - && __i2 <= _M_iend()); - __glibcxx_requires_valid_range(__k1, __k2); - return this->replace(__i1 - _M_ibegin(), __i2 - __i1, - __k1.base(), __k2 - __k1); - } - - private: - template<class _Integer> - basic_string& - _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n, - _Integer __val, __true_type) - { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); } - - template<class _InputIterator> - basic_string& - _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1, - _InputIterator __k2, __false_type); - - basic_string& - _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2, - _CharT __c) - { - if (this->max_size() - (this->size() - __n1) < __n2) - __throw_length_error(__N("basic_string::_M_replace_aux")); - _M_mutate(__pos1, __n1, __n2); - if (__n2 == 1) - _M_data()[__pos1] = __c; - else if (__n2) - traits_type::assign(_M_data() + __pos1, __n2, __c); - return *this; - } - - basic_string& - _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s, - size_type __n2) - { - _M_mutate(__pos1, __n1, __n2); - if (__n2 == 1) - _M_data()[__pos1] = *__s; - else if (__n2) - traits_type::copy(_M_data() + __pos1, __s, __n2); - return *this; - } - - // _S_construct_aux is used to implement the 21.3.1 para 15 which - // requires special behaviour if _InIter is an integral type - template<class _InIterator> - static _CharT* - _S_construct_aux(_InIterator __beg, _InIterator __end, - const _Alloc& __a, __false_type) - { - typedef typename iterator_traits<_InIterator>::iterator_category _Tag; - return _S_construct(__beg, __end, __a, _Tag()); - } - - template<class _InIterator> - static _CharT* - _S_construct_aux(_InIterator __beg, _InIterator __end, - const _Alloc& __a, __true_type) - { return _S_construct(static_cast<size_type>(__beg), - static_cast<value_type>(__end), __a); } - - template<class _InIterator> - static _CharT* - _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a) - { - typedef typename _Is_integer<_InIterator>::_Integral _Integral; - return _S_construct_aux(__beg, __end, __a, _Integral()); - } - - // For Input Iterators, used in istreambuf_iterators, etc. - template<class _InIterator> - static _CharT* - _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, - input_iterator_tag); - - // For forward_iterators up to random_access_iterators, used for - // string::iterator, _CharT*, etc. - template<class _FwdIterator> - static _CharT* - _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a, - forward_iterator_tag); - - static _CharT* - _S_construct(size_type __req, _CharT __c, const _Alloc& __a); - - public: - - /** - * @brief Copy substring into C string. - * @param s C string to copy value into. - * @param n Number of characters to copy. - * @param pos Index of first character to copy. - * @return Number of characters actually copied - * @throw std::out_of_range If pos > size(). - * - * Copies up to @a n characters starting at @a pos into the C string @a - * s. If @a pos is greater than size(), out_of_range is thrown. - */ - size_type - copy(_CharT* __s, size_type __n, size_type __pos = 0) const; - - /** - * @brief Swap contents with another string. - * @param s String to swap with. - * - * Exchanges the contents of this string with that of @a s in constant - * time. - */ - void - swap(basic_string& __s); - - // String operations: - /** - * @brief Return const pointer to null-terminated contents. - * - * This is a handle to internal data. Do not modify or dire things may - * happen. - */ - const _CharT* - c_str() const { return _M_data(); } - - /** - * @brief Return const pointer to contents. - * - * This is a handle to internal data. Do not modify or dire things may - * happen. - */ - const _CharT* - data() const { return _M_data(); } - - /** - * @brief Return copy of allocator used to construct this string. - */ - allocator_type - get_allocator() const { return _M_dataplus; } - - /** - * @brief Find position of a C substring. - * @param s C string to locate. - * @param pos Index of character to search from. - * @param n Number of characters from @a s to search for. - * @return Index of start of first occurrence. - * - * Starting from @a pos, searches forward for the first @a n characters - * in @a s within this string. If found, returns the index where it - * begins. If not found, returns npos. - */ - size_type - find(const _CharT* __s, size_type __pos, size_type __n) const; - - /** - * @brief Find position of a string. - * @param str String to locate. - * @param pos Index of character to search from (default 0). - * @return Index of start of first occurrence. - * - * Starting from @a pos, searches forward for value of @a str within - * this string. If found, returns the index where it begins. If not - * found, returns npos. - */ - size_type - find(const basic_string& __str, size_type __pos = 0) const - { return this->find(__str.data(), __pos, __str.size()); } - - /** - * @brief Find position of a C string. - * @param s C string to locate. - * @param pos Index of character to search from (default 0). - * @return Index of start of first occurrence. - * - * Starting from @a pos, searches forward for the value of @a s within - * this string. If found, returns the index where it begins. If not - * found, returns npos. - */ - size_type - find(const _CharT* __s, size_type __pos = 0) const - { - __glibcxx_requires_string(__s); - return this->find(__s, __pos, traits_type::length(__s)); - } - - /** - * @brief Find position of a character. - * @param c Character to locate. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. - * - * Starting from @a pos, searches forward for @a c within this string. - * If found, returns the index where it was found. If not found, - * returns npos. - */ - size_type - find(_CharT __c, size_type __pos = 0) const; - - /** - * @brief Find last position of a string. - * @param str String to locate. - * @param pos Index of character to search back from (default end). - * @return Index of start of last occurrence. - * - * Starting from @a pos, searches backward for value of @a str within - * this string. If found, returns the index where it begins. If not - * found, returns npos. - */ - size_type - rfind(const basic_string& __str, size_type __pos = npos) const - { return this->rfind(__str.data(), __pos, __str.size()); } - - /** - * @brief Find last position of a C substring. - * @param s C string to locate. - * @param pos Index of character to search back from. - * @param n Number of characters from s to search for. - * @return Index of start of last occurrence. - * - * Starting from @a pos, searches backward for the first @a n - * characters in @a s within this string. If found, returns the index - * where it begins. If not found, returns npos. - */ - size_type - rfind(const _CharT* __s, size_type __pos, size_type __n) const; - - /** - * @brief Find last position of a C string. - * @param s C string to locate. - * @param pos Index of character to start search at (default 0). - * @return Index of start of last occurrence. - * - * Starting from @a pos, searches backward for the value of @a s within - * this string. If found, returns the index where it begins. If not - * found, returns npos. - */ - size_type - rfind(const _CharT* __s, size_type __pos = npos) const - { - __glibcxx_requires_string(__s); - return this->rfind(__s, __pos, traits_type::length(__s)); - } - - /** - * @brief Find last position of a character. - * @param c Character to locate. - * @param pos Index of character to search back from (default 0). - * @return Index of last occurrence. - * - * Starting from @a pos, searches backward for @a c within this string. - * If found, returns the index where it was found. If not found, - * returns npos. - */ - size_type - rfind(_CharT __c, size_type __pos = npos) const; - - /** - * @brief Find position of a character of string. - * @param str String containing characters to locate. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. - * - * Starting from @a pos, searches forward for one of the characters of - * @a str within this string. If found, returns the index where it was - * found. If not found, returns npos. - */ - size_type - find_first_of(const basic_string& __str, size_type __pos = 0) const - { return this->find_first_of(__str.data(), __pos, __str.size()); } - - /** - * @brief Find position of a character of C substring. - * @param s String containing characters to locate. - * @param pos Index of character to search from (default 0). - * @param n Number of characters from s to search for. - * @return Index of first occurrence. - * - * Starting from @a pos, searches forward for one of the first @a n - * characters of @a s within this string. If found, returns the index - * where it was found. If not found, returns npos. - */ - size_type - find_first_of(const _CharT* __s, size_type __pos, size_type __n) const; - - /** - * @brief Find position of a character of C string. - * @param s String containing characters to locate. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. - * - * Starting from @a pos, searches forward for one of the characters of - * @a s within this string. If found, returns the index where it was - * found. If not found, returns npos. - */ - size_type - find_first_of(const _CharT* __s, size_type __pos = 0) const - { - __glibcxx_requires_string(__s); - return this->find_first_of(__s, __pos, traits_type::length(__s)); - } - - /** - * @brief Find position of a character. - * @param c Character to locate. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. - * - * Starting from @a pos, searches forward for the character @a c within - * this string. If found, returns the index where it was found. If - * not found, returns npos. - * - * Note: equivalent to find(c, pos). - */ - size_type - find_first_of(_CharT __c, size_type __pos = 0) const - { return this->find(__c, __pos); } - - /** - * @brief Find last position of a character of string. - * @param str String containing characters to locate. - * @param pos Index of character to search back from (default end). - * @return Index of last occurrence. - * - * Starting from @a pos, searches backward for one of the characters of - * @a str within this string. If found, returns the index where it was - * found. If not found, returns npos. - */ - size_type - find_last_of(const basic_string& __str, size_type __pos = npos) const - { return this->find_last_of(__str.data(), __pos, __str.size()); } - - /** - * @brief Find last position of a character of C substring. - * @param s C string containing characters to locate. - * @param pos Index of character to search back from (default end). - * @param n Number of characters from s to search for. - * @return Index of last occurrence. - * - * Starting from @a pos, searches backward for one of the first @a n - * characters of @a s within this string. If found, returns the index - * where it was found. If not found, returns npos. - */ - size_type - find_last_of(const _CharT* __s, size_type __pos, size_type __n) const; - - /** - * @brief Find last position of a character of C string. - * @param s C string containing characters to locate. - * @param pos Index of character to search back from (default end). - * @return Index of last occurrence. - * - * Starting from @a pos, searches backward for one of the characters of - * @a s within this string. If found, returns the index where it was - * found. If not found, returns npos. - */ - size_type - find_last_of(const _CharT* __s, size_type __pos = npos) const - { - __glibcxx_requires_string(__s); - return this->find_last_of(__s, __pos, traits_type::length(__s)); - } - - /** - * @brief Find last position of a character. - * @param c Character to locate. - * @param pos Index of character to search back from (default 0). - * @return Index of last occurrence. - * - * Starting from @a pos, searches backward for @a c within this string. - * If found, returns the index where it was found. If not found, - * returns npos. - * - * Note: equivalent to rfind(c, pos). - */ - size_type - find_last_of(_CharT __c, size_type __pos = npos) const - { return this->rfind(__c, __pos); } - - /** - * @brief Find position of a character not in string. - * @param str String containing characters to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. - * - * Starting from @a pos, searches forward for a character not contained - * in @a str within this string. If found, returns the index where it - * was found. If not found, returns npos. - */ - size_type - find_first_not_of(const basic_string& __str, size_type __pos = 0) const - { return this->find_first_not_of(__str.data(), __pos, __str.size()); } - - /** - * @brief Find position of a character not in C substring. - * @param s C string containing characters to avoid. - * @param pos Index of character to search from (default 0). - * @param n Number of characters from s to consider. - * @return Index of first occurrence. - * - * Starting from @a pos, searches forward for a character not contained - * in the first @a n characters of @a s within this string. If found, - * returns the index where it was found. If not found, returns npos. - */ - size_type - find_first_not_of(const _CharT* __s, size_type __pos, - size_type __n) const; - - /** - * @brief Find position of a character not in C string. - * @param s C string containing characters to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. - * - * Starting from @a pos, searches forward for a character not contained - * in @a s within this string. If found, returns the index where it - * was found. If not found, returns npos. - */ - size_type - find_first_not_of(const _CharT* __s, size_type __pos = 0) const - { - __glibcxx_requires_string(__s); - return this->find_first_not_of(__s, __pos, traits_type::length(__s)); - } - - /** - * @brief Find position of a different character. - * @param c Character to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. - * - * Starting from @a pos, searches forward for a character other than @a c - * within this string. If found, returns the index where it was found. - * If not found, returns npos. - */ - size_type - find_first_not_of(_CharT __c, size_type __pos = 0) const; - - /** - * @brief Find last position of a character not in string. - * @param str String containing characters to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. - * - * Starting from @a pos, searches backward for a character not - * contained in @a str within this string. If found, returns the index - * where it was found. If not found, returns npos. - */ - size_type - find_last_not_of(const basic_string& __str, size_type __pos = npos) const - { return this->find_last_not_of(__str.data(), __pos, __str.size()); } - - /** - * @brief Find last position of a character not in C substring. - * @param s C string containing characters to avoid. - * @param pos Index of character to search from (default 0). - * @param n Number of characters from s to consider. - * @return Index of first occurrence. - * - * Starting from @a pos, searches backward for a character not - * contained in the first @a n characters of @a s within this string. - * If found, returns the index where it was found. If not found, - * returns npos. - */ - size_type - find_last_not_of(const _CharT* __s, size_type __pos, - size_type __n) const; - /** - * @brief Find position of a character not in C string. - * @param s C string containing characters to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. - * - * Starting from @a pos, searches backward for a character not - * contained in @a s within this string. If found, returns the index - * where it was found. If not found, returns npos. - */ - size_type - find_last_not_of(const _CharT* __s, size_type __pos = npos) const - { - __glibcxx_requires_string(__s); - return this->find_last_not_of(__s, __pos, traits_type::length(__s)); - } - - /** - * @brief Find last position of a different character. - * @param c Character to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. - * - * Starting from @a pos, searches backward for a character other than - * @a c within this string. If found, returns the index where it was - * found. If not found, returns npos. - */ - size_type - find_last_not_of(_CharT __c, size_type __pos = npos) const; - - /** - * @brief Get a substring. - * @param pos Index of first character (default 0). - * @param n Number of characters in substring (default remainder). - * @return The new string. - * @throw std::out_of_range If pos > size(). - * - * Construct and return a new string using the @a n characters starting - * at @a pos. If the string is too short, use the remainder of the - * characters. If @a pos is beyond the end of the string, out_of_range - * is thrown. - */ - basic_string - substr(size_type __pos = 0, size_type __n = npos) const - { return basic_string(*this, - _M_check(__pos, "basic_string::substr"), __n); } - - /** - * @brief Compare to a string. - * @param str String to compare against. - * @return Integer < 0, 0, or > 0. - * - * Returns an integer < 0 if this string is ordered before @a str, 0 if - * their values are equivalent, or > 0 if this string is ordered after - * @a str. Determines the effective length rlen of the strings to - * compare as the smallest of size() and str.size(). The function - * then compares the two strings by calling traits::compare(data(), - * str.data(),rlen). If the result of the comparison is nonzero returns - * it, otherwise the shorter one is ordered first. - */ - int - compare(const basic_string& __str) const - { - const size_type __size = this->size(); - const size_type __osize = __str.size(); - const size_type __len = std::min(__size, __osize); - - int __r = traits_type::compare(_M_data(), __str.data(), __len); - if (!__r) - __r = __size - __osize; - return __r; - } - - /** - * @brief Compare substring to a string. - * @param pos Index of first character of substring. - * @param n Number of characters in substring. - * @param str String to compare against. - * @return Integer < 0, 0, or > 0. - * - * Form the substring of this string from the @a n characters starting - * at @a pos. Returns an integer < 0 if the substring is ordered - * before @a str, 0 if their values are equivalent, or > 0 if the - * substring is ordered after @a str. Determines the effective length - * rlen of the strings to compare as the smallest of the length of the - * substring and @a str.size(). The function then compares the two - * strings by calling traits::compare(substring.data(),str.data(),rlen). - * If the result of the comparison is nonzero returns it, otherwise the - * shorter one is ordered first. - */ - int - compare(size_type __pos, size_type __n, const basic_string& __str) const; - - /** - * @brief Compare substring to a substring. - * @param pos1 Index of first character of substring. - * @param n1 Number of characters in substring. - * @param str String to compare against. - * @param pos2 Index of first character of substring of str. - * @param n2 Number of characters in substring of str. - * @return Integer < 0, 0, or > 0. - * - * Form the substring of this string from the @a n1 characters starting - * at @a pos1. Form the substring of @a str from the @a n2 characters - * starting at @a pos2. Returns an integer < 0 if this substring is - * ordered before the substring of @a str, 0 if their values are - * equivalent, or > 0 if this substring is ordered after the substring - * of @a str. Determines the effective length rlen of the strings - * to compare as the smallest of the lengths of the substrings. The - * function then compares the two strings by calling - * traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen). - * If the result of the comparison is nonzero returns it, otherwise the - * shorter one is ordered first. - */ - int - compare(size_type __pos1, size_type __n1, const basic_string& __str, - size_type __pos2, size_type __n2) const; - - /** - * @brief Compare to a C string. - * @param s C string to compare against. - * @return Integer < 0, 0, or > 0. - * - * Returns an integer < 0 if this string is ordered before @a s, 0 if - * their values are equivalent, or > 0 if this string is ordered after - * @a s. Determines the effective length rlen of the strings to - * compare as the smallest of size() and the length of a string - * constructed from @a s. The function then compares the two strings - * by calling traits::compare(data(),s,rlen). If the result of the - * comparison is nonzero returns it, otherwise the shorter one is - * ordered first. - */ - int - compare(const _CharT* __s) const; - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 5 String::compare specification questionable - /** - * @brief Compare substring to a C string. - * @param pos Index of first character of substring. - * @param n1 Number of characters in substring. - * @param s C string to compare against. - * @return Integer < 0, 0, or > 0. - * - * Form the substring of this string from the @a n1 characters starting - * at @a pos. Returns an integer < 0 if the substring is ordered - * before @a s, 0 if their values are equivalent, or > 0 if the - * substring is ordered after @a s. Determines the effective length - * rlen of the strings to compare as the smallest of the length of the - * substring and the length of a string constructed from @a s. The - * function then compares the two string by calling - * traits::compare(substring.data(),s,rlen). If the result of the - * comparison is nonzero returns it, otherwise the shorter one is - * ordered first. - */ - int - compare(size_type __pos, size_type __n1, const _CharT* __s) const; - - /** - * @brief Compare substring against a character array. - * @param pos1 Index of first character of substring. - * @param n1 Number of characters in substring. - * @param s character array to compare against. - * @param n2 Number of characters of s. - * @return Integer < 0, 0, or > 0. - * - * Form the substring of this string from the @a n1 characters starting - * at @a pos1. Form a string from the first @a n2 characters of @a s. - * Returns an integer < 0 if this substring is ordered before the string - * from @a s, 0 if their values are equivalent, or > 0 if this substring - * is ordered after the string from @a s. Determines the effective - * length rlen of the strings to compare as the smallest of the length - * of the substring and @a n2. The function then compares the two - * strings by calling traits::compare(substring.data(),s,rlen). If the - * result of the comparison is nonzero returns it, otherwise the shorter - * one is ordered first. - * - * NB: s must have at least n2 characters, '\0' has no special - * meaning. - */ - int - compare(size_type __pos, size_type __n1, const _CharT* __s, - size_type __n2) const; - }; - - template<typename _CharT, typename _Traits, typename _Alloc> - inline basic_string<_CharT, _Traits, _Alloc>:: - basic_string() - : _M_dataplus(_S_empty_rep()._M_refcopy(), _Alloc()) { } - - // operator+ - /** - * @brief Concatenate two strings. - * @param lhs First string. - * @param rhs Last string. - * @return New string with value of @a lhs followed by @a rhs. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc> - operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { - basic_string<_CharT, _Traits, _Alloc> __str(__lhs); - __str.append(__rhs); - return __str; - } - - /** - * @brief Concatenate C string and string. - * @param lhs First string. - * @param rhs Last string. - * @return New string with value of @a lhs followed by @a rhs. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT,_Traits,_Alloc> - operator+(const _CharT* __lhs, - const basic_string<_CharT,_Traits,_Alloc>& __rhs); - - /** - * @brief Concatenate character and string. - * @param lhs First string. - * @param rhs Last string. - * @return New string with @a lhs followed by @a rhs. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT,_Traits,_Alloc> - operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs); - - /** - * @brief Concatenate string and C string. - * @param lhs First string. - * @param rhs Last string. - * @return New string with @a lhs followed by @a rhs. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline basic_string<_CharT, _Traits, _Alloc> - operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const _CharT* __rhs) - { - basic_string<_CharT, _Traits, _Alloc> __str(__lhs); - __str.append(__rhs); - return __str; - } - - /** - * @brief Concatenate string and character. - * @param lhs First string. - * @param rhs Last string. - * @return New string with @a lhs followed by @a rhs. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline basic_string<_CharT, _Traits, _Alloc> - operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) - { - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - typedef typename __string_type::size_type __size_type; - __string_type __str(__lhs); - __str.append(__size_type(1), __rhs); - return __str; - } - - // operator == - /** - * @brief Test equivalence of two strings. - * @param lhs First string. - * @param rhs Second string. - * @return True if @a lhs.compare(@a rhs) == 0. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __lhs.compare(__rhs) == 0; } - - /** - * @brief Test equivalence of C string and string. - * @param lhs C string. - * @param rhs String. - * @return True if @a rhs.compare(@a lhs) == 0. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator==(const _CharT* __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __rhs.compare(__lhs) == 0; } - - /** - * @brief Test equivalence of string and C string. - * @param lhs String. - * @param rhs C string. - * @return True if @a lhs.compare(@a rhs) == 0. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const _CharT* __rhs) - { return __lhs.compare(__rhs) == 0; } - - // operator != - /** - * @brief Test difference of two strings. - * @param lhs First string. - * @param rhs Second string. - * @return True if @a lhs.compare(@a rhs) != 0. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __rhs.compare(__lhs) != 0; } - - /** - * @brief Test difference of C string and string. - * @param lhs C string. - * @param rhs String. - * @return True if @a rhs.compare(@a lhs) != 0. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator!=(const _CharT* __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __rhs.compare(__lhs) != 0; } - - /** - * @brief Test difference of string and C string. - * @param lhs String. - * @param rhs C string. - * @return True if @a lhs.compare(@a rhs) != 0. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const _CharT* __rhs) - { return __lhs.compare(__rhs) != 0; } - - // operator < - /** - * @brief Test if string precedes string. - * @param lhs First string. - * @param rhs Second string. - * @return True if @a lhs precedes @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __lhs.compare(__rhs) < 0; } - - /** - * @brief Test if string precedes C string. - * @param lhs String. - * @param rhs C string. - * @return True if @a lhs precedes @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const _CharT* __rhs) - { return __lhs.compare(__rhs) < 0; } - - /** - * @brief Test if C string precedes string. - * @param lhs C string. - * @param rhs String. - * @return True if @a lhs precedes @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator<(const _CharT* __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __rhs.compare(__lhs) > 0; } - - // operator > - /** - * @brief Test if string follows string. - * @param lhs First string. - * @param rhs Second string. - * @return True if @a lhs follows @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __lhs.compare(__rhs) > 0; } - - /** - * @brief Test if string follows C string. - * @param lhs String. - * @param rhs C string. - * @return True if @a lhs follows @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const _CharT* __rhs) - { return __lhs.compare(__rhs) > 0; } - - /** - * @brief Test if C string follows string. - * @param lhs C string. - * @param rhs String. - * @return True if @a lhs follows @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator>(const _CharT* __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __rhs.compare(__lhs) < 0; } - - // operator <= - /** - * @brief Test if string doesn't follow string. - * @param lhs First string. - * @param rhs Second string. - * @return True if @a lhs doesn't follow @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __lhs.compare(__rhs) <= 0; } - - /** - * @brief Test if string doesn't follow C string. - * @param lhs String. - * @param rhs C string. - * @return True if @a lhs doesn't follow @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const _CharT* __rhs) - { return __lhs.compare(__rhs) <= 0; } - - /** - * @brief Test if C string doesn't follow string. - * @param lhs C string. - * @param rhs String. - * @return True if @a lhs doesn't follow @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator<=(const _CharT* __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __rhs.compare(__lhs) >= 0; } - - // operator >= - /** - * @brief Test if string doesn't precede string. - * @param lhs First string. - * @param rhs Second string. - * @return True if @a lhs doesn't precede @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __lhs.compare(__rhs) >= 0; } - - /** - * @brief Test if string doesn't precede C string. - * @param lhs String. - * @param rhs C string. - * @return True if @a lhs doesn't precede @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, - const _CharT* __rhs) - { return __lhs.compare(__rhs) >= 0; } - - /** - * @brief Test if C string doesn't precede string. - * @param lhs C string. - * @param rhs String. - * @return True if @a lhs doesn't precede @a rhs. False otherwise. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline bool - operator>=(const _CharT* __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { return __rhs.compare(__lhs) <= 0; } - - /** - * @brief Swap contents of two strings. - * @param lhs First string. - * @param rhs Second string. - * - * Exchanges the contents of @a lhs and @a rhs in constant time. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline void - swap(basic_string<_CharT, _Traits, _Alloc>& __lhs, - basic_string<_CharT, _Traits, _Alloc>& __rhs) - { __lhs.swap(__rhs); } - - /** - * @brief Read stream into a string. - * @param is Input stream. - * @param str Buffer to store into. - * @return Reference to the input stream. - * - * Stores characters from @a is into @a str until whitespace is found, the - * end of the stream is encountered, or str.max_size() is reached. If - * is.width() is non-zero, that is the limit on the number of characters - * stored into @a str. Any previous contents of @a str are erased. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __is, - basic_string<_CharT, _Traits, _Alloc>& __str); - - /** - * @brief Write string to a stream. - * @param os Output stream. - * @param str String to write out. - * @return Reference to the output stream. - * - * Output characters of @a str into os following the same rules as for - * writing a C string. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __os, - const basic_string<_CharT, _Traits, _Alloc>& __str); - - /** - * @brief Read a line from stream into a string. - * @param is Input stream. - * @param str Buffer to store into. - * @param delim Character marking end of line. - * @return Reference to the input stream. - * - * Stores characters from @a is into @a str until @a delim is found, the - * end of the stream is encountered, or str.max_size() is reached. If - * is.width() is non-zero, that is the limit on the number of characters - * stored into @a str. Any previous contents of @a str are erased. If @a - * delim was encountered, it is extracted but not stored into @a str. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - basic_istream<_CharT,_Traits>& - getline(basic_istream<_CharT, _Traits>& __is, - basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim); - - /** - * @brief Read a line from stream into a string. - * @param is Input stream. - * @param str Buffer to store into. - * @return Reference to the input stream. - * - * Stores characters from is into @a str until '\n' is found, the end of - * the stream is encountered, or str.max_size() is reached. If is.width() - * is non-zero, that is the limit on the number of characters stored into - * @a str. Any previous contents of @a str are erased. If end of line was - * encountered, it is extracted but not stored into @a str. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - inline basic_istream<_CharT,_Traits>& - getline(basic_istream<_CharT, _Traits>& __is, - basic_string<_CharT, _Traits, _Alloc>& __str); -} // namespace std - -#endif /* _BASIC_STRING_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_string.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_string.tcc deleted file mode 100644 index 77b90b6d8dc..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_string.tcc +++ /dev/null @@ -1,964 +0,0 @@ -// Components for manipulating sequences of characters -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 21 Strings library -// - -// This file is included by <string>. It is not meant to be included -// separately. - -// Written by Jason Merrill based upon the specification by Takanori Adachi -// in ANSI X3J16/94-0013R2. Rewritten by Nathan Myers to ISO-14882. - -#ifndef _BASIC_STRING_TCC -#define _BASIC_STRING_TCC 1 - -#pragma GCC system_header - -namespace std -{ - template<typename _Type> - inline bool - __is_null_pointer(_Type* __ptr) - { return __ptr == 0; } - - template<typename _Type> - inline bool - __is_null_pointer(_Type) - { return false; } - - template<typename _CharT, typename _Traits, typename _Alloc> - const typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - _Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4; - - template<typename _CharT, typename _Traits, typename _Alloc> - const _CharT - basic_string<_CharT, _Traits, _Alloc>:: - _Rep::_S_terminal = _CharT(); - - template<typename _CharT, typename _Traits, typename _Alloc> - const typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>::npos; - - // Linker sets _S_empty_rep_storage to all 0s (one reference, empty string) - // at static init time (before static ctors are run). - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[ - (sizeof(_Rep_base) + sizeof(_CharT) + sizeof(size_type) - 1) / - sizeof(size_type)]; - - // NB: This is the special case for Input Iterators, used in - // istreambuf_iterators, etc. - // Input Iterators have a cost structure very different from - // pointers, calling for a different coding style. - template<typename _CharT, typename _Traits, typename _Alloc> - template<typename _InIterator> - _CharT* - basic_string<_CharT, _Traits, _Alloc>:: - _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, - input_iterator_tag) - { - if (__beg == __end && __a == _Alloc()) - return _S_empty_rep()._M_refcopy(); - - // Avoid reallocation for common case. - _CharT __buf[128]; - size_type __len = 0; - while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT)) - { - __buf[__len++] = *__beg; - ++__beg; - } - _Rep* __r = _Rep::_S_create(__len, size_type(0), __a); - traits_type::copy(__r->_M_refdata(), __buf, __len); - try - { - while (__beg != __end) - { - if (__len == __r->_M_capacity) - { - // Allocate more space. - _Rep* __another = _Rep::_S_create(__len + 1, __len, __a); - traits_type::copy(__another->_M_refdata(), - __r->_M_refdata(), __len); - __r->_M_destroy(__a); - __r = __another; - } - __r->_M_refdata()[__len++] = *__beg; - ++__beg; - } - } - catch(...) - { - __r->_M_destroy(__a); - __throw_exception_again; - } - __r->_M_length = __len; - __r->_M_refdata()[__len] = _Rep::_S_terminal; // grrr. - return __r->_M_refdata(); - } - - template<typename _CharT, typename _Traits, typename _Alloc> - template <typename _InIterator> - _CharT* - basic_string<_CharT, _Traits, _Alloc>:: - _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, - forward_iterator_tag) - { - if (__beg == __end && __a == _Alloc()) - return _S_empty_rep()._M_refcopy(); - - // NB: Not required, but considered best practice. - if (__builtin_expect(__is_null_pointer(__beg) && __beg != __end, 0)) - __throw_logic_error(__N("basic_string::_S_construct NULL not valid")); - - const size_type __dnew = static_cast<size_type>(std::distance(__beg, - __end)); - // Check for out_of_range and length_error exceptions. - _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a); - try - { _S_copy_chars(__r->_M_refdata(), __beg, __end); } - catch(...) - { - __r->_M_destroy(__a); - __throw_exception_again; - } - __r->_M_length = __dnew; - __r->_M_refdata()[__dnew] = _Rep::_S_terminal; // grrr. - return __r->_M_refdata(); - } - - template<typename _CharT, typename _Traits, typename _Alloc> - _CharT* - basic_string<_CharT, _Traits, _Alloc>:: - _S_construct(size_type __n, _CharT __c, const _Alloc& __a) - { - if (__n == 0 && __a == _Alloc()) - return _S_empty_rep()._M_refcopy(); - - // Check for out_of_range and length_error exceptions. - _Rep* __r = _Rep::_S_create(__n, size_type(0), __a); - if (__n) - traits_type::assign(__r->_M_refdata(), __n, __c); - - __r->_M_length = __n; - __r->_M_refdata()[__n] = _Rep::_S_terminal; // grrr - return __r->_M_refdata(); - } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>:: - basic_string(const basic_string& __str) - : _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()), - __str.get_allocator()), - __str.get_allocator()) - { } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>:: - basic_string(const _Alloc& __a) - : _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a) - { } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>:: - basic_string(const basic_string& __str, size_type __pos, size_type __n) - : _M_dataplus(_S_construct(__str._M_data() - + __str._M_check(__pos, - "basic_string::basic_string"), - __str._M_data() + __str._M_limit(__pos, __n) - + __pos, _Alloc()), _Alloc()) - { } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>:: - basic_string(const basic_string& __str, size_type __pos, - size_type __n, const _Alloc& __a) - : _M_dataplus(_S_construct(__str._M_data() - + __str._M_check(__pos, - "basic_string::basic_string"), - __str._M_data() + __str._M_limit(__pos, __n) - + __pos, __a), __a) - { } - - // TBD: DPG annotate - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>:: - basic_string(const _CharT* __s, size_type __n, const _Alloc& __a) - : _M_dataplus(_S_construct(__s, __s + __n, __a), __a) - { } - - // TBD: DPG annotate - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>:: - basic_string(const _CharT* __s, const _Alloc& __a) - : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) : - __s + npos, __a), __a) - { } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>:: - basic_string(size_type __n, _CharT __c, const _Alloc& __a) - : _M_dataplus(_S_construct(__n, __c, __a), __a) - { } - - // TBD: DPG annotate - template<typename _CharT, typename _Traits, typename _Alloc> - template<typename _InputIterator> - basic_string<_CharT, _Traits, _Alloc>:: - basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a) - : _M_dataplus(_S_construct(__beg, __end, __a), __a) - { } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>& - basic_string<_CharT, _Traits, _Alloc>:: - assign(const basic_string& __str) - { - if (_M_rep() != __str._M_rep()) - { - // XXX MT - const allocator_type __a = this->get_allocator(); - _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator()); - _M_rep()->_M_dispose(__a); - _M_data(__tmp); - } - return *this; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>& - basic_string<_CharT, _Traits, _Alloc>:: - assign(const _CharT* __s, size_type __n) - { - __glibcxx_requires_string_len(__s, __n); - if (__n > this->max_size()) - __throw_length_error(__N("basic_string::assign")); - if (_M_rep()->_M_is_shared() || less<const _CharT*>()(__s, _M_data()) - || less<const _CharT*>()(_M_data() + this->size(), __s)) - return _M_replace_safe(size_type(0), this->size(), __s, __n); - else - { - // Work in-place - const size_type __pos = __s - _M_data(); - if (__pos >= __n) - traits_type::copy(_M_data(), __s, __n); - else if (__pos) - traits_type::move(_M_data(), __s, __n); - _M_rep()->_M_set_sharable(); - _M_rep()->_M_length = __n; - _M_data()[__n] = _Rep::_S_terminal; // grr. - return *this; - } - } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>& - basic_string<_CharT, _Traits, _Alloc>:: - insert(size_type __pos, const _CharT* __s, size_type __n) - { - __glibcxx_requires_string_len(__s, __n); - _M_check(__pos, "basic_string::insert"); - if (this->max_size() - this->size() < __n) - __throw_length_error(__N("basic_string::insert")); - if (_M_rep()->_M_is_shared() || less<const _CharT*>()(__s, _M_data()) - || less<const _CharT*>()(_M_data() + this->size(), __s)) - return _M_replace_safe(__pos, size_type(0), __s, __n); - else - { - // Work in-place. If _M_mutate reallocates the string, __s - // does not point anymore to valid data, therefore we save its - // offset, then we restore it. - const size_type __off = __s - _M_data(); - _M_mutate(__pos, 0, __n); - __s = _M_data() + __off; - _CharT* __p = _M_data() + __pos; - if (__s + __n <= __p) - traits_type::copy(__p, __s, __n); - else if (__s >= __p) - traits_type::copy(__p, __s + __n, __n); - else - { - const size_type __nleft = __p - __s; - traits_type::copy(__p, __s, __nleft); - traits_type::copy(__p + __nleft, __p + __n, __n - __nleft); - } - return *this; - } - } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>& - basic_string<_CharT, _Traits, _Alloc>:: - replace(size_type __pos, size_type __n1, const _CharT* __s, - size_type __n2) - { - __glibcxx_requires_string_len(__s, __n2); - _M_check(__pos, "basic_string::replace"); - __n1 = _M_limit(__pos, __n1); - if (this->max_size() - (this->size() - __n1) < __n2) - __throw_length_error(__N("basic_string::replace")); - bool __left; - if (_M_rep()->_M_is_shared() || less<const _CharT*>()(__s, _M_data()) - || less<const _CharT*>()(_M_data() + this->size(), __s)) - return _M_replace_safe(__pos, __n1, __s, __n2); - else if ((__left = __s + __n2 <= _M_data() + __pos) - || _M_data() + __pos + __n1 <= __s) - { - // Work in-place: non-overlapping case. - const size_type __off = __s - _M_data(); - _M_mutate(__pos, __n1, __n2); - if (__left) - traits_type::copy(_M_data() + __pos, - _M_data() + __off, __n2); - else - traits_type::copy(_M_data() + __pos, - _M_data() + __off + __n2 - __n1, __n2); - return *this; - } - else - { - // Todo: overlapping case. - const basic_string __tmp(__s, __n2); - return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2); - } - } - - template<typename _CharT, typename _Traits, typename _Alloc> - void - basic_string<_CharT, _Traits, _Alloc>::_Rep:: - _M_destroy(const _Alloc& __a) throw () - { - const size_type __size = sizeof(_Rep_base) + - (this->_M_capacity + 1) * sizeof(_CharT); - _Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size); - } - - template<typename _CharT, typename _Traits, typename _Alloc> - void - basic_string<_CharT, _Traits, _Alloc>::_M_leak_hard() - { - if (_M_rep()->_M_is_shared()) - _M_mutate(0, 0, 0); - _M_rep()->_M_set_leaked(); - } - - template<typename _CharT, typename _Traits, typename _Alloc> - void - basic_string<_CharT, _Traits, _Alloc>:: - _M_mutate(size_type __pos, size_type __len1, size_type __len2) - { - const size_type __old_size = this->size(); - const size_type __new_size = __old_size + __len2 - __len1; - const size_type __how_much = __old_size - __pos - __len1; - - if (__new_size > capacity() || _M_rep()->_M_is_shared()) - { - // Must reallocate. - const allocator_type __a = get_allocator(); - _Rep* __r = _Rep::_S_create(__new_size, capacity(), __a); - - if (__pos) - traits_type::copy(__r->_M_refdata(), _M_data(), __pos); - if (__how_much) - traits_type::copy(__r->_M_refdata() + __pos + __len2, - _M_data() + __pos + __len1, __how_much); - - _M_rep()->_M_dispose(__a); - _M_data(__r->_M_refdata()); - } - else if (__how_much && __len1 != __len2) - { - // Work in-place - traits_type::move(_M_data() + __pos + __len2, - _M_data() + __pos + __len1, __how_much); - } - _M_rep()->_M_set_sharable(); - _M_rep()->_M_length = __new_size; - _M_data()[__new_size] = _Rep::_S_terminal; // grrr. (per 21.3.4) - // You cannot leave those LWG people alone for a second. - } - - template<typename _CharT, typename _Traits, typename _Alloc> - void - basic_string<_CharT, _Traits, _Alloc>::reserve(size_type __res) - { - if (__res != this->capacity() || _M_rep()->_M_is_shared()) - { - if (__res > this->max_size()) - __throw_length_error(__N("basic_string::reserve")); - // Make sure we don't shrink below the current size - if (__res < this->size()) - __res = this->size(); - const allocator_type __a = get_allocator(); - _CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size()); - _M_rep()->_M_dispose(__a); - _M_data(__tmp); - } - } - - template<typename _CharT, typename _Traits, typename _Alloc> - void basic_string<_CharT, _Traits, _Alloc>::swap(basic_string& __s) - { - if (_M_rep()->_M_is_leaked()) - _M_rep()->_M_set_sharable(); - if (__s._M_rep()->_M_is_leaked()) - __s._M_rep()->_M_set_sharable(); - if (this->get_allocator() == __s.get_allocator()) - { - _CharT* __tmp = _M_data(); - _M_data(__s._M_data()); - __s._M_data(__tmp); - } - // The code below can usually be optimized away. - else - { - const basic_string __tmp1(_M_ibegin(), _M_iend(), - __s.get_allocator()); - const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(), - this->get_allocator()); - *this = __tmp2; - __s = __tmp1; - } - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::_Rep* - basic_string<_CharT, _Traits, _Alloc>::_Rep:: - _S_create(size_type __capacity, size_type __old_capacity, - const _Alloc& __alloc) - { - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 83. String::npos vs. string::max_size() - if (__capacity > _S_max_size) - __throw_length_error(__N("basic_string::_S_create")); - - // The standard places no restriction on allocating more memory - // than is strictly needed within this layer at the moment or as - // requested by an explicit application call to reserve(). - - // Many malloc implementations perform quite poorly when an - // application attempts to allocate memory in a stepwise fashion - // growing each allocation size by only 1 char. Additionally, - // it makes little sense to allocate less linear memory than the - // natural blocking size of the malloc implementation. - // Unfortunately, we would need a somewhat low-level calculation - // with tuned parameters to get this perfect for any particular - // malloc implementation. Fortunately, generalizations about - // common features seen among implementations seems to suffice. - - // __pagesize need not match the actual VM page size for good - // results in practice, thus we pick a common value on the low - // side. __malloc_header_size is an estimate of the amount of - // overhead per memory allocation (in practice seen N * sizeof - // (void*) where N is 0, 2 or 4). According to folklore, - // picking this value on the high side is better than - // low-balling it (especially when this algorithm is used with - // malloc implementations that allocate memory blocks rounded up - // to a size which is a power of 2). - const size_type __pagesize = 4096; // must be 2^i * __subpagesize - const size_type __subpagesize = 128; // should be >> __malloc_header_size - const size_type __malloc_header_size = 4 * sizeof (void*); - - // The below implements an exponential growth policy, necessary to - // meet amortized linear time requirements of the library: see - // http://gcc.gnu.org/ml/libstdc++/2001-07/msg00085.html. - // It's active for allocations requiring an amount of memory above - // system pagesize. This is consistent with the requirements of the - // standard: http://gcc.gnu.org/ml/libstdc++/2001-07/msg00130.html - - // The biggest string which fits in a memory page - const size_type __page_capacity = ((__pagesize - __malloc_header_size - - sizeof(_Rep) - sizeof(_CharT)) - / sizeof(_CharT)); - - if (__capacity > __old_capacity && __capacity < 2 * __old_capacity - && __capacity > __page_capacity) - __capacity = 2 * __old_capacity; - - // NB: Need an array of char_type[__capacity], plus a terminating - // null char_type() element, plus enough for the _Rep data structure. - // Whew. Seemingly so needy, yet so elemental. - size_type __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep); - - const size_type __adj_size = __size + __malloc_header_size; - if (__adj_size > __pagesize) - { - const size_type __extra = __pagesize - __adj_size % __pagesize; - __capacity += __extra / sizeof(_CharT); - // Never allocate a string bigger than _S_max_size. - if (__capacity > _S_max_size) - __capacity = _S_max_size; - __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep); - } - else if (__size > __subpagesize) - { - const size_type __extra = __subpagesize - __adj_size % __subpagesize; - __capacity += __extra / sizeof(_CharT); - __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep); - } - - // NB: Might throw, but no worries about a leak, mate: _Rep() - // does not throw. - void* __place = _Raw_bytes_alloc(__alloc).allocate(__size); - _Rep *__p = new (__place) _Rep; - __p->_M_capacity = __capacity; - __p->_M_set_sharable(); // One reference. - __p->_M_length = 0; - return __p; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - _CharT* - basic_string<_CharT, _Traits, _Alloc>::_Rep:: - _M_clone(const _Alloc& __alloc, size_type __res) - { - // Requested capacity of the clone. - const size_type __requested_cap = this->_M_length + __res; - _Rep* __r = _Rep::_S_create(__requested_cap, this->_M_capacity, - __alloc); - if (this->_M_length) - traits_type::copy(__r->_M_refdata(), _M_refdata(), - this->_M_length); - - __r->_M_length = this->_M_length; - __r->_M_refdata()[this->_M_length] = _Rep::_S_terminal; - return __r->_M_refdata(); - } - - template<typename _CharT, typename _Traits, typename _Alloc> - void - basic_string<_CharT, _Traits, _Alloc>::resize(size_type __n, _CharT __c) - { - if (__n > max_size()) - __throw_length_error(__N("basic_string::resize")); - const size_type __size = this->size(); - if (__size < __n) - this->append(__n - __size, __c); - else if (__n < __size) - this->erase(__n); - // else nothing (in particular, avoid calling _M_mutate() unnecessarily.) - } - - template<typename _CharT, typename _Traits, typename _Alloc> - template<typename _InputIterator> - basic_string<_CharT, _Traits, _Alloc>& - basic_string<_CharT, _Traits, _Alloc>:: - _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1, - _InputIterator __k2, __false_type) - { - const basic_string __s(__k1, __k2); - const size_type __n1 = __i2 - __i1; - if (this->max_size() - (this->size() - __n1) < __s.size()) - __throw_length_error(__N("basic_string::_M_replace_dispatch")); - return _M_replace_safe(__i1 - _M_ibegin(), __n1, __s._M_data(), - __s.size()); - } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>& - basic_string<_CharT, _Traits, _Alloc>:: - append(const basic_string& __str) - { - // Iff appending itself, string needs to pre-reserve the - // correct size so that _M_mutate does not clobber the - // pointer __str._M_data() formed here. - const size_type __size = __str.size(); - const size_type __len = __size + this->size(); - if (__len > this->capacity()) - this->reserve(__len); - return _M_replace_safe(this->size(), size_type(0), __str._M_data(), - __str.size()); - } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>& - basic_string<_CharT, _Traits, _Alloc>:: - append(const basic_string& __str, size_type __pos, size_type __n) - { - // Iff appending itself, string needs to pre-reserve the - // correct size so that _M_mutate does not clobber the - // pointer __str._M_data() formed here. - __str._M_check(__pos, "basic_string::append"); - __n = __str._M_limit(__pos, __n); - const size_type __len = __n + this->size(); - if (__len > this->capacity()) - this->reserve(__len); - return _M_replace_safe(this->size(), size_type(0), __str._M_data() - + __pos, __n); - } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc>& - basic_string<_CharT, _Traits, _Alloc>:: - append(const _CharT* __s, size_type __n) - { - __glibcxx_requires_string_len(__s, __n); - const size_type __len = __n + this->size(); - if (__len > this->capacity()) - this->reserve(__len); - return _M_replace_safe(this->size(), size_type(0), __s, __n); - } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc> - operator+(const _CharT* __lhs, - const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { - __glibcxx_requires_string(__lhs); - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - typedef typename __string_type::size_type __size_type; - const __size_type __len = _Traits::length(__lhs); - __string_type __str; - __str.reserve(__len + __rhs.size()); - __str.append(__lhs, __len); - __str.append(__rhs); - return __str; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_string<_CharT, _Traits, _Alloc> - operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) - { - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - typedef typename __string_type::size_type __size_type; - __string_type __str; - const __size_type __len = __rhs.size(); - __str.reserve(__len + 1); - __str.append(__size_type(1), __lhs); - __str.append(__rhs); - return __str; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - copy(_CharT* __s, size_type __n, size_type __pos) const - { - _M_check(__pos, "basic_string::copy"); - __n = _M_limit(__pos, __n); - __glibcxx_requires_string_len(__s, __n); - if (__n) - traits_type::copy(__s, _M_data() + __pos, __n); - // 21.3.5.7 par 3: do not append null. (good.) - return __n; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - find(const _CharT* __s, size_type __pos, size_type __n) const - { - __glibcxx_requires_string_len(__s, __n); - const size_type __size = this->size(); - const _CharT* __data = _M_data(); - for (; __pos + __n <= __size; ++__pos) - if (traits_type::compare(__data + __pos, __s, __n) == 0) - return __pos; - return npos; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - find(_CharT __c, size_type __pos) const - { - const size_type __size = this->size(); - size_type __ret = npos; - if (__pos < __size) - { - const _CharT* __data = _M_data(); - const size_type __n = __size - __pos; - const _CharT* __p = traits_type::find(__data + __pos, __n, __c); - if (__p) - __ret = __p - __data; - } - return __ret; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - rfind(const _CharT* __s, size_type __pos, size_type __n) const - { - __glibcxx_requires_string_len(__s, __n); - const size_type __size = this->size(); - if (__n <= __size) - { - __pos = std::min(size_type(__size - __n), __pos); - const _CharT* __data = _M_data(); - do - { - if (traits_type::compare(__data + __pos, __s, __n) == 0) - return __pos; - } - while (__pos-- > 0); - } - return npos; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - rfind(_CharT __c, size_type __pos) const - { - size_type __size = this->size(); - if (__size) - { - if (--__size > __pos) - __size = __pos; - for (++__size; __size-- > 0; ) - if (traits_type::eq(_M_data()[__size], __c)) - return __size; - } - return npos; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - find_first_of(const _CharT* __s, size_type __pos, size_type __n) const - { - __glibcxx_requires_string_len(__s, __n); - for (; __n && __pos < this->size(); ++__pos) - { - const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]); - if (__p) - return __pos; - } - return npos; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - find_last_of(const _CharT* __s, size_type __pos, size_type __n) const - { - __glibcxx_requires_string_len(__s, __n); - size_type __size = this->size(); - if (__size && __n) - { - if (--__size > __pos) - __size = __pos; - do - { - if (traits_type::find(__s, __n, _M_data()[__size])) - return __size; - } - while (__size-- != 0); - } - return npos; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const - { - __glibcxx_requires_string_len(__s, __n); - for (; __pos < this->size(); ++__pos) - if (!traits_type::find(__s, __n, _M_data()[__pos])) - return __pos; - return npos; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - find_first_not_of(_CharT __c, size_type __pos) const - { - for (; __pos < this->size(); ++__pos) - if (!traits_type::eq(_M_data()[__pos], __c)) - return __pos; - return npos; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const - { - __glibcxx_requires_string_len(__s, __n); - size_type __size = this->size(); - if (__size) - { - if (--__size > __pos) - __size = __pos; - do - { - if (!traits_type::find(__s, __n, _M_data()[__size])) - return __size; - } - while (__size--); - } - return npos; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - typename basic_string<_CharT, _Traits, _Alloc>::size_type - basic_string<_CharT, _Traits, _Alloc>:: - find_last_not_of(_CharT __c, size_type __pos) const - { - size_type __size = this->size(); - if (__size) - { - if (--__size > __pos) - __size = __pos; - do - { - if (!traits_type::eq(_M_data()[__size], __c)) - return __size; - } - while (__size--); - } - return npos; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - int - basic_string<_CharT, _Traits, _Alloc>:: - compare(size_type __pos, size_type __n, const basic_string& __str) const - { - _M_check(__pos, "basic_string::compare"); - __n = _M_limit(__pos, __n); - const size_type __osize = __str.size(); - const size_type __len = std::min(__n, __osize); - int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len); - if (!__r) - __r = __n - __osize; - return __r; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - int - basic_string<_CharT, _Traits, _Alloc>:: - compare(size_type __pos1, size_type __n1, const basic_string& __str, - size_type __pos2, size_type __n2) const - { - _M_check(__pos1, "basic_string::compare"); - __str._M_check(__pos2, "basic_string::compare"); - __n1 = _M_limit(__pos1, __n1); - __n2 = __str._M_limit(__pos2, __n2); - const size_type __len = std::min(__n1, __n2); - int __r = traits_type::compare(_M_data() + __pos1, - __str.data() + __pos2, __len); - if (!__r) - __r = __n1 - __n2; - return __r; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - int - basic_string<_CharT, _Traits, _Alloc>:: - compare(const _CharT* __s) const - { - __glibcxx_requires_string(__s); - const size_type __size = this->size(); - const size_type __osize = traits_type::length(__s); - const size_type __len = std::min(__size, __osize); - int __r = traits_type::compare(_M_data(), __s, __len); - if (!__r) - __r = __size - __osize; - return __r; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - int - basic_string <_CharT, _Traits, _Alloc>:: - compare(size_type __pos, size_type __n1, const _CharT* __s) const - { - __glibcxx_requires_string(__s); - _M_check(__pos, "basic_string::compare"); - __n1 = _M_limit(__pos, __n1); - const size_type __osize = traits_type::length(__s); - const size_type __len = std::min(__n1, __osize); - int __r = traits_type::compare(_M_data() + __pos, __s, __len); - if (!__r) - __r = __n1 - __osize; - return __r; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - int - basic_string <_CharT, _Traits, _Alloc>:: - compare(size_type __pos, size_type __n1, const _CharT* __s, - size_type __n2) const - { - __glibcxx_requires_string_len(__s, __n2); - _M_check(__pos, "basic_string::compare"); - __n1 = _M_limit(__pos, __n1); - const size_type __len = std::min(__n1, __n2); - int __r = traits_type::compare(_M_data() + __pos, __s, __len); - if (!__r) - __r = __n1 - __n2; - return __r; - } - - // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. -#if _GLIBCXX_EXTERN_TEMPLATE - extern template class basic_string<char>; - extern template - basic_istream<char>& - operator>>(basic_istream<char>&, string&); - extern template - basic_ostream<char>& - operator<<(basic_ostream<char>&, const string&); - extern template - basic_istream<char>& - getline(basic_istream<char>&, string&, char); - extern template - basic_istream<char>& - getline(basic_istream<char>&, string&); - -#ifdef _GLIBCXX_USE_WCHAR_T - extern template class basic_string<wchar_t>; - extern template - basic_istream<wchar_t>& - operator>>(basic_istream<wchar_t>&, wstring&); - extern template - basic_ostream<wchar_t>& - operator<<(basic_ostream<wchar_t>&, const wstring&); - extern template - basic_istream<wchar_t>& - getline(basic_istream<wchar_t>&, wstring&, wchar_t); - extern template - basic_istream<wchar_t>& - getline(basic_istream<wchar_t>&, wstring&); -#endif -#endif -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/boost_concept_check.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/boost_concept_check.h deleted file mode 100644 index ff154f73a49..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/boost_concept_check.h +++ /dev/null @@ -1,932 +0,0 @@ -// Copyright (C) 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify, -// sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. -// - -// GCC Note: based on version 1.12.0 of the Boost library. - -/** @file boost_concept_check.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _BOOST_CONCEPT_CHECK_H -#define _BOOST_CONCEPT_CHECK_H 1 - -#pragma GCC system_header - -#include <cstddef> // for ptrdiff_t, used next -#include <bits/stl_iterator_base_types.h> // for traits and tags -#include <utility> // for pair<> - -namespace __gnu_cxx -{ - -#define _IsUnused __attribute__ ((__unused__)) - -// When the C-C code is in use, we would like this function to do as little -// as possible at runtime, use as few resources as possible, and hopefully -// be elided out of existence... hmmm. -template <class _Concept> -inline void __function_requires() -{ - void (_Concept::*__x)() _IsUnused = &_Concept::__constraints; -} - -// No definition: if this is referenced, there's a problem with -// the instantiating type not being one of the required integer types. -// Unfortunately, this results in a link-time error, not a compile-time error. -void __error_type_must_be_an_integer_type(); -void __error_type_must_be_an_unsigned_integer_type(); -void __error_type_must_be_a_signed_integer_type(); - -// ??? Should the "concept_checking*" structs begin with more than _ ? -#define _GLIBCXX_CLASS_REQUIRES(_type_var, _ns, _concept) \ - typedef void (_ns::_concept <_type_var>::* _func##_type_var##_concept)(); \ - template <_func##_type_var##_concept _Tp1> \ - struct _concept_checking##_type_var##_concept { }; \ - typedef _concept_checking##_type_var##_concept< \ - &_ns::_concept <_type_var>::__constraints> \ - _concept_checking_typedef##_type_var##_concept - -#define _GLIBCXX_CLASS_REQUIRES2(_type_var1, _type_var2, _ns, _concept) \ - typedef void (_ns::_concept <_type_var1,_type_var2>::* _func##_type_var1##_type_var2##_concept)(); \ - template <_func##_type_var1##_type_var2##_concept _Tp1> \ - struct _concept_checking##_type_var1##_type_var2##_concept { }; \ - typedef _concept_checking##_type_var1##_type_var2##_concept< \ - &_ns::_concept <_type_var1,_type_var2>::__constraints> \ - _concept_checking_typedef##_type_var1##_type_var2##_concept - -#define _GLIBCXX_CLASS_REQUIRES3(_type_var1, _type_var2, _type_var3, _ns, _concept) \ - typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3>::* _func##_type_var1##_type_var2##_type_var3##_concept)(); \ - template <_func##_type_var1##_type_var2##_type_var3##_concept _Tp1> \ - struct _concept_checking##_type_var1##_type_var2##_type_var3##_concept { }; \ - typedef _concept_checking##_type_var1##_type_var2##_type_var3##_concept< \ - &_ns::_concept <_type_var1,_type_var2,_type_var3>::__constraints> \ - _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_concept - -#define _GLIBCXX_CLASS_REQUIRES4(_type_var1, _type_var2, _type_var3, _type_var4, _ns, _concept) \ - typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::* _func##_type_var1##_type_var2##_type_var3##_type_var4##_concept)(); \ - template <_func##_type_var1##_type_var2##_type_var3##_type_var4##_concept _Tp1> \ - struct _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept { }; \ - typedef _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept< \ - &_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::__constraints> \ - _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_type_var4##_concept - - -template <class _Tp1, class _Tp2> -struct _Aux_require_same { }; - -template <class _Tp> -struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; - - template <class _Tp1, class _Tp2> - struct _SameTypeConcept - { - void __constraints() { - typedef typename _Aux_require_same<_Tp1, _Tp2>::_Type _Required; - } - }; - - template <class _Tp> - struct _IntegerConcept { - void __constraints() { - __error_type_must_be_an_integer_type(); - } - }; - template <> struct _IntegerConcept<short> { void __constraints() {} }; - template <> struct _IntegerConcept<unsigned short> { void __constraints(){} }; - template <> struct _IntegerConcept<int> { void __constraints() {} }; - template <> struct _IntegerConcept<unsigned int> { void __constraints() {} }; - template <> struct _IntegerConcept<long> { void __constraints() {} }; - template <> struct _IntegerConcept<unsigned long> { void __constraints() {} }; - template <> struct _IntegerConcept<long long> { void __constraints() {} }; - template <> struct _IntegerConcept<unsigned long long> - { void __constraints() {} }; - - template <class _Tp> - struct _SignedIntegerConcept { - void __constraints() { - __error_type_must_be_a_signed_integer_type(); - } - }; - template <> struct _SignedIntegerConcept<short> { void __constraints() {} }; - template <> struct _SignedIntegerConcept<int> { void __constraints() {} }; - template <> struct _SignedIntegerConcept<long> { void __constraints() {} }; - template <> struct _SignedIntegerConcept<long long> { void __constraints(){}}; - - template <class _Tp> - struct _UnsignedIntegerConcept { - void __constraints() { - __error_type_must_be_an_unsigned_integer_type(); - } - }; - template <> struct _UnsignedIntegerConcept<unsigned short> - { void __constraints() {} }; - template <> struct _UnsignedIntegerConcept<unsigned int> - { void __constraints() {} }; - template <> struct _UnsignedIntegerConcept<unsigned long> - { void __constraints() {} }; - template <> struct _UnsignedIntegerConcept<unsigned long long> - { void __constraints() {} }; - - //=========================================================================== - // Basic Concepts - - template <class _Tp> - struct _DefaultConstructibleConcept - { - void __constraints() { - _Tp __a _IsUnused; // require default constructor - } - }; - - template <class _Tp> - struct _AssignableConcept - { - void __constraints() { - __a = __a; // require assignment operator - __const_constraints(__a); - } - void __const_constraints(const _Tp& __b) { - __a = __b; // const required for argument to assignment - } - _Tp __a; - // possibly should be "Tp* a;" and then dereference "a" in constraint - // functions? present way would require a default ctor, i think... - }; - - template <class _Tp> - struct _CopyConstructibleConcept - { - void __constraints() { - _Tp __a(__b); // require copy constructor - _Tp* __ptr _IsUnused = &__a; // require address of operator - __const_constraints(__a); - } - void __const_constraints(const _Tp& __a) { - _Tp __c _IsUnused(__a); // require const copy constructor - const _Tp* __ptr _IsUnused = &__a; // require const address of operator - } - _Tp __b; - }; - - // The SGI STL version of Assignable requires copy constructor and operator= - template <class _Tp> - struct _SGIAssignableConcept - { - void __constraints() { - _Tp __b _IsUnused(__a); - __a = __a; // require assignment operator - __const_constraints(__a); - } - void __const_constraints(const _Tp& __b) { - _Tp __c _IsUnused(__b); - __a = __b; // const required for argument to assignment - } - _Tp __a; - }; - - template <class _From, class _To> - struct _ConvertibleConcept - { - void __constraints() { - _To __y _IsUnused = __x; - } - _From __x; - }; - - // The C++ standard requirements for many concepts talk about return - // types that must be "convertible to bool". The problem with this - // requirement is that it leaves the door open for evil proxies that - // define things like operator|| with strange return types. Two - // possible solutions are: - // 1) require the return type to be exactly bool - // 2) stay with convertible to bool, and also - // specify stuff about all the logical operators. - // For now we just test for convertible to bool. - template <class _Tp> - void __aux_require_boolean_expr(const _Tp& __t) { - bool __x _IsUnused = __t; - } - -// FIXME - template <class _Tp> - struct _EqualityComparableConcept - { - void __constraints() { - __aux_require_boolean_expr(__a == __b); - } - _Tp __a, __b; - }; - - template <class _Tp> - struct _LessThanComparableConcept - { - void __constraints() { - __aux_require_boolean_expr(__a < __b); - } - _Tp __a, __b; - }; - - // This is equivalent to SGI STL's LessThanComparable. - template <class _Tp> - struct _ComparableConcept - { - void __constraints() { - __aux_require_boolean_expr(__a < __b); - __aux_require_boolean_expr(__a > __b); - __aux_require_boolean_expr(__a <= __b); - __aux_require_boolean_expr(__a >= __b); - } - _Tp __a, __b; - }; - -#define _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(_OP,_NAME) \ - template <class _First, class _Second> \ - struct _NAME { \ - void __constraints() { (void)__constraints_(); } \ - bool __constraints_() { \ - return __a _OP __b; \ - } \ - _First __a; \ - _Second __b; \ - } - -#define _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(_OP,_NAME) \ - template <class _Ret, class _First, class _Second> \ - struct _NAME { \ - void __constraints() { (void)__constraints_(); } \ - _Ret __constraints_() { \ - return __a _OP __b; \ - } \ - _First __a; \ - _Second __b; \ - } - - _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(==, _EqualOpConcept); - _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(!=, _NotEqualOpConcept); - _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<, _LessThanOpConcept); - _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<=, _LessEqualOpConcept); - _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>, _GreaterThanOpConcept); - _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>=, _GreaterEqualOpConcept); - - _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(+, _PlusOpConcept); - _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(*, _TimesOpConcept); - _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(/, _DivideOpConcept); - _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(-, _SubtractOpConcept); - _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(%, _ModOpConcept); - -#undef _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT -#undef _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT - - //=========================================================================== - // Function Object Concepts - - template <class _Func, class _Return> - struct _GeneratorConcept - { - void __constraints() { - const _Return& __r _IsUnused = __f();// require operator() member function - } - _Func __f; - }; - - - template <class _Func> - struct _GeneratorConcept<_Func,void> - { - void __constraints() { - __f(); // require operator() member function - } - _Func __f; - }; - - template <class _Func, class _Return, class _Arg> - struct _UnaryFunctionConcept - { - void __constraints() { - __r = __f(__arg); // require operator() - } - _Func __f; - _Arg __arg; - _Return __r; - }; - - template <class _Func, class _Arg> - struct _UnaryFunctionConcept<_Func, void, _Arg> { - void __constraints() { - __f(__arg); // require operator() - } - _Func __f; - _Arg __arg; - }; - - template <class _Func, class _Return, class _First, class _Second> - struct _BinaryFunctionConcept - { - void __constraints() { - __r = __f(__first, __second); // require operator() - } - _Func __f; - _First __first; - _Second __second; - _Return __r; - }; - - template <class _Func, class _First, class _Second> - struct _BinaryFunctionConcept<_Func, void, _First, _Second> - { - void __constraints() { - __f(__first, __second); // require operator() - } - _Func __f; - _First __first; - _Second __second; - }; - - template <class _Func, class _Arg> - struct _UnaryPredicateConcept - { - void __constraints() { - __aux_require_boolean_expr(__f(__arg)); // require op() returning bool - } - _Func __f; - _Arg __arg; - }; - - template <class _Func, class _First, class _Second> - struct _BinaryPredicateConcept - { - void __constraints() { - __aux_require_boolean_expr(__f(__a, __b)); // require op() returning bool - } - _Func __f; - _First __a; - _Second __b; - }; - - // use this when functor is used inside a container class like std::set - template <class _Func, class _First, class _Second> - struct _Const_BinaryPredicateConcept { - void __constraints() { - __const_constraints(__f); - } - void __const_constraints(const _Func& __fun) { - __function_requires<_BinaryPredicateConcept<_Func, _First, _Second> >(); - // operator() must be a const member function - __aux_require_boolean_expr(__fun(__a, __b)); - } - _Func __f; - _First __a; - _Second __b; - }; - - //=========================================================================== - // Iterator Concepts - - template <class _Tp> - struct _TrivialIteratorConcept - { - void __constraints() { -// __function_requires< _DefaultConstructibleConcept<_Tp> >(); - __function_requires< _AssignableConcept<_Tp> >(); - __function_requires< _EqualityComparableConcept<_Tp> >(); -// typedef typename std::iterator_traits<_Tp>::value_type _V; - (void)*__i; // require dereference operator - } - _Tp __i; - }; - - template <class _Tp> - struct _Mutable_TrivialIteratorConcept - { - void __constraints() { - __function_requires< _TrivialIteratorConcept<_Tp> >(); - *__i = *__j; // require dereference and assignment - } - _Tp __i, __j; - }; - - template <class _Tp> - struct _InputIteratorConcept - { - void __constraints() { - __function_requires< _TrivialIteratorConcept<_Tp> >(); - // require iterator_traits typedef's - typedef typename std::iterator_traits<_Tp>::difference_type _Diff; -// __function_requires< _SignedIntegerConcept<_Diff> >(); - typedef typename std::iterator_traits<_Tp>::reference _Ref; - typedef typename std::iterator_traits<_Tp>::pointer _Pt; - typedef typename std::iterator_traits<_Tp>::iterator_category _Cat; - __function_requires< _ConvertibleConcept< - typename std::iterator_traits<_Tp>::iterator_category, - std::input_iterator_tag> >(); - ++__i; // require preincrement operator - __i++; // require postincrement operator - } - _Tp __i; - }; - - template <class _Tp, class _ValueT> - struct _OutputIteratorConcept - { - void __constraints() { - __function_requires< _AssignableConcept<_Tp> >(); - ++__i; // require preincrement operator - __i++; // require postincrement operator - *__i++ = __t; // require postincrement and assignment - } - _Tp __i; - _ValueT __t; - }; - - template <class _Tp> - struct _ForwardIteratorConcept - { - void __constraints() { - __function_requires< _InputIteratorConcept<_Tp> >(); - __function_requires< _DefaultConstructibleConcept<_Tp> >(); - __function_requires< _ConvertibleConcept< - typename std::iterator_traits<_Tp>::iterator_category, - std::forward_iterator_tag> >(); - typedef typename std::iterator_traits<_Tp>::reference _Ref; - _Ref __r _IsUnused = *__i; - } - _Tp __i; - }; - - template <class _Tp> - struct _Mutable_ForwardIteratorConcept - { - void __constraints() { - __function_requires< _ForwardIteratorConcept<_Tp> >(); - *__i++ = *__i; // require postincrement and assignment - } - _Tp __i; - }; - - template <class _Tp> - struct _BidirectionalIteratorConcept - { - void __constraints() { - __function_requires< _ForwardIteratorConcept<_Tp> >(); - __function_requires< _ConvertibleConcept< - typename std::iterator_traits<_Tp>::iterator_category, - std::bidirectional_iterator_tag> >(); - --__i; // require predecrement operator - __i--; // require postdecrement operator - } - _Tp __i; - }; - - template <class _Tp> - struct _Mutable_BidirectionalIteratorConcept - { - void __constraints() { - __function_requires< _BidirectionalIteratorConcept<_Tp> >(); - __function_requires< _Mutable_ForwardIteratorConcept<_Tp> >(); - *__i-- = *__i; // require postdecrement and assignment - } - _Tp __i; - }; - - - template <class _Tp> - struct _RandomAccessIteratorConcept - { - void __constraints() { - __function_requires< _BidirectionalIteratorConcept<_Tp> >(); - __function_requires< _ComparableConcept<_Tp> >(); - __function_requires< _ConvertibleConcept< - typename std::iterator_traits<_Tp>::iterator_category, - std::random_access_iterator_tag> >(); - // ??? We don't use _Ref, are we just checking for "referenceability"? - typedef typename std::iterator_traits<_Tp>::reference _Ref; - - __i += __n; // require assignment addition operator - __i = __i + __n; __i = __n + __i; // require addition with difference type - __i -= __n; // require assignment subtraction op - __i = __i - __n; // require subtraction with - // difference type - __n = __i - __j; // require difference operator - (void)__i[__n]; // require element access operator - } - _Tp __a, __b; - _Tp __i, __j; - typename std::iterator_traits<_Tp>::difference_type __n; - }; - - template <class _Tp> - struct _Mutable_RandomAccessIteratorConcept - { - void __constraints() { - __function_requires< _RandomAccessIteratorConcept<_Tp> >(); - __function_requires< _Mutable_BidirectionalIteratorConcept<_Tp> >(); - __i[__n] = *__i; // require element access and assignment - } - _Tp __i; - typename std::iterator_traits<_Tp>::difference_type __n; - }; - - //=========================================================================== - // Container Concepts - - template <class _Container> - struct _ContainerConcept - { - typedef typename _Container::value_type _Value_type; - typedef typename _Container::difference_type _Difference_type; - typedef typename _Container::size_type _Size_type; - typedef typename _Container::const_reference _Const_reference; - typedef typename _Container::const_pointer _Const_pointer; - typedef typename _Container::const_iterator _Const_iterator; - - void __constraints() { - __function_requires< _InputIteratorConcept<_Const_iterator> >(); - __function_requires< _AssignableConcept<_Container> >(); - const _Container __c; - __i = __c.begin(); - __i = __c.end(); - __n = __c.size(); - __n = __c.max_size(); - __b = __c.empty(); - } - bool __b; - _Const_iterator __i; - _Size_type __n; - }; - - template <class _Container> - struct _Mutable_ContainerConcept - { - typedef typename _Container::value_type _Value_type; - typedef typename _Container::reference _Reference; - typedef typename _Container::iterator _Iterator; - typedef typename _Container::pointer _Pointer; - - void __constraints() { - __function_requires< _ContainerConcept<_Container> >(); - __function_requires< _AssignableConcept<_Value_type> >(); - __function_requires< _InputIteratorConcept<_Iterator> >(); - - __i = __c.begin(); - __i = __c.end(); - __c.swap(__c2); - } - _Iterator __i; - _Container __c, __c2; - }; - - template <class _ForwardContainer> - struct _ForwardContainerConcept - { - void __constraints() { - __function_requires< _ContainerConcept<_ForwardContainer> >(); - typedef typename _ForwardContainer::const_iterator _Const_iterator; - __function_requires< _ForwardIteratorConcept<_Const_iterator> >(); - } - }; - - template <class _ForwardContainer> - struct _Mutable_ForwardContainerConcept - { - void __constraints() { - __function_requires< _ForwardContainerConcept<_ForwardContainer> >(); - __function_requires< _Mutable_ContainerConcept<_ForwardContainer> >(); - typedef typename _ForwardContainer::iterator _Iterator; - __function_requires< _Mutable_ForwardIteratorConcept<_Iterator> >(); - } - }; - - template <class _ReversibleContainer> - struct _ReversibleContainerConcept - { - typedef typename _ReversibleContainer::const_iterator _Const_iterator; - typedef typename _ReversibleContainer::const_reverse_iterator - _Const_reverse_iterator; - - void __constraints() { - __function_requires< _ForwardContainerConcept<_ReversibleContainer> >(); - __function_requires< _BidirectionalIteratorConcept<_Const_iterator> >(); - __function_requires< - _BidirectionalIteratorConcept<_Const_reverse_iterator> >(); - - const _ReversibleContainer __c; - _Const_reverse_iterator __i = __c.rbegin(); - __i = __c.rend(); - } - }; - - template <class _ReversibleContainer> - struct _Mutable_ReversibleContainerConcept - { - typedef typename _ReversibleContainer::iterator _Iterator; - typedef typename _ReversibleContainer::reverse_iterator _Reverse_iterator; - - void __constraints() { - __function_requires<_ReversibleContainerConcept<_ReversibleContainer> >(); - __function_requires< - _Mutable_ForwardContainerConcept<_ReversibleContainer> >(); - __function_requires<_Mutable_BidirectionalIteratorConcept<_Iterator> >(); - __function_requires< - _Mutable_BidirectionalIteratorConcept<_Reverse_iterator> >(); - - _Reverse_iterator __i = __c.rbegin(); - __i = __c.rend(); - } - _ReversibleContainer __c; - }; - - template <class _RandomAccessContainer> - struct _RandomAccessContainerConcept - { - typedef typename _RandomAccessContainer::size_type _Size_type; - typedef typename _RandomAccessContainer::const_reference _Const_reference; - typedef typename _RandomAccessContainer::const_iterator _Const_iterator; - typedef typename _RandomAccessContainer::const_reverse_iterator - _Const_reverse_iterator; - - void __constraints() { - __function_requires< - _ReversibleContainerConcept<_RandomAccessContainer> >(); - __function_requires< _RandomAccessIteratorConcept<_Const_iterator> >(); - __function_requires< - _RandomAccessIteratorConcept<_Const_reverse_iterator> >(); - - const _RandomAccessContainer __c; - _Const_reference __r _IsUnused = __c[__n]; - } - _Size_type __n; - }; - - template <class _RandomAccessContainer> - struct _Mutable_RandomAccessContainerConcept - { - typedef typename _RandomAccessContainer::size_type _Size_type; - typedef typename _RandomAccessContainer::reference _Reference; - typedef typename _RandomAccessContainer::iterator _Iterator; - typedef typename _RandomAccessContainer::reverse_iterator _Reverse_iterator; - - void __constraints() { - __function_requires< - _RandomAccessContainerConcept<_RandomAccessContainer> >(); - __function_requires< - _Mutable_ReversibleContainerConcept<_RandomAccessContainer> >(); - __function_requires< _Mutable_RandomAccessIteratorConcept<_Iterator> >(); - __function_requires< - _Mutable_RandomAccessIteratorConcept<_Reverse_iterator> >(); - - _Reference __r _IsUnused = __c[__i]; - } - _Size_type __i; - _RandomAccessContainer __c; - }; - - // A Sequence is inherently mutable - template <class _Sequence> - struct _SequenceConcept - { - typedef typename _Sequence::reference _Reference; - typedef typename _Sequence::const_reference _Const_reference; - - void __constraints() { - // Matt Austern's book puts DefaultConstructible here, the C++ - // standard places it in Container - // function_requires< DefaultConstructible<Sequence> >(); - __function_requires< _Mutable_ForwardContainerConcept<_Sequence> >(); - __function_requires< _DefaultConstructibleConcept<_Sequence> >(); - - _Sequence - __c _IsUnused(__n, __t), - __c2 _IsUnused(__first, __last); - - __c.insert(__p, __t); - __c.insert(__p, __n, __t); - __c.insert(__p, __first, __last); - - __c.erase(__p); - __c.erase(__p, __q); - - _Reference __r _IsUnused = __c.front(); - - __const_constraints(__c); - } - void __const_constraints(const _Sequence& __c) { - _Const_reference __r _IsUnused = __c.front(); - } - typename _Sequence::value_type __t; - typename _Sequence::size_type __n; - typename _Sequence::value_type *__first, *__last; - typename _Sequence::iterator __p, __q; - }; - - template <class _FrontInsertionSequence> - struct _FrontInsertionSequenceConcept - { - void __constraints() { - __function_requires< _SequenceConcept<_FrontInsertionSequence> >(); - - __c.push_front(__t); - __c.pop_front(); - } - _FrontInsertionSequence __c; - typename _FrontInsertionSequence::value_type __t; - }; - - template <class _BackInsertionSequence> - struct _BackInsertionSequenceConcept - { - typedef typename _BackInsertionSequence::reference _Reference; - typedef typename _BackInsertionSequence::const_reference _Const_reference; - - void __constraints() { - __function_requires< _SequenceConcept<_BackInsertionSequence> >(); - - __c.push_back(__t); - __c.pop_back(); - _Reference __r _IsUnused = __c.back(); - } - void __const_constraints(const _BackInsertionSequence& __c) { - _Const_reference __r _IsUnused = __c.back(); - }; - _BackInsertionSequence __c; - typename _BackInsertionSequence::value_type __t; - }; - - template <class _AssociativeContainer> - struct _AssociativeContainerConcept - { - void __constraints() { - __function_requires< _ForwardContainerConcept<_AssociativeContainer> >(); - __function_requires< - _DefaultConstructibleConcept<_AssociativeContainer> >(); - - __i = __c.find(__k); - __r = __c.equal_range(__k); - __c.erase(__k); - __c.erase(__i); - __c.erase(__r.first, __r.second); - __const_constraints(__c); - } - void __const_constraints(const _AssociativeContainer& __c) { - __ci = __c.find(__k); - __n = __c.count(__k); - __cr = __c.equal_range(__k); - } - typedef typename _AssociativeContainer::iterator _Iterator; - typedef typename _AssociativeContainer::const_iterator _Const_iterator; - - _AssociativeContainer __c; - _Iterator __i; - std::pair<_Iterator,_Iterator> __r; - _Const_iterator __ci; - std::pair<_Const_iterator,_Const_iterator> __cr; - typename _AssociativeContainer::key_type __k; - typename _AssociativeContainer::size_type __n; - }; - - template <class _UniqueAssociativeContainer> - struct _UniqueAssociativeContainerConcept - { - void __constraints() { - __function_requires< - _AssociativeContainerConcept<_UniqueAssociativeContainer> >(); - - _UniqueAssociativeContainer __c(__first, __last); - - __pos_flag = __c.insert(__t); - __c.insert(__first, __last); - } - std::pair<typename _UniqueAssociativeContainer::iterator, bool> __pos_flag; - typename _UniqueAssociativeContainer::value_type __t; - typename _UniqueAssociativeContainer::value_type *__first, *__last; - }; - - template <class _MultipleAssociativeContainer> - struct _MultipleAssociativeContainerConcept - { - void __constraints() { - __function_requires< - _AssociativeContainerConcept<_MultipleAssociativeContainer> >(); - - _MultipleAssociativeContainer __c(__first, __last); - - __pos = __c.insert(__t); - __c.insert(__first, __last); - - } - typename _MultipleAssociativeContainer::iterator __pos; - typename _MultipleAssociativeContainer::value_type __t; - typename _MultipleAssociativeContainer::value_type *__first, *__last; - }; - - template <class _SimpleAssociativeContainer> - struct _SimpleAssociativeContainerConcept - { - void __constraints() { - __function_requires< - _AssociativeContainerConcept<_SimpleAssociativeContainer> >(); - typedef typename _SimpleAssociativeContainer::key_type _Key_type; - typedef typename _SimpleAssociativeContainer::value_type _Value_type; - typedef typename _Aux_require_same<_Key_type, _Value_type>::_Type - _Required; - } - }; - - template <class _SimpleAssociativeContainer> - struct _PairAssociativeContainerConcept - { - void __constraints() { - __function_requires< - _AssociativeContainerConcept<_SimpleAssociativeContainer> >(); - typedef typename _SimpleAssociativeContainer::key_type _Key_type; - typedef typename _SimpleAssociativeContainer::value_type _Value_type; - typedef typename _SimpleAssociativeContainer::mapped_type _Mapped_type; - typedef std::pair<const _Key_type, _Mapped_type> _Required_value_type; - typedef typename _Aux_require_same<_Value_type, - _Required_value_type>::_Type _Required; - } - }; - - template <class _SortedAssociativeContainer> - struct _SortedAssociativeContainerConcept - { - void __constraints() { - __function_requires< - _AssociativeContainerConcept<_SortedAssociativeContainer> >(); - __function_requires< - _ReversibleContainerConcept<_SortedAssociativeContainer> >(); - - _SortedAssociativeContainer - __c _IsUnused(__kc), - __c2 _IsUnused(__first, __last), - __c3 _IsUnused(__first, __last, __kc); - - __p = __c.upper_bound(__k); - __p = __c.lower_bound(__k); - __r = __c.equal_range(__k); - - __c.insert(__p, __t); - } - void __const_constraints(const _SortedAssociativeContainer& __c) { - __kc = __c.key_comp(); - __vc = __c.value_comp(); - - __cp = __c.upper_bound(__k); - __cp = __c.lower_bound(__k); - __cr = __c.equal_range(__k); - } - typename _SortedAssociativeContainer::key_compare __kc; - typename _SortedAssociativeContainer::value_compare __vc; - typename _SortedAssociativeContainer::value_type __t; - typename _SortedAssociativeContainer::key_type __k; - typedef typename _SortedAssociativeContainer::iterator _Iterator; - typedef typename _SortedAssociativeContainer::const_iterator - _Const_iterator; - - _Iterator __p; - _Const_iterator __cp; - std::pair<_Iterator,_Iterator> __r; - std::pair<_Const_iterator,_Const_iterator> __cr; - typename _SortedAssociativeContainer::value_type *__first, *__last; - }; - - // HashedAssociativeContainer - -} // namespace __gnu_cxx - -#undef _IsUnused - -#endif // _GLIBCXX_BOOST_CONCEPT_CHECK - - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/char_traits.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/char_traits.h deleted file mode 100644 index f1f288f051b..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/char_traits.h +++ /dev/null @@ -1,376 +0,0 @@ -// Character Traits for use by standard string and iostream -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 21 Strings library -// - -/** @file char_traits.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CHAR_TRAITS_H -#define _CHAR_TRAITS_H 1 - -#pragma GCC system_header - -#include <cstring> // For memmove, memset, memchr -#include <bits/stl_algobase.h>// For copy, lexicographical_compare, fill_n -#include <bits/postypes.h> // For streampos - -namespace __gnu_cxx -{ - /** - * @brief Mapping from character type to associated types. - * - * - * @note This is an implementation class for the generic version - * of char_traits. It defines int_type, off_type, pos_type, and - * state_type. By default these are unsigned long, streamoff, - * streampos, and mbstate_t. Users who need a different set of - * types, but who don't need to change the definitions of any function - * defined in char_traits, can specialize __gnu_cxx::_Char_types - * while leaving __gnu_cxx::char_traits alone. */ - template <class _CharT> - struct _Char_types - { - typedef unsigned long int_type; - typedef std::streampos pos_type; - typedef std::streamoff off_type; - typedef std::mbstate_t state_type; - }; - - - /** - * @brief Base class used to implement std::char_traits. - * - * @note For any given actual character type, this definition is - * probably wrong. (Most of the member functions are likely to be - * right, but the int_type and state_type typedefs, and the eof() - * member function, are likely to be wrong.) The reason this class - * exists is so users can specialize it. Classes in namespace std - * may not be specialized for fundamentl types, but classes in - * namespace __gnu_cxx may be. - * - * See http://gcc.gnu.org/onlinedocs/libstdc++/21_strings/howto.html#5 - * for advice on how to make use of this class for "unusual" character - * types. Also, check out include/ext/pod_char_traits.h. */ - template<typename _CharT> - struct char_traits - { - typedef _CharT char_type; - typedef typename _Char_types<_CharT>::int_type int_type; - typedef typename _Char_types<_CharT>::pos_type pos_type; - typedef typename _Char_types<_CharT>::off_type off_type; - typedef typename _Char_types<_CharT>::state_type state_type; - - static void - assign(char_type& __c1, const char_type& __c2) - { __c1 = __c2; } - - static bool - eq(const char_type& __c1, const char_type& __c2) - { return __c1 == __c2; } - - static bool - lt(const char_type& __c1, const char_type& __c2) - { return __c1 < __c2; } - - static int - compare(const char_type* __s1, const char_type* __s2, std::size_t __n); - - static std::size_t - length(const char_type* __s); - - static const char_type* - find(const char_type* __s, std::size_t __n, const char_type& __a); - - static char_type* - move(char_type* __s1, const char_type* __s2, std::size_t __n); - - static char_type* - copy(char_type* __s1, const char_type* __s2, std::size_t __n); - - static char_type* - assign(char_type* __s, std::size_t __n, char_type __a); - - static char_type - to_char_type(const int_type& __c) - { return static_cast<char_type>(__c); } - - static int_type - to_int_type(const char_type& __c) - { return static_cast<int_type>(__c); } - - static bool - eq_int_type(const int_type& __c1, const int_type& __c2) - { return __c1 == __c2; } - - static int_type - eof() - { return static_cast<int_type>(EOF); } - - static int_type - not_eof(const int_type& __c) - { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); } - }; - - template<typename _CharT> - int - char_traits<_CharT>:: - compare(const char_type* __s1, const char_type* __s2, std::size_t __n) - { - for (size_t __i = 0; __i < __n; ++__i) - if (lt(__s1[__i], __s2[__i])) - return -1; - else if (lt(__s2[__i], __s1[__i])) - return 1; - return 0; - } - - template<typename _CharT> - std::size_t - char_traits<_CharT>:: - length(const char_type* __p) - { - std::size_t __i = 0; - while (!eq(__p[__i], char_type())) - ++__i; - return __i; - } - - template<typename _CharT> - const typename char_traits<_CharT>::char_type* - char_traits<_CharT>:: - find(const char_type* __s, std::size_t __n, const char_type& __a) - { - for (std::size_t __i = 0; __i < __n; ++__i) - if (eq(__s[__i], __a)) - return __s + __i; - return 0; - } - - template<typename _CharT> - typename char_traits<_CharT>::char_type* - char_traits<_CharT>:: - move(char_type* __s1, const char_type* __s2, std::size_t __n) - { - return static_cast<_CharT*>(std::memmove(__s1, __s2, - __n * sizeof(char_type))); - } - - template<typename _CharT> - typename char_traits<_CharT>::char_type* - char_traits<_CharT>:: - copy(char_type* __s1, const char_type* __s2, std::size_t __n) - { - std::copy(__s2, __s2 + __n, __s1); - return __s1; - } - - template<typename _CharT> - typename char_traits<_CharT>::char_type* - char_traits<_CharT>:: - assign(char_type* __s, std::size_t __n, char_type __a) - { - std::fill_n(__s, __n, __a); - return __s; - } -} - -namespace std -{ - // 21.1 - /** - * @brief Basis for explicit traits specializations. - * - * @note For any given actual character type, this definition is - * probably wrong. Since this is just a thin wrapper around - * __gnu_cxx::char_traits, it is possible to achieve a more - * appropriate definition by specializing __gnu_cxx::char_traits. - * - * See http://gcc.gnu.org/onlinedocs/libstdc++/21_strings/howto.html#5 - * for advice on how to make use of this class for "unusual" character - * types. Also, check out include/ext/pod_char_traits.h. - */ - template<class _CharT> - struct char_traits - : public __gnu_cxx::char_traits<_CharT> - { }; - - - /// 21.1.3.1 char_traits specializations - template<> - struct char_traits<char> - { - typedef char char_type; - typedef int int_type; - typedef streampos pos_type; - typedef streamoff off_type; - typedef mbstate_t state_type; - - static void - assign(char_type& __c1, const char_type& __c2) - { __c1 = __c2; } - - static bool - eq(const char_type& __c1, const char_type& __c2) - { return __c1 == __c2; } - - static bool - lt(const char_type& __c1, const char_type& __c2) - { return __c1 < __c2; } - - static int - compare(const char_type* __s1, const char_type* __s2, size_t __n) - { return memcmp(__s1, __s2, __n); } - - static size_t - length(const char_type* __s) - { return strlen(__s); } - - static const char_type* - find(const char_type* __s, size_t __n, const char_type& __a) - { return static_cast<const char_type*>(memchr(__s, __a, __n)); } - - static char_type* - move(char_type* __s1, const char_type* __s2, size_t __n) - { return static_cast<char_type*>(memmove(__s1, __s2, __n)); } - - static char_type* - copy(char_type* __s1, const char_type* __s2, size_t __n) - { return static_cast<char_type*>(memcpy(__s1, __s2, __n)); } - - static char_type* - assign(char_type* __s, size_t __n, char_type __a) - { return static_cast<char_type*>(memset(__s, __a, __n)); } - - static char_type - to_char_type(const int_type& __c) - { return static_cast<char_type>(__c); } - - // To keep both the byte 0xff and the eof symbol 0xffffffff - // from ending up as 0xffffffff. - static int_type - to_int_type(const char_type& __c) - { return static_cast<int_type>(static_cast<unsigned char>(__c)); } - - static bool - eq_int_type(const int_type& __c1, const int_type& __c2) - { return __c1 == __c2; } - - static int_type - eof() { return static_cast<int_type>(EOF); } - - static int_type - not_eof(const int_type& __c) - { return (__c == eof()) ? 0 : __c; } - }; - - -#if defined (_GLIBCXX_USE_WCHAR_T) || defined (_GLIBCXX_USE_WSTRING) - /// 21.1.3.2 char_traits specializations - template<> - struct char_traits<wchar_t> - { - typedef wchar_t char_type; - typedef wint_t int_type; - typedef streamoff off_type; - typedef wstreampos pos_type; - typedef mbstate_t state_type; - - static void - assign(char_type& __c1, const char_type& __c2) - { __c1 = __c2; } - - static bool - eq(const char_type& __c1, const char_type& __c2) - { return __c1 == __c2; } - - static bool - lt(const char_type& __c1, const char_type& __c2) - { return __c1 < __c2; } - - static int - compare(const char_type* __s1, const char_type* __s2, size_t __n) - { return wmemcmp(__s1, __s2, __n); } - - static size_t - length(const char_type* __s) - { return wcslen(__s); } - - static const char_type* - find(const char_type* __s, size_t __n, const char_type& __a) - { return wmemchr(__s, __a, __n); } - - static char_type* - move(char_type* __s1, const char_type* __s2, size_t __n) - { return wmemmove(__s1, __s2, __n); } - - static char_type* - copy(char_type* __s1, const char_type* __s2, size_t __n) - { return wmemcpy(__s1, __s2, __n); } - - static char_type* - assign(char_type* __s, size_t __n, char_type __a) - { return wmemset(__s, __a, __n); } - - static char_type - to_char_type(const int_type& __c) { return char_type(__c); } - - static int_type - to_int_type(const char_type& __c) { return int_type(__c); } - - static bool - eq_int_type(const int_type& __c1, const int_type& __c2) - { return __c1 == __c2; } - - static int_type - eof() { return static_cast<int_type>(WEOF); } - - static int_type - not_eof(const int_type& __c) - { return eq_int_type(__c, eof()) ? 0 : __c; } - }; -#endif //_GLIBCXX_USE_WCHAR_T - - template<typename _CharT, typename _Traits> - struct _Char_traits_match - { - _CharT _M_c; - _Char_traits_match(_CharT const& __c) : _M_c(__c) { } - - bool - operator()(_CharT const& __a) { return _Traits::eq(_M_c, __a); } - }; -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cmath.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cmath.tcc deleted file mode 100644 index d771467ec61..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cmath.tcc +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- C math library. - -// Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// This file was written by Gabriel Dos Reis <gdr@codesourcery.com> - -#ifndef _GLIBCXX_CMATH_TCC -#define _GLIBCXX_CMATH_TCC 1 - -namespace std -{ - template<typename _Tp> - inline _Tp - __cmath_power(_Tp __x, unsigned int __n) - { - _Tp __y = __n % 2 ? __x : 1; - - while (__n >>= 1) - { - __x = __x * __x; - if (__n % 2) - __y = __y * __x; - } - - return __y; - } -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/codecvt.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/codecvt.h deleted file mode 100644 index d31ebf2d362..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/codecvt.h +++ /dev/null @@ -1,478 +0,0 @@ -// Locale support (codecvt) -*- C++ -*- - -// Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.2.1.5 Template class codecvt -// - -// Written by Benjamin Kosnik <bkoz@cygnus.com> - -/** @file codecvt.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CODECVT_H -#define _CODECVT_H 1 - -#pragma GCC system_header - - // 22.2.1.5 Template class codecvt - /// Base class for codecvt facet providing conversion result enum. - class codecvt_base - { - public: - enum result - { - ok, - partial, - error, - noconv - }; - }; - - // Template class __codecvt_abstract_base - // NB: An abstract base class that fills in the public inlines, so - // that the specializations don't have to re-copy the public - // interface. - /** - * @brief Common base for codecvt facet - * - * This template class provides implementations of the public functions - * that forward to the protected virtual functions. - * - * This template also provides abstract stubs for the protected virtual - * functions. - */ - template<typename _InternT, typename _ExternT, typename _StateT> - class __codecvt_abstract_base - : public locale::facet, public codecvt_base - { - public: - // Types: - typedef codecvt_base::result result; - typedef _InternT intern_type; - typedef _ExternT extern_type; - typedef _StateT state_type; - - // 22.2.1.5.1 codecvt members - /** - * @brief Convert from internal to external character set. - * - * Converts input string of intern_type to output string of - * extern_type. This is analogous to wcsrtombs. It does this by - * calling codecvt::do_out. - * - * The source and destination character sets are determined by the - * facet's locale, internal and external types. - * - * The characters in [from,from_end) are converted and written to - * [to,to_end). from_next and to_next are set to point to the - * character following the last successfully converted character, - * respectively. If the result needed no conversion, from_next and - * to_next are not affected. - * - * The @a state argument should be intialized if the input is at the - * beginning and carried from a previous call if continuing - * conversion. There are no guarantees about how @a state is used. - * - * The result returned is a member of codecvt_base::result. If all the - * input is converted, returns codecvt_base::ok. If no conversion is - * necessary, returns codecvt_base::noconv. If the input ends early or - * there is insufficient space in the output, returns codecvt_base::partial. - * Otherwise the conversion failed and codecvt_base::error is returned. - * - * @param state Persistent conversion state data. - * @param from Start of input. - * @param from_end End of input. - * @param from_next Returns start of unconverted data. - * @param to Start of output buffer. - * @param to_end End of output buffer. - * @param to_next Returns start of unused output area. - * @return codecvt_base::result. - */ - result - out(state_type& __state, const intern_type* __from, - const intern_type* __from_end, const intern_type*& __from_next, - extern_type* __to, extern_type* __to_end, - extern_type*& __to_next) const - { - return this->do_out(__state, __from, __from_end, __from_next, - __to, __to_end, __to_next); - } - - /** - * @brief Reset conversion state. - * - * Writes characters to output that would restore @a state to initial - * conditions. The idea is that if a partial conversion occurs, then - * the converting the characters written by this function would leave - * the state in initial conditions, rather than partial conversion - * state. It does this by calling codecvt::do_unshift(). - * - * For example, if 4 external characters always converted to 1 internal - * character, and input to in() had 6 external characters with state - * saved, this function would write two characters to the output and - * set the state to initialized conditions. - * - * The source and destination character sets are determined by the - * facet's locale, internal and external types. - * - * The result returned is a member of codecvt_base::result. If the - * state could be reset and data written, returns codecvt_base::ok. If - * no conversion is necessary, returns codecvt_base::noconv. If the - * output has insufficient space, returns codecvt_base::partial. - * Otherwise the reset failed and codecvt_base::error is returned. - * - * @param state Persistent conversion state data. - * @param to Start of output buffer. - * @param to_end End of output buffer. - * @param to_next Returns start of unused output area. - * @return codecvt_base::result. - */ - result - unshift(state_type& __state, extern_type* __to, extern_type* __to_end, - extern_type*& __to_next) const - { return this->do_unshift(__state, __to,__to_end,__to_next); } - - /** - * @brief Convert from external to internal character set. - * - * Converts input string of extern_type to output string of - * intern_type. This is analogous to mbsrtowcs. It does this by - * calling codecvt::do_in. - * - * The source and destination character sets are determined by the - * facet's locale, internal and external types. - * - * The characters in [from,from_end) are converted and written to - * [to,to_end). from_next and to_next are set to point to the - * character following the last successfully converted character, - * respectively. If the result needed no conversion, from_next and - * to_next are not affected. - * - * The @a state argument should be intialized if the input is at the - * beginning and carried from a previous call if continuing - * conversion. There are no guarantees about how @a state is used. - * - * The result returned is a member of codecvt_base::result. If all the - * input is converted, returns codecvt_base::ok. If no conversion is - * necessary, returns codecvt_base::noconv. If the input ends early or - * there is insufficient space in the output, returns codecvt_base::partial. - * Otherwise the conversion failed and codecvt_base::error is returned. - * - * @param state Persistent conversion state data. - * @param from Start of input. - * @param from_end End of input. - * @param from_next Returns start of unconverted data. - * @param to Start of output buffer. - * @param to_end End of output buffer. - * @param to_next Returns start of unused output area. - * @return codecvt_base::result. - */ - result - in(state_type& __state, const extern_type* __from, - const extern_type* __from_end, const extern_type*& __from_next, - intern_type* __to, intern_type* __to_end, - intern_type*& __to_next) const - { - return this->do_in(__state, __from, __from_end, __from_next, - __to, __to_end, __to_next); - } - - int - encoding() const throw() - { return this->do_encoding(); } - - bool - always_noconv() const throw() - { return this->do_always_noconv(); } - - int - length(state_type& __state, const extern_type* __from, - const extern_type* __end, size_t __max) const - { return this->do_length(__state, __from, __end, __max); } - - int - max_length() const throw() - { return this->do_max_length(); } - - protected: - explicit - __codecvt_abstract_base(size_t __refs = 0) : locale::facet(__refs) { } - - virtual - ~__codecvt_abstract_base() { } - - /** - * @brief Convert from internal to external character set. - * - * Converts input string of intern_type to output string of - * extern_type. This function is a hook for derived classes to change - * the value returned. @see out for more information. - */ - virtual result - do_out(state_type& __state, const intern_type* __from, - const intern_type* __from_end, const intern_type*& __from_next, - extern_type* __to, extern_type* __to_end, - extern_type*& __to_next) const = 0; - - virtual result - do_unshift(state_type& __state, extern_type* __to, - extern_type* __to_end, extern_type*& __to_next) const = 0; - - virtual result - do_in(state_type& __state, const extern_type* __from, - const extern_type* __from_end, const extern_type*& __from_next, - intern_type* __to, intern_type* __to_end, - intern_type*& __to_next) const = 0; - - virtual int - do_encoding() const throw() = 0; - - virtual bool - do_always_noconv() const throw() = 0; - - virtual int - do_length(state_type&, const extern_type* __from, - const extern_type* __end, size_t __max) const = 0; - - virtual int - do_max_length() const throw() = 0; - }; - - // 22.2.1.5 Template class codecvt - // NB: Generic, mostly useless implementation. - template<typename _InternT, typename _ExternT, typename _StateT> - class codecvt - : public __codecvt_abstract_base<_InternT, _ExternT, _StateT> - { - public: - // Types: - typedef codecvt_base::result result; - typedef _InternT intern_type; - typedef _ExternT extern_type; - typedef _StateT state_type; - - protected: - __c_locale _M_c_locale_codecvt; - - public: - static locale::id id; - - explicit - codecvt(size_t __refs = 0) - : __codecvt_abstract_base<_InternT, _ExternT, _StateT> (__refs) { } - - explicit - codecvt(__c_locale __cloc, size_t __refs = 0); - - protected: - virtual - ~codecvt() { } - - virtual result - do_out(state_type& __state, const intern_type* __from, - const intern_type* __from_end, const intern_type*& __from_next, - extern_type* __to, extern_type* __to_end, - extern_type*& __to_next) const; - - virtual result - do_unshift(state_type& __state, extern_type* __to, - extern_type* __to_end, extern_type*& __to_next) const; - - virtual result - do_in(state_type& __state, const extern_type* __from, - const extern_type* __from_end, const extern_type*& __from_next, - intern_type* __to, intern_type* __to_end, - intern_type*& __to_next) const; - - virtual int - do_encoding() const throw(); - - virtual bool - do_always_noconv() const throw(); - - virtual int - do_length(state_type&, const extern_type* __from, - const extern_type* __end, size_t __max) const; - - virtual int - do_max_length() const throw(); - }; - - template<typename _InternT, typename _ExternT, typename _StateT> - locale::id codecvt<_InternT, _ExternT, _StateT>::id; - - // codecvt<char, char, mbstate_t> required specialization - template<> - class codecvt<char, char, mbstate_t> - : public __codecvt_abstract_base<char, char, mbstate_t> - { - public: - // Types: - typedef char intern_type; - typedef char extern_type; - typedef mbstate_t state_type; - - protected: - __c_locale _M_c_locale_codecvt; - - public: - static locale::id id; - - explicit - codecvt(size_t __refs = 0); - - explicit - codecvt(__c_locale __cloc, size_t __refs = 0); - - protected: - virtual - ~codecvt(); - - virtual result - do_out(state_type& __state, const intern_type* __from, - const intern_type* __from_end, const intern_type*& __from_next, - extern_type* __to, extern_type* __to_end, - extern_type*& __to_next) const; - - virtual result - do_unshift(state_type& __state, extern_type* __to, - extern_type* __to_end, extern_type*& __to_next) const; - - virtual result - do_in(state_type& __state, const extern_type* __from, - const extern_type* __from_end, const extern_type*& __from_next, - intern_type* __to, intern_type* __to_end, - intern_type*& __to_next) const; - - virtual int - do_encoding() const throw(); - - virtual bool - do_always_noconv() const throw(); - - virtual int - do_length(state_type&, const extern_type* __from, - const extern_type* __end, size_t __max) const; - - virtual int - do_max_length() const throw(); - }; - -#ifdef _GLIBCXX_USE_WCHAR_T - // codecvt<wchar_t, char, mbstate_t> required specialization - template<> - class codecvt<wchar_t, char, mbstate_t> - : public __codecvt_abstract_base<wchar_t, char, mbstate_t> - { - public: - // Types: - typedef wchar_t intern_type; - typedef char extern_type; - typedef mbstate_t state_type; - - protected: - __c_locale _M_c_locale_codecvt; - - public: - static locale::id id; - - explicit - codecvt(size_t __refs = 0); - - explicit - codecvt(__c_locale __cloc, size_t __refs = 0); - - protected: - virtual - ~codecvt(); - - virtual result - do_out(state_type& __state, const intern_type* __from, - const intern_type* __from_end, const intern_type*& __from_next, - extern_type* __to, extern_type* __to_end, - extern_type*& __to_next) const; - - virtual result - do_unshift(state_type& __state, - extern_type* __to, extern_type* __to_end, - extern_type*& __to_next) const; - - virtual result - do_in(state_type& __state, - const extern_type* __from, const extern_type* __from_end, - const extern_type*& __from_next, - intern_type* __to, intern_type* __to_end, - intern_type*& __to_next) const; - - virtual - int do_encoding() const throw(); - - virtual - bool do_always_noconv() const throw(); - - virtual - int do_length(state_type&, const extern_type* __from, - const extern_type* __end, size_t __max) const; - - virtual int - do_max_length() const throw(); - }; -#endif //_GLIBCXX_USE_WCHAR_T - - // 22.2.1.6 Template class codecvt_byname - template<typename _InternT, typename _ExternT, typename _StateT> - class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT> - { - public: - explicit - codecvt_byname(const char* __s, size_t __refs = 0) - : codecvt<_InternT, _ExternT, _StateT>(__refs) - { - if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) - { - this->_S_destroy_c_locale(this->_M_c_locale_codecvt); - this->_S_create_c_locale(this->_M_c_locale_codecvt, __s); - } - } - - protected: - virtual - ~codecvt_byname() { } - }; - - // Include host and configuration specific partial specializations - // with additional functionality, if possible. -#ifdef _GLIBCXX_USE_WCHAR_T - #include <bits/codecvt_specializations.h> -#endif - -#endif // _CODECVT_H diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/concept_check.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/concept_check.h deleted file mode 100644 index 80c1439342d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/concept_check.h +++ /dev/null @@ -1,85 +0,0 @@ -// Concept-checking control -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file concept_check.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CONCEPT_CHECK_H -#define _CONCEPT_CHECK_H 1 - -#pragma GCC system_header - -#include <bits/c++config.h> - -// All places in libstdc++-v3 where these are used, or /might/ be used, or -// don't need to be used, or perhaps /should/ be used, are commented with -// "concept requirements" (and maybe some more text). So grep like crazy -// if you're looking for additional places to use these. - -// Concept-checking code is off by default unless users turn it on via -// configure options or editing c++config.h. - -#ifndef _GLIBCXX_CONCEPT_CHECKS - -#define __glibcxx_function_requires(...) -#define __glibcxx_class_requires(_a,_b) -#define __glibcxx_class_requires2(_a,_b,_c) -#define __glibcxx_class_requires3(_a,_b,_c,_d) -#define __glibcxx_class_requires4(_a,_b,_c,_d,_e) - -#else // the checks are on - -#include <bits/boost_concept_check.h> - -// Note that the obvious and elegant approach of -// -//#define glibcxx_function_requires(C) boost::function_requires< boost::C >() -// -// won't work due to concept templates with more than one parameter, e.g., -// BinaryPredicateConcept. The preprocessor tries to split things up on -// the commas in the template argument list. We can't use an inner pair of -// parenthesis to hide the commas, because "boost::(Temp<Foo,Bar>)" isn't -// a valid instantiation pattern. Thus, we steal a feature from C99. - -#define __glibcxx_function_requires(...) \ - __gnu_cxx::__function_requires< __gnu_cxx::__VA_ARGS__ >(); -#define __glibcxx_class_requires(_a,_C) \ - _GLIBCXX_CLASS_REQUIRES(_a, __gnu_cxx, _C); -#define __glibcxx_class_requires2(_a,_b,_C) \ - _GLIBCXX_CLASS_REQUIRES2(_a, _b, __gnu_cxx, _C); -#define __glibcxx_class_requires3(_a,_b,_c,_C) \ - _GLIBCXX_CLASS_REQUIRES3(_a, _b, _c, __gnu_cxx, _C); -#define __glibcxx_class_requires4(_a,_b,_c,_d,_C) \ - _GLIBCXX_CLASS_REQUIRES4(_a, _b, _c, _d, __gnu_cxx, _C); - -#endif // enable/disable - -#endif // _GLIBCXX_CONCEPT_CHECK diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/concurrence.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/concurrence.h deleted file mode 100644 index c436a1b0806..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/concurrence.h +++ /dev/null @@ -1,95 +0,0 @@ -// Support for concurrent programing -*- C++ -*- - -// Copyright (C) 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _CONCURRENCE_H -#define _CONCURRENCE_H 1 - -// GCC's thread abstraction layer -#include "bits/gthr.h" - -#if __GTHREADS - -# ifdef __GTHREAD_MUTEX_INIT -# define __glibcxx_mutex_type __gthread_mutex_t -# define __glibcxx_mutex_define_initialized(NAME) \ -__gthread_mutex_t NAME = __GTHREAD_MUTEX_INIT -# define __glibcxx_mutex_lock(NAME) \ -__gthread_mutex_lock(&NAME) -# else -// Implies __GTHREAD_MUTEX_INIT_FUNCTION -struct __glibcxx_mutex : public __gthread_mutex_t -{ - __glibcxx_mutex() { __GTHREAD_MUTEX_INIT_FUNCTION(this); } -}; - -# define __glibcxx_mutex_type __glibcxx_mutex -# define __glibcxx_mutex_define_initialized(NAME) \ -__glibcxx_mutex NAME -# define __glibcxx_mutex_lock(NAME) \ -__gthread_mutex_lock(&NAME) -# endif - -# define __glibcxx_mutex_unlock(NAME) __gthread_mutex_unlock(&NAME) - -#else - -# define __glibcxx_mutex_type __gthread_mutex_t -# define __glibcxx_mutex_define_initialized(NAME) __gthread_mutex_t NAME -# define __glibcxx_mutex_lock(NAME) -# define __glibcxx_mutex_unlock(NAME) - -#endif - -namespace __gnu_cxx -{ - typedef __glibcxx_mutex_type mutex_type; - - // Scoped lock idiom. - // Acquire the mutex here with a constructor call, then release with - // the destructor call in accordance with RAII style. - class lock - { - // Externally defined and initialized. - mutex_type& device; - - public: - explicit lock(mutex_type& name) : device(name) - { __glibcxx_mutex_lock(device); } - - ~lock() throw() - { __glibcxx_mutex_unlock(device); } - - private: - lock(const lock&); - lock& operator=(const lock&); - }; -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h deleted file mode 100644 index d4e4ea0410a..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h +++ /dev/null @@ -1,345 +0,0 @@ -// The -*- C++ -*- type traits classes for internal use in libstdc++ - -// Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr> - -/** @file cpp_type_traits.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_TYPE_TRAITS_H -#define _CPP_TYPE_TRAITS_H 1 - -#pragma GCC system_header - -// -// This file provides some compile-time information about various types. -// These representations were designed, on purpose, to be constant-expressions -// and not types as found in <stl/bits/type_traits.h>. In particular, they -// can be used in control structures and the optimizer hopefully will do -// the obvious thing. -// -// Why integral expressions, and not functions nor types? -// Firstly, these compile-time entities are used as template-arguments -// so function return values won't work: We need compile-time entities. -// We're left with types and constant integral expressions. -// Secondly, from the point of view of ease of use, type-based compile-time -// information is -not- *that* convenient. On has to write lots of -// overloaded functions and to hope that the compiler will select the right -// one. As a net effect, the overall structure isn't very clear at first -// glance. -// Thirdly, partial ordering and overload resolution (of function templates) -// is highly costly in terms of compiler-resource. It is a Good Thing to -// keep these resource consumption as least as possible. -// -// See valarray_array.h for a case use. -// -// -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06. -// - -// NB: g++ can not compile these if declared within the class -// __is_pod itself. -namespace __gnu_internal -{ - typedef char __one; - typedef char __two[2]; - - template <typename _Tp> - __one __test_type (int _Tp::*); - template <typename _Tp> - __two& __test_type (...); -} // namespace __gnu_internal - -namespace std -{ - // Compare for equality of types. - template<typename, typename> - struct __are_same - { - enum - { - _M_type = 0 - }; - }; - - template<typename _Tp> - struct __are_same<_Tp, _Tp> - { - enum - { - _M_type = 1 - }; - }; - - // Define a nested type if some predicate holds. - template<typename, bool> - struct __enable_if - { - }; - - template<typename _Tp> - struct __enable_if<_Tp, true> - { - typedef _Tp _M_type; - }; - - // Holds if the template-argument is a void type. - template<typename _Tp> - struct __is_void - { - enum - { - _M_type = 0 - }; - }; - - template<> - struct __is_void<void> - { - enum - { - _M_type = 1 - }; - }; - - // - // Integer types - // - template<typename _Tp> - struct __is_integer - { - enum - { - _M_type = 0 - }; - }; - - // Thirteen specializations (yes there are eleven standard integer - // types; 'long long' and 'unsigned long long' are supported as - // extensions) - template<> - struct __is_integer<bool> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_integer<char> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_integer<signed char> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_integer<unsigned char> - { - enum - { - _M_type = 1 - }; - }; - -# ifdef _GLIBCXX_USE_WCHAR_T - template<> - struct __is_integer<wchar_t> - { - enum - { - _M_type = 1 - }; - }; -# endif - - template<> - struct __is_integer<short> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_integer<unsigned short> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_integer<int> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_integer<unsigned int> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_integer<long> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_integer<unsigned long> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_integer<long long> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_integer<unsigned long long> - { - enum - { - _M_type = 1 - }; - }; - - // - // Floating point types - // - template<typename _Tp> - struct __is_floating - { - enum - { - _M_type = 0 - }; - }; - - // three specializations (float, double and 'long double') - template<> - struct __is_floating<float> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_floating<double> - { - enum - { - _M_type = 1 - }; - }; - - template<> - struct __is_floating<long double> - { - enum - { - _M_type = 1 - }; - }; - - // - // An arithmetic type is an integer type or a floating point type - // - template<typename _Tp> - struct __is_arithmetic - { - enum - { - _M_type = __is_integer<_Tp>::_M_type || __is_floating<_Tp>::_M_type - }; - }; - - // - // A fundamental type is `void' or and arithmetic type - // - template<typename _Tp> - struct __is_fundamental - { - enum - { - _M_type = __is_void<_Tp>::_M_type || __is_arithmetic<_Tp>::_M_type - }; - }; - - // - // For the immediate use, the following is a good approximation - // - template<typename _Tp> - struct __is_pod - { - enum - { - _M_type = (sizeof(__gnu_internal::__test_type<_Tp>(0)) - != sizeof(__gnu_internal::__one)) - }; - }; - -} // namespace std - -#endif //_CPP_TYPE_TRAITS_H diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/deque.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/deque.tcc deleted file mode 100644 index e8e043886ab..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/deque.tcc +++ /dev/null @@ -1,719 +0,0 @@ -// Deque implementation (out of line) -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file deque.tcc - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _DEQUE_TCC -#define _DEQUE_TCC 1 - -namespace _GLIBCXX_STD -{ - template <typename _Tp, typename _Alloc> - deque<_Tp,_Alloc>& - deque<_Tp,_Alloc>:: - operator=(const deque& __x) - { - const size_type __len = size(); - if (&__x != this) - { - if (__len >= __x.size()) - erase(std::copy(__x.begin(), __x.end(), this->_M_impl._M_start), - this->_M_impl._M_finish); - else - { - const_iterator __mid = __x.begin() + difference_type(__len); - std::copy(__x.begin(), __mid, this->_M_impl._M_start); - insert(this->_M_impl._M_finish, __mid, __x.end()); - } - } - return *this; - } - - template <typename _Tp, typename _Alloc> - typename deque<_Tp,_Alloc>::iterator - deque<_Tp,_Alloc>:: - insert(iterator position, const value_type& __x) - { - if (position._M_cur == this->_M_impl._M_start._M_cur) - { - push_front(__x); - return this->_M_impl._M_start; - } - else if (position._M_cur == this->_M_impl._M_finish._M_cur) - { - push_back(__x); - iterator __tmp = this->_M_impl._M_finish; - --__tmp; - return __tmp; - } - else - return _M_insert_aux(position, __x); - } - - template <typename _Tp, typename _Alloc> - typename deque<_Tp,_Alloc>::iterator - deque<_Tp,_Alloc>:: - erase(iterator __position) - { - iterator __next = __position; - ++__next; - size_type __index = __position - this->_M_impl._M_start; - if (__index < (size() >> 1)) - { - std::copy_backward(this->_M_impl._M_start, __position, __next); - pop_front(); - } - else - { - std::copy(__next, this->_M_impl._M_finish, __position); - pop_back(); - } - return this->_M_impl._M_start + __index; - } - - template <typename _Tp, typename _Alloc> - typename deque<_Tp,_Alloc>::iterator - deque<_Tp,_Alloc>:: - erase(iterator __first, iterator __last) - { - if (__first == this->_M_impl._M_start && __last == this->_M_impl._M_finish) - { - clear(); - return this->_M_impl._M_finish; - } - else - { - const difference_type __n = __last - __first; - const difference_type __elems_before = __first - this->_M_impl._M_start; - if (static_cast<size_type>(__elems_before) < (size() - __n) / 2) - { - std::copy_backward(this->_M_impl._M_start, __first, __last); - iterator __new_start = this->_M_impl._M_start + __n; - std::_Destroy(this->_M_impl._M_start, __new_start); - _M_destroy_nodes(this->_M_impl._M_start._M_node, __new_start._M_node); - this->_M_impl._M_start = __new_start; - } - else - { - std::copy(__last, this->_M_impl._M_finish, __first); - iterator __new_finish = this->_M_impl._M_finish - __n; - std::_Destroy(__new_finish, this->_M_impl._M_finish); - _M_destroy_nodes(__new_finish._M_node + 1, - this->_M_impl._M_finish._M_node + 1); - this->_M_impl._M_finish = __new_finish; - } - return this->_M_impl._M_start + __elems_before; - } - } - - template <typename _Tp, typename _Alloc> - void - deque<_Tp,_Alloc>:: - clear() - { - for (_Map_pointer __node = this->_M_impl._M_start._M_node + 1; - __node < this->_M_impl._M_finish._M_node; - ++__node) - { - std::_Destroy(*__node, *__node + _S_buffer_size()); - _M_deallocate_node(*__node); - } - - if (this->_M_impl._M_start._M_node != this->_M_impl._M_finish._M_node) - { - std::_Destroy(this->_M_impl._M_start._M_cur, this->_M_impl._M_start._M_last); - std::_Destroy(this->_M_impl._M_finish._M_first, this->_M_impl._M_finish._M_cur); - _M_deallocate_node(this->_M_impl._M_finish._M_first); - } - else - std::_Destroy(this->_M_impl._M_start._M_cur, this->_M_impl._M_finish._M_cur); - - this->_M_impl._M_finish = this->_M_impl._M_start; - } - - template <typename _Tp, class _Alloc> - template <typename _InputIterator> - void - deque<_Tp,_Alloc> - ::_M_assign_aux(_InputIterator __first, _InputIterator __last, - input_iterator_tag) - { - iterator __cur = begin(); - for ( ; __first != __last && __cur != end(); ++__cur, ++__first) - *__cur = *__first; - if (__first == __last) - erase(__cur, end()); - else - insert(end(), __first, __last); - } - - template <typename _Tp, typename _Alloc> - void - deque<_Tp,_Alloc>:: - _M_fill_insert(iterator __pos, size_type __n, const value_type& __x) - { - if (__pos._M_cur == this->_M_impl._M_start._M_cur) - { - iterator __new_start = _M_reserve_elements_at_front(__n); - try - { - std::uninitialized_fill(__new_start, this->_M_impl._M_start, __x); - this->_M_impl._M_start = __new_start; - } - catch(...) - { - _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node); - __throw_exception_again; - } - } - else if (__pos._M_cur == this->_M_impl._M_finish._M_cur) - { - iterator __new_finish = _M_reserve_elements_at_back(__n); - try - { - std::uninitialized_fill(this->_M_impl._M_finish, __new_finish, __x); - this->_M_impl._M_finish = __new_finish; - } - catch(...) - { - _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1, - __new_finish._M_node + 1); - __throw_exception_again; - } - } - else - _M_insert_aux(__pos, __n, __x); - } - - template <typename _Tp, typename _Alloc> - void - deque<_Tp,_Alloc>:: - _M_fill_initialize(const value_type& __value) - { - _Map_pointer __cur; - try - { - for (__cur = this->_M_impl._M_start._M_node; - __cur < this->_M_impl._M_finish._M_node; - ++__cur) - std::uninitialized_fill(*__cur, *__cur + _S_buffer_size(), __value); - std::uninitialized_fill(this->_M_impl._M_finish._M_first, - this->_M_impl._M_finish._M_cur, - __value); - } - catch(...) - { - std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur)); - __throw_exception_again; - } - } - - template <typename _Tp, typename _Alloc> - template <typename _InputIterator> - void - deque<_Tp,_Alloc>:: - _M_range_initialize(_InputIterator __first, _InputIterator __last, - input_iterator_tag) - { - this->_M_initialize_map(0); - try - { - for ( ; __first != __last; ++__first) - push_back(*__first); - } - catch(...) - { - clear(); - __throw_exception_again; - } - } - - template <typename _Tp, typename _Alloc> - template <typename _ForwardIterator> - void - deque<_Tp,_Alloc>:: - _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) - { - const size_type __n = std::distance(__first, __last); - this->_M_initialize_map(__n); - - _Map_pointer __cur_node; - try - { - for (__cur_node = this->_M_impl._M_start._M_node; - __cur_node < this->_M_impl._M_finish._M_node; - ++__cur_node) - { - _ForwardIterator __mid = __first; - std::advance(__mid, _S_buffer_size()); - std::uninitialized_copy(__first, __mid, *__cur_node); - __first = __mid; - } - std::uninitialized_copy(__first, __last, this->_M_impl._M_finish._M_first); - } - catch(...) - { - std::_Destroy(this->_M_impl._M_start, iterator(*__cur_node, __cur_node)); - __throw_exception_again; - } - } - - // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_last - 1. - template <typename _Tp, typename _Alloc> - void - deque<_Tp,_Alloc>:: - _M_push_back_aux(const value_type& __t) - { - value_type __t_copy = __t; - _M_reserve_map_at_back(); - *(this->_M_impl._M_finish._M_node + 1) = this->_M_allocate_node(); - try - { - std::_Construct(this->_M_impl._M_finish._M_cur, __t_copy); - this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node + 1); - this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first; - } - catch(...) - { - _M_deallocate_node(*(this->_M_impl._M_finish._M_node + 1)); - __throw_exception_again; - } - } - - // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_first. - template <typename _Tp, typename _Alloc> - void - deque<_Tp,_Alloc>:: - _M_push_front_aux(const value_type& __t) - { - value_type __t_copy = __t; - _M_reserve_map_at_front(); - *(this->_M_impl._M_start._M_node - 1) = this->_M_allocate_node(); - try - { - this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node - 1); - this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_last - 1; - std::_Construct(this->_M_impl._M_start._M_cur, __t_copy); - } - catch(...) - { - ++this->_M_impl._M_start; - _M_deallocate_node(*(this->_M_impl._M_start._M_node - 1)); - __throw_exception_again; - } - } - - // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_first. - template <typename _Tp, typename _Alloc> - void deque<_Tp,_Alloc>:: - _M_pop_back_aux() - { - _M_deallocate_node(this->_M_impl._M_finish._M_first); - this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node - 1); - this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_last - 1; - std::_Destroy(this->_M_impl._M_finish._M_cur); - } - - // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_last - 1. Note that - // if the deque has at least one element (a precondition for this member - // function), and if _M_impl._M_start._M_cur == _M_impl._M_start._M_last, then the deque - // must have at least two nodes. - template <typename _Tp, typename _Alloc> - void deque<_Tp,_Alloc>:: - _M_pop_front_aux() - { - std::_Destroy(this->_M_impl._M_start._M_cur); - _M_deallocate_node(this->_M_impl._M_start._M_first); - this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node + 1); - this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_first; - } - - template <typename _Tp, typename _Alloc> - template <typename _InputIterator> - void - deque<_Tp,_Alloc>:: - _M_range_insert_aux(iterator __pos, - _InputIterator __first, _InputIterator __last, - input_iterator_tag) - { std::copy(__first, __last, std::inserter(*this, __pos)); } - - template <typename _Tp, typename _Alloc> - template <typename _ForwardIterator> - void - deque<_Tp,_Alloc>:: - _M_range_insert_aux(iterator __pos, - _ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) - { - size_type __n = std::distance(__first, __last); - if (__pos._M_cur == this->_M_impl._M_start._M_cur) - { - iterator __new_start = _M_reserve_elements_at_front(__n); - try - { - std::uninitialized_copy(__first, __last, __new_start); - this->_M_impl._M_start = __new_start; - } - catch(...) - { - _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node); - __throw_exception_again; - } - } - else if (__pos._M_cur == this->_M_impl._M_finish._M_cur) - { - iterator __new_finish = _M_reserve_elements_at_back(__n); - try - { - std::uninitialized_copy(__first, __last, this->_M_impl._M_finish); - this->_M_impl._M_finish = __new_finish; - } - catch(...) - { - _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1, - __new_finish._M_node + 1); - __throw_exception_again; - } - } - else - _M_insert_aux(__pos, __first, __last, __n); - } - - template <typename _Tp, typename _Alloc> - typename deque<_Tp, _Alloc>::iterator - deque<_Tp,_Alloc>:: - _M_insert_aux(iterator __pos, const value_type& __x) - { - difference_type __index = __pos - this->_M_impl._M_start; - value_type __x_copy = __x; // XXX copy - if (static_cast<size_type>(__index) < size() / 2) - { - push_front(front()); - iterator __front1 = this->_M_impl._M_start; - ++__front1; - iterator __front2 = __front1; - ++__front2; - __pos = this->_M_impl._M_start + __index; - iterator __pos1 = __pos; - ++__pos1; - std::copy(__front2, __pos1, __front1); - } - else - { - push_back(back()); - iterator __back1 = this->_M_impl._M_finish; - --__back1; - iterator __back2 = __back1; - --__back2; - __pos = this->_M_impl._M_start + __index; - std::copy_backward(__pos, __back2, __back1); - } - *__pos = __x_copy; - return __pos; - } - - template <typename _Tp, typename _Alloc> - void - deque<_Tp,_Alloc>:: - _M_insert_aux(iterator __pos, size_type __n, const value_type& __x) - { - const difference_type __elems_before = __pos - this->_M_impl._M_start; - size_type __length = this->size(); - value_type __x_copy = __x; - if (__elems_before < difference_type(__length / 2)) - { - iterator __new_start = _M_reserve_elements_at_front(__n); - iterator __old_start = this->_M_impl._M_start; - __pos = this->_M_impl._M_start + __elems_before; - try - { - if (__elems_before >= difference_type(__n)) - { - iterator __start_n = this->_M_impl._M_start + difference_type(__n); - std::uninitialized_copy(this->_M_impl._M_start, __start_n, - __new_start); - this->_M_impl._M_start = __new_start; - std::copy(__start_n, __pos, __old_start); - fill(__pos - difference_type(__n), __pos, __x_copy); - } - else - { - std::__uninitialized_copy_fill(this->_M_impl._M_start, __pos, - __new_start, - this->_M_impl._M_start, __x_copy); - this->_M_impl._M_start = __new_start; - std::fill(__old_start, __pos, __x_copy); - } - } - catch(...) - { - _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node); - __throw_exception_again; - } - } - else - { - iterator __new_finish = _M_reserve_elements_at_back(__n); - iterator __old_finish = this->_M_impl._M_finish; - const difference_type __elems_after = - difference_type(__length) - __elems_before; - __pos = this->_M_impl._M_finish - __elems_after; - try - { - if (__elems_after > difference_type(__n)) - { - iterator __finish_n = this->_M_impl._M_finish - difference_type(__n); - std::uninitialized_copy(__finish_n, this->_M_impl._M_finish, - this->_M_impl._M_finish); - this->_M_impl._M_finish = __new_finish; - std::copy_backward(__pos, __finish_n, __old_finish); - std::fill(__pos, __pos + difference_type(__n), __x_copy); - } - else - { - std::__uninitialized_fill_copy(this->_M_impl._M_finish, - __pos + difference_type(__n), - __x_copy, __pos, - this->_M_impl._M_finish); - this->_M_impl._M_finish = __new_finish; - std::fill(__pos, __old_finish, __x_copy); - } - } - catch(...) - { - _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1, - __new_finish._M_node + 1); - __throw_exception_again; - } - } - } - - template <typename _Tp, typename _Alloc> - template <typename _ForwardIterator> - void - deque<_Tp,_Alloc>:: - _M_insert_aux(iterator __pos, - _ForwardIterator __first, _ForwardIterator __last, - size_type __n) - { - const difference_type __elemsbefore = __pos - this->_M_impl._M_start; - size_type __length = size(); - if (static_cast<size_type>(__elemsbefore) < __length / 2) - { - iterator __new_start = _M_reserve_elements_at_front(__n); - iterator __old_start = this->_M_impl._M_start; - __pos = this->_M_impl._M_start + __elemsbefore; - try - { - if (__elemsbefore >= difference_type(__n)) - { - iterator __start_n = this->_M_impl._M_start + difference_type(__n); - std::uninitialized_copy(this->_M_impl._M_start, __start_n, - __new_start); - this->_M_impl._M_start = __new_start; - std::copy(__start_n, __pos, __old_start); - std::copy(__first, __last, __pos - difference_type(__n)); - } - else - { - _ForwardIterator __mid = __first; - std::advance(__mid, difference_type(__n) - __elemsbefore); - std::__uninitialized_copy_copy(this->_M_impl._M_start, __pos, - __first, __mid, __new_start); - this->_M_impl._M_start = __new_start; - std::copy(__mid, __last, __old_start); - } - } - catch(...) - { - _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node); - __throw_exception_again; - } - } - else - { - iterator __new_finish = _M_reserve_elements_at_back(__n); - iterator __old_finish = this->_M_impl._M_finish; - const difference_type __elemsafter = - difference_type(__length) - __elemsbefore; - __pos = this->_M_impl._M_finish - __elemsafter; - try - { - if (__elemsafter > difference_type(__n)) - { - iterator __finish_n = this->_M_impl._M_finish - difference_type(__n); - std::uninitialized_copy(__finish_n, - this->_M_impl._M_finish, - this->_M_impl._M_finish); - this->_M_impl._M_finish = __new_finish; - std::copy_backward(__pos, __finish_n, __old_finish); - std::copy(__first, __last, __pos); - } - else - { - _ForwardIterator __mid = __first; - std::advance(__mid, __elemsafter); - std::__uninitialized_copy_copy(__mid, __last, __pos, - this->_M_impl._M_finish, - this->_M_impl._M_finish); - this->_M_impl._M_finish = __new_finish; - std::copy(__first, __mid, __pos); - } - } - catch(...) - { - _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1, - __new_finish._M_node + 1); - __throw_exception_again; - } - } - } - - template <typename _Tp, typename _Alloc> - void - deque<_Tp,_Alloc>:: - _M_new_elements_at_front(size_type __new_elems) - { - size_type __new_nodes - = (__new_elems + _S_buffer_size() - 1) / _S_buffer_size(); - _M_reserve_map_at_front(__new_nodes); - size_type __i; - try - { - for (__i = 1; __i <= __new_nodes; ++__i) - *(this->_M_impl._M_start._M_node - __i) = this->_M_allocate_node(); - } - catch(...) - { - for (size_type __j = 1; __j < __i; ++__j) - _M_deallocate_node(*(this->_M_impl._M_start._M_node - __j)); - __throw_exception_again; - } - } - - template <typename _Tp, typename _Alloc> - void - deque<_Tp,_Alloc>:: - _M_new_elements_at_back(size_type __new_elems) - { - size_type __new_nodes - = (__new_elems + _S_buffer_size() - 1) / _S_buffer_size(); - _M_reserve_map_at_back(__new_nodes); - size_type __i; - try - { - for (__i = 1; __i <= __new_nodes; ++__i) - *(this->_M_impl._M_finish._M_node + __i) = this->_M_allocate_node(); - } - catch(...) - { - for (size_type __j = 1; __j < __i; ++__j) - _M_deallocate_node(*(this->_M_impl._M_finish._M_node + __j)); - __throw_exception_again; - } - } - - template <typename _Tp, typename _Alloc> - void - deque<_Tp,_Alloc>:: - _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front) - { - size_type __old_num_nodes - = this->_M_impl._M_finish._M_node - this->_M_impl._M_start._M_node + 1; - size_type __new_num_nodes = __old_num_nodes + __nodes_to_add; - - _Map_pointer __new_nstart; - if (this->_M_impl._M_map_size > 2 * __new_num_nodes) - { - __new_nstart = this->_M_impl._M_map + (this->_M_impl._M_map_size - - __new_num_nodes) / 2 - + (__add_at_front ? __nodes_to_add : 0); - if (__new_nstart < this->_M_impl._M_start._M_node) - std::copy(this->_M_impl._M_start._M_node, - this->_M_impl._M_finish._M_node + 1, - __new_nstart); - else - std::copy_backward(this->_M_impl._M_start._M_node, - this->_M_impl._M_finish._M_node + 1, - __new_nstart + __old_num_nodes); - } - else - { - size_type __new_map_size = this->_M_impl._M_map_size - + std::max(this->_M_impl._M_map_size, - __nodes_to_add) + 2; - - _Map_pointer __new_map = this->_M_allocate_map(__new_map_size); - __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2 - + (__add_at_front ? __nodes_to_add : 0); - std::copy(this->_M_impl._M_start._M_node, - this->_M_impl._M_finish._M_node + 1, - __new_nstart); - _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size); - - this->_M_impl._M_map = __new_map; - this->_M_impl._M_map_size = __new_map_size; - } - - this->_M_impl._M_start._M_set_node(__new_nstart); - this->_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1); - } -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/fstream.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/fstream.tcc deleted file mode 100644 index 25a4d48cb72..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/fstream.tcc +++ /dev/null @@ -1,877 +0,0 @@ -// File based streams -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.8 File-based streams -// - -#ifndef _FSTREAM_TCC -#define _FSTREAM_TCC 1 - -#pragma GCC system_header - -namespace std -{ - template<typename _CharT, typename _Traits> - void - basic_filebuf<_CharT, _Traits>:: - _M_allocate_internal_buffer() - { - // Allocate internal buffer only if one doesn't already exist - // (either allocated or provided by the user via setbuf). - if (!_M_buf_allocated && !this->_M_buf) - { - this->_M_buf = new char_type[this->_M_buf_size]; - _M_buf_allocated = true; - } - } - - template<typename _CharT, typename _Traits> - void - basic_filebuf<_CharT, _Traits>:: - _M_destroy_internal_buffer() throw() - { - if (_M_buf_allocated) - { - delete [] this->_M_buf; - this->_M_buf = NULL; - _M_buf_allocated = false; - } - delete [] _M_ext_buf; - _M_ext_buf = NULL; - _M_ext_buf_size = 0; - _M_ext_next = NULL; - _M_ext_end = NULL; - } - - template<typename _CharT, typename _Traits> - basic_filebuf<_CharT, _Traits>:: - basic_filebuf() : __streambuf_type(), _M_lock(), _M_file(&_M_lock), - _M_mode(ios_base::openmode(0)), _M_state_beg(), _M_state_cur(), - _M_state_last(), _M_buf(NULL), _M_buf_size(BUFSIZ), - _M_buf_allocated(false), _M_reading(false), _M_writing(false), _M_pback(), - _M_pback_cur_save(0), _M_pback_end_save(0), _M_pback_init(false), - _M_codecvt(0), _M_ext_buf(0), _M_ext_buf_size(0), _M_ext_next(0), - _M_ext_end(0) - { - if (has_facet<__codecvt_type>(this->_M_buf_locale)) - _M_codecvt = &use_facet<__codecvt_type>(this->_M_buf_locale); - } - - template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::__filebuf_type* - basic_filebuf<_CharT, _Traits>:: - open(const char* __s, ios_base::openmode __mode) - { - __filebuf_type *__ret = NULL; - if (!this->is_open()) - { - _M_file.open(__s, __mode); - if (this->is_open()) - { - _M_allocate_internal_buffer(); - this->_M_mode = __mode; - - // Setup initial buffer to 'uncommitted' mode. - _M_reading = false; - _M_writing = false; - _M_set_buffer(-1); - - // Reset to initial state. - _M_state_last = _M_state_cur = _M_state_beg; - - // 27.8.1.3,4 - if ((__mode & ios_base::ate) - && this->seekoff(0, ios_base::end, __mode) - == pos_type(off_type(-1))) - this->close(); - else - __ret = this; - } - } - return __ret; - } - - template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::__filebuf_type* - basic_filebuf<_CharT, _Traits>:: - close() throw() - { - __filebuf_type* __ret = NULL; - if (this->is_open()) - { - bool __testfail = false; - try - { - if (!_M_terminate_output()) - __testfail = true; - } - catch(...) - { __testfail = true; } - - // NB: Do this here so that re-opened filebufs will be cool... - this->_M_mode = ios_base::openmode(0); - this->_M_pback_init = false; - _M_destroy_internal_buffer(); - _M_reading = false; - _M_writing = false; - _M_set_buffer(-1); - _M_state_last = _M_state_cur = _M_state_beg; - - if (!_M_file.close()) - __testfail = true; - - if (!__testfail) - __ret = this; - } - return __ret; - } - - template<typename _CharT, typename _Traits> - streamsize - basic_filebuf<_CharT, _Traits>:: - showmanyc() - { - streamsize __ret = -1; - const bool __testin = this->_M_mode & ios_base::in; - if (__testin && this->is_open()) - { - // For a stateful encoding (-1) the pending sequence might be just - // shift and unshift prefixes with no actual character. - __ret = this->egptr() - this->gptr(); - if (__check_facet(_M_codecvt).encoding() >= 0) - __ret += _M_file.showmanyc() / _M_codecvt->max_length(); - } - return __ret; - } - - template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::int_type - basic_filebuf<_CharT, _Traits>:: - underflow() - { - int_type __ret = traits_type::eof(); - const bool __testin = this->_M_mode & ios_base::in; - if (__testin && !_M_writing) - { - // Check for pback madness, and if so swich back to the - // normal buffers and jet outta here before expensive - // fileops happen... - _M_destroy_pback(); - - if (this->gptr() < this->egptr()) - return traits_type::to_int_type(*this->gptr()); - - // Get and convert input sequence. - const size_t __buflen = this->_M_buf_size > 1 - ? this->_M_buf_size - 1 : 1; - - // Will be set to true if ::read() returns 0 indicating EOF. - bool __got_eof = false; - // Number of internal characters produced. - streamsize __ilen = 0; - codecvt_base::result __r = codecvt_base::ok; - if (__check_facet(_M_codecvt).always_noconv()) - { - __ilen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()), - __buflen); - if (__ilen == 0) - __got_eof = true; - } - else - { - // Worst-case number of external bytes. - // XXX Not done encoding() == -1. - const int __enc = _M_codecvt->encoding(); - streamsize __blen; // Minimum buffer size. - streamsize __rlen; // Number of chars to read. - if (__enc > 0) - __blen = __rlen = __buflen * __enc; - else - { - __blen = __buflen + _M_codecvt->max_length() - 1; - __rlen = __buflen; - } - const streamsize __remainder = _M_ext_end - _M_ext_next; - __rlen = __rlen > __remainder ? __rlen - __remainder : 0; - - // An imbue in 'read' mode implies first converting the external - // chars already present. - if (_M_reading && this->egptr() == this->eback() && __remainder) - __rlen = 0; - - // Allocate buffer if necessary and move unconverted - // bytes to front. - if (_M_ext_buf_size < __blen) - { - char* __buf = new char[__blen]; - if (__remainder) - std::memcpy(__buf, _M_ext_next, __remainder); - - delete [] _M_ext_buf; - _M_ext_buf = __buf; - _M_ext_buf_size = __blen; - } - else if (__remainder) - std::memmove(_M_ext_buf, _M_ext_next, __remainder); - - _M_ext_next = _M_ext_buf; - _M_ext_end = _M_ext_buf + __remainder; - _M_state_last = _M_state_cur; - - do - { - if (__rlen > 0) - { - // Sanity check! - // This may fail if the return value of - // codecvt::max_length() is bogus. - if (_M_ext_end - _M_ext_buf + __rlen > _M_ext_buf_size) - { - __throw_ios_failure(__N("basic_filebuf::underflow " - "codecvt::max_length() " - "is not valid")); - } - streamsize __elen = _M_file.xsgetn(_M_ext_end, __rlen); - if (__elen == 0) - __got_eof = true; - else if (__elen == -1) - break; - _M_ext_end += __elen; - } - - char_type* __iend; - __r = _M_codecvt->in(_M_state_cur, _M_ext_next, - _M_ext_end, _M_ext_next, this->eback(), - this->eback() + __buflen, __iend); - if (__r == codecvt_base::noconv) - { - size_t __avail = _M_ext_end - _M_ext_buf; - __ilen = std::min(__avail, __buflen); - traits_type::copy(this->eback(), - reinterpret_cast<char_type*>(_M_ext_buf), __ilen); - _M_ext_next = _M_ext_buf + __ilen; - } - else - __ilen = __iend - this->eback(); - - // _M_codecvt->in may return error while __ilen > 0: this is - // ok, and actually occurs in case of mixed encodings (e.g., - // XML files). - if (__r == codecvt_base::error) - break; - - __rlen = 1; - } - while (__ilen == 0 && !__got_eof); - } - - if (__ilen > 0) - { - _M_set_buffer(__ilen); - _M_reading = true; - __ret = traits_type::to_int_type(*this->gptr()); - } - else if (__got_eof) - { - // If the actual end of file is reached, set 'uncommitted' - // mode, thus allowing an immediate write without an - // intervening seek. - _M_set_buffer(-1); - _M_reading = false; - // However, reaching it while looping on partial means that - // the file has got an incomplete character. - if (__r == codecvt_base::partial) - __throw_ios_failure(__N("basic_filebuf::underflow " - "incomplete character in file")); - } - else if (__r == codecvt_base::error) - __throw_ios_failure(__N("basic_filebuf::underflow " - "invalid byte sequence in file")); - else - __throw_ios_failure(__N("basic_filebuf::underflow " - "error reading the file")); - } - return __ret; - } - - template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::int_type - basic_filebuf<_CharT, _Traits>:: - pbackfail(int_type __i) - { - int_type __ret = traits_type::eof(); - const bool __testin = this->_M_mode & ios_base::in; - if (__testin && !_M_writing) - { - // Remember whether the pback buffer is active, otherwise below - // we may try to store in it a second char (libstdc++/9761). - const bool __testpb = this->_M_pback_init; - const bool __testeof = traits_type::eq_int_type(__i, __ret); - int_type __tmp; - if (this->eback() < this->gptr()) - { - this->gbump(-1); - __tmp = traits_type::to_int_type(*this->gptr()); - } - else if (this->seekoff(-1, ios_base::cur) != pos_type(off_type(-1))) - { - __tmp = this->underflow(); - if (traits_type::eq_int_type(__tmp, __ret)) - return __ret; - } - else - { - // At the beginning of the buffer, need to make a - // putback position available. But the seek may fail - // (f.i., at the beginning of a file, see - // libstdc++/9439) and in that case we return - // traits_type::eof(). - return __ret; - } - - // Try to put back __i into input sequence in one of three ways. - // Order these tests done in is unspecified by the standard. - if (!__testeof && traits_type::eq_int_type(__i, __tmp)) - __ret = __i; - else if (__testeof) - __ret = traits_type::not_eof(__i); - else if (!__testpb) - { - _M_create_pback(); - _M_reading = true; - *this->gptr() = traits_type::to_char_type(__i); - __ret = __i; - } - } - return __ret; - } - - template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::int_type - basic_filebuf<_CharT, _Traits>:: - overflow(int_type __c) - { - int_type __ret = traits_type::eof(); - const bool __testeof = traits_type::eq_int_type(__c, __ret); - const bool __testout = this->_M_mode & ios_base::out; - if (__testout && !_M_reading) - { - if (this->pbase() < this->pptr()) - { - // If appropriate, append the overflow char. - if (!__testeof) - { - *this->pptr() = traits_type::to_char_type(__c); - this->pbump(1); - } - - // Convert pending sequence to external representation, - // and output. - if (_M_convert_to_external(this->pbase(), - this->pptr() - this->pbase())) - { - _M_set_buffer(0); - __ret = traits_type::not_eof(__c); - } - } - else if (this->_M_buf_size > 1) - { - // Overflow in 'uncommitted' mode: set _M_writing, set - // the buffer to the initial 'write' mode, and put __c - // into the buffer. - _M_set_buffer(0); - _M_writing = true; - if (!__testeof) - { - *this->pptr() = traits_type::to_char_type(__c); - this->pbump(1); - } - __ret = traits_type::not_eof(__c); - } - else - { - // Unbuffered. - char_type __conv = traits_type::to_char_type(__c); - if (__testeof || _M_convert_to_external(&__conv, 1)) - { - _M_writing = true; - __ret = traits_type::not_eof(__c); - } - } - } - return __ret; - } - - template<typename _CharT, typename _Traits> - bool - basic_filebuf<_CharT, _Traits>:: - _M_convert_to_external(_CharT* __ibuf, streamsize __ilen) - { - // Sizes of external and pending output. - streamsize __elen; - streamsize __plen; - if (__check_facet(_M_codecvt).always_noconv()) - { - __elen = _M_file.xsputn(reinterpret_cast<char*>(__ibuf), __ilen); - __plen = __ilen; - } - else - { - // Worst-case number of external bytes needed. - // XXX Not done encoding() == -1. - streamsize __blen = __ilen * _M_codecvt->max_length(); - char* __buf = static_cast<char*>(__builtin_alloca(__blen)); - - char* __bend; - const char_type* __iend; - codecvt_base::result __r; - __r = _M_codecvt->out(_M_state_cur, __ibuf, __ibuf + __ilen, - __iend, __buf, __buf + __blen, __bend); - - if (__r == codecvt_base::ok || __r == codecvt_base::partial) - __blen = __bend - __buf; - else if (__r == codecvt_base::noconv) - { - // Same as the always_noconv case above. - __buf = reinterpret_cast<char*>(__ibuf); - __blen = __ilen; - } - else - __throw_ios_failure(__N("basic_filebuf::_M_convert_to_external " - "conversion error")); - - __elen = _M_file.xsputn(__buf, __blen); - __plen = __blen; - - // Try once more for partial conversions. - if (__r == codecvt_base::partial && __elen == __plen) - { - const char_type* __iresume = __iend; - streamsize __rlen = this->pptr() - __iend; - __r = _M_codecvt->out(_M_state_cur, __iresume, - __iresume + __rlen, __iend, __buf, - __buf + __blen, __bend); - if (__r != codecvt_base::error) - { - __rlen = __bend - __buf; - __elen = _M_file.xsputn(__buf, __rlen); - __plen = __rlen; - } - else - __throw_ios_failure(__N("basic_filebuf::_M_convert_to_external " - "conversion error")); - } - } - return __elen == __plen; - } - - template<typename _CharT, typename _Traits> - streamsize - basic_filebuf<_CharT, _Traits>:: - xsgetn(_CharT* __s, streamsize __n) - { - // Clear out pback buffer before going on to the real deal... - streamsize __ret = 0; - if (this->_M_pback_init) - { - if (__n > 0 && this->gptr() == this->eback()) - { - *__s++ = *this->gptr(); - this->gbump(1); - __ret = 1; - --__n; - } - _M_destroy_pback(); - } - - // Optimization in the always_noconv() case, to be generalized in the - // future: when __n > __buflen we read directly instead of using the - // buffer repeatedly. - const bool __testin = this->_M_mode & ios_base::in; - const streamsize __buflen = this->_M_buf_size > 1 ? this->_M_buf_size - 1 - : 1; - if (__n > __buflen && __check_facet(_M_codecvt).always_noconv() - && __testin && !_M_writing) - { - // First, copy the chars already present in the buffer. - const streamsize __avail = this->egptr() - this->gptr(); - if (__avail != 0) - { - if (__avail == 1) - *__s = *this->gptr(); - else - traits_type::copy(__s, this->gptr(), __avail); - __s += __avail; - this->gbump(__avail); - __ret += __avail; - __n -= __avail; - } - - const streamsize __len = _M_file.xsgetn(reinterpret_cast<char*>(__s), - __n); - if (__len == -1) - __throw_ios_failure(__N("basic_filebuf::xsgetn " - "error reading the file")); - __ret += __len; - if (__len == __n) - { - _M_set_buffer(0); - _M_reading = true; - } - else if (__len == 0) - { - // If end of file is reached, set 'uncommitted' - // mode, thus allowing an immediate write without - // an intervening seek. - _M_set_buffer(-1); - _M_reading = false; - } - } - else - __ret += __streambuf_type::xsgetn(__s, __n); - - return __ret; - } - - template<typename _CharT, typename _Traits> - streamsize - basic_filebuf<_CharT, _Traits>:: - xsputn(const _CharT* __s, streamsize __n) - { - // Optimization in the always_noconv() case, to be generalized in the - // future: when __n is sufficiently large we write directly instead of - // using the buffer. - streamsize __ret = 0; - const bool __testout = this->_M_mode & ios_base::out; - if (__check_facet(_M_codecvt).always_noconv() - && __testout && !_M_reading) - { - // Measurement would reveal the best choice. - const streamsize __chunk = 1ul << 10; - streamsize __bufavail = this->epptr() - this->pptr(); - - // Don't mistake 'uncommitted' mode buffered with unbuffered. - if (!_M_writing && this->_M_buf_size > 1) - __bufavail = this->_M_buf_size - 1; - - const streamsize __limit = std::min(__chunk, __bufavail); - if (__n >= __limit) - { - const streamsize __buffill = this->pptr() - this->pbase(); - const char* __buf = reinterpret_cast<const char*>(this->pbase()); - __ret = _M_file.xsputn_2(__buf, __buffill, - reinterpret_cast<const char*>(__s), - __n); - if (__ret == __buffill + __n) - { - _M_set_buffer(0); - _M_writing = true; - } - if (__ret > __buffill) - __ret -= __buffill; - else - __ret = 0; - } - else - __ret = __streambuf_type::xsputn(__s, __n); - } - else - __ret = __streambuf_type::xsputn(__s, __n); - return __ret; - } - - template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::__streambuf_type* - basic_filebuf<_CharT, _Traits>:: - setbuf(char_type* __s, streamsize __n) - { - if (!this->is_open()) - if (__s == 0 && __n == 0) - this->_M_buf_size = 1; - else if (__s && __n > 0) - { - // This is implementation-defined behavior, and assumes that - // an external char_type array of length __n exists and has - // been pre-allocated. If this is not the case, things will - // quickly blow up. When __n > 1, __n - 1 positions will be - // used for the get area, __n - 1 for the put area and 1 - // position to host the overflow char of a full put area. - // When __n == 1, 1 position will be used for the get area - // and 0 for the put area, as in the unbuffered case above. - this->_M_buf = __s; - this->_M_buf_size = __n; - } - return this; - } - - - // According to 27.8.1.4 p11 - 13, seekoff should ignore the last - // argument (of type openmode). - template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::pos_type - basic_filebuf<_CharT, _Traits>:: - seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode) - { - int __width = 0; - if (_M_codecvt) - __width = _M_codecvt->encoding(); - if (__width < 0) - __width = 0; - - pos_type __ret = pos_type(off_type(-1)); - const bool __testfail = __off != 0 && __width <= 0; - if (this->is_open() && !__testfail) - { - // Ditch any pback buffers to avoid confusion. - _M_destroy_pback(); - - // Correct state at destination. Note that this is the correct - // state for the current position during output, because - // codecvt::unshift() returns the state to the initial state. - // This is also the correct state at the end of the file because - // an unshift sequence should have been written at the end. - __state_type __state = _M_state_beg; - off_type __computed_off = __off * __width; - if (_M_reading && __way == ios_base::cur) - { - if (_M_codecvt->always_noconv()) - __computed_off += this->gptr() - this->egptr(); - else - { - // Calculate offset from _M_ext_buf that corresponds - // to gptr(). Note: uses _M_state_last, which - // corresponds to eback(). - const int __gptr_off = - _M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next, - this->gptr() - this->eback()); - __computed_off += _M_ext_buf + __gptr_off - _M_ext_end; - - // _M_state_last is modified by codecvt::length() so - // it now corresponds to gptr(). - __state = _M_state_last; - } - } - __ret = _M_seek(__computed_off, __way, __state); - } - return __ret; - } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 171. Strange seekpos() semantics due to joint position - // According to the resolution of DR 171, seekpos should ignore the last - // argument (of type openmode). - template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::pos_type - basic_filebuf<_CharT, _Traits>:: - seekpos(pos_type __pos, ios_base::openmode) - { - pos_type __ret = pos_type(off_type(-1)); - if (this->is_open()) - { - // Ditch any pback buffers to avoid confusion. - _M_destroy_pback(); - __ret = _M_seek(off_type(__pos), ios_base::beg, __pos.state()); - } - return __ret; - } - - template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::pos_type - basic_filebuf<_CharT, _Traits>:: - _M_seek(off_type __off, ios_base::seekdir __way, __state_type __state) - { - pos_type __ret = pos_type(off_type(-1)); - if (_M_terminate_output()) - { - // Returns pos_type(off_type(-1)) in case of failure. - __ret = pos_type(_M_file.seekoff(__off, __way)); - _M_reading = false; - _M_writing = false; - _M_ext_next = _M_ext_end = _M_ext_buf; - _M_set_buffer(-1); - _M_state_cur = __state; - __ret.state(_M_state_cur); - } - return __ret; - } - - template<typename _CharT, typename _Traits> - bool - basic_filebuf<_CharT, _Traits>:: - _M_terminate_output() - { - // Part one: update the output sequence. - bool __testvalid = true; - if (this->pbase() < this->pptr()) - { - const int_type __tmp = this->overflow(); - if (traits_type::eq_int_type(__tmp, traits_type::eof())) - __testvalid = false; - } - - // Part two: output unshift sequence. - if (_M_writing && !__check_facet(_M_codecvt).always_noconv() - && __testvalid) - { - // Note: this value is arbitrary, since there is no way to - // get the length of the unshift sequence from codecvt, - // without calling unshift. - const size_t __blen = 128; - char __buf[__blen]; - codecvt_base::result __r; - streamsize __ilen = 0; - - do - { - char* __next; - __r = _M_codecvt->unshift(_M_state_cur, __buf, - __buf + __blen, __next); - if (__r == codecvt_base::error) - __testvalid = false; - else if (__r == codecvt_base::ok || - __r == codecvt_base::partial) - { - __ilen = __next - __buf; - if (__ilen > 0) - { - const streamsize __elen = _M_file.xsputn(__buf, __ilen); - if (__elen != __ilen) - __testvalid = false; - } - } - } - while (__r == codecvt_base::partial && __ilen > 0 && __testvalid); - - if (__testvalid) - { - // This second call to overflow() is required by the standard, - // but it's not clear why it's needed, since the output buffer - // should be empty by this point (it should have been emptied - // in the first call to overflow()). - const int_type __tmp = this->overflow(); - if (traits_type::eq_int_type(__tmp, traits_type::eof())) - __testvalid = false; - } - } - return __testvalid; - } - - template<typename _CharT, typename _Traits> - int - basic_filebuf<_CharT, _Traits>:: - sync() - { - // Make sure that the internal buffer resyncs its idea of - // the file position with the external file. - int __ret = 0; - if (this->pbase() < this->pptr()) - { - const int_type __tmp = this->overflow(); - if (traits_type::eq_int_type(__tmp, traits_type::eof())) - __ret = -1; - } - return __ret; - } - - template<typename _CharT, typename _Traits> - void - basic_filebuf<_CharT, _Traits>:: - imbue(const locale& __loc) - { - bool __testvalid = true; - - const __codecvt_type* _M_codecvt_tmp = 0; - if (__builtin_expect(has_facet<__codecvt_type>(__loc), true)) - _M_codecvt_tmp = &use_facet<__codecvt_type>(__loc); - - if (this->is_open()) - { - // encoding() == -1 is ok only at the beginning. - if ((_M_reading || _M_writing) - && __check_facet(_M_codecvt).encoding() == -1) - __testvalid = false; - else - { - if (_M_reading) - { - if (__check_facet(_M_codecvt).always_noconv()) - { - if (_M_codecvt_tmp - && !__check_facet(_M_codecvt_tmp).always_noconv()) - __testvalid = this->seekoff(0, ios_base::cur, this->_M_mode) - != pos_type(off_type(-1)); - } - else - { - // External position corresponding to gptr(). - _M_ext_next = _M_ext_buf - + _M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next, - this->gptr() - this->eback()); - const streamsize __remainder = _M_ext_end - _M_ext_next; - if (__remainder) - std::memmove(_M_ext_buf, _M_ext_next, __remainder); - - _M_ext_next = _M_ext_buf; - _M_ext_end = _M_ext_buf + __remainder; - _M_set_buffer(-1); - _M_state_last = _M_state_cur = _M_state_beg; - } - } - else if (_M_writing && (__testvalid = _M_terminate_output())) - _M_set_buffer(-1); - } - } - - if (__testvalid) - _M_codecvt = _M_codecvt_tmp; - else - _M_codecvt = 0; - } - - // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. -#if _GLIBCXX_EXTERN_TEMPLATE - extern template class basic_filebuf<char>; - extern template class basic_ifstream<char>; - extern template class basic_ofstream<char>; - extern template class basic_fstream<char>; - -#ifdef _GLIBCXX_USE_WCHAR_T - extern template class basic_filebuf<wchar_t>; - extern template class basic_ifstream<wchar_t>; - extern template class basic_ofstream<wchar_t>; - extern template class basic_fstream<wchar_t>; -#endif -#endif -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/functexcept.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/functexcept.h deleted file mode 100644 index 8b1d16c8e59..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/functexcept.h +++ /dev/null @@ -1,85 +0,0 @@ -// Function-Based Exception Support -*- C++ -*- - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 19.1 Exception classes -// - -#include <exception_defines.h> - -namespace std -{ - // Helper for exception objects in <except> - void - __throw_bad_exception(void); - - // Helper for exception objects in <new> - void - __throw_bad_alloc(void); - - // Helper for exception objects in <typeinfo> - void - __throw_bad_cast(void); - - void - __throw_bad_typeid(void); - - // Helpers for exception objects in <stdexcept> - void - __throw_logic_error(const char* __s); - - void - __throw_domain_error(const char* __s); - - void - __throw_invalid_argument(const char* __s); - - void - __throw_length_error(const char* __s); - - void - __throw_out_of_range(const char* __s); - - void - __throw_runtime_error(const char* __s); - - void - __throw_range_error(const char* __s); - - void - __throw_overflow_error(const char* __s); - - void - __throw_underflow_error(const char* __s); - - // Helpers for exception objects in basic_ios - void - __throw_ios_failure(const char* __s); -} // namespace std - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/gslice.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/gslice.h deleted file mode 100644 index 78f8a67146b..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/gslice.h +++ /dev/null @@ -1,165 +0,0 @@ -// The template and inlines for the -*- C++ -*- gslice class. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr> - -/** @file gslice.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _GSLICE_H -#define _GSLICE_H 1 - -#pragma GCC system_header - -namespace std { - - /** - * @brief Class defining multi-dimensional subset of an array. - * - * The slice class represents a multi-dimensional subset of an array, - * specified by three parameter sets: start offset, size array, and stride - * array. The start offset is the index of the first element of the array - * that is part of the subset. The size and stride array describe each - * dimension of the slice. Size is the number of elements in that - * dimension, and stride is the distance in the array between successive - * elements in that dimension. Each dimension's size and stride is taken - * to begin at an array element described by the previous dimension. The - * size array and stride array must be the same size. - * - * For example, if you have offset==3, stride[0]==11, size[1]==3, - * stride[1]==3, then slice[0,0]==array[3], slice[0,1]==array[6], - * slice[0,2]==array[9], slice[1,0]==array[14], slice[1,1]==array[17], - * slice[1,2]==array[20]. - */ - class gslice - { - public: - /// Construct an empty slice. - gslice (); - - /** - * @brief Construct a slice. - * - * Constructs a slice with as many dimensions as the length of the @a l - * and @a s arrays. - * - * @param o Offset in array of first element. - * @param l Array of dimension lengths. - * @param s Array of dimension strides between array elements. - */ - gslice(size_t, const valarray<size_t>&, const valarray<size_t>&); - - // XXX: the IS says the copy-ctor and copy-assignment operators are - // synthetized by the compiler but they are just unsuitable - // for a ref-counted semantic - /// Copy constructor. - gslice(const gslice&); - - /// Destructor. - ~gslice(); - - // XXX: See the note above. - /// Assignment operator. - gslice& operator=(const gslice&); - - /// Return array offset of first slice element. - size_t start() const; - - /// Return array of sizes of slice dimensions. - valarray<size_t> size() const; - - /// Return array of array strides for each dimension. - valarray<size_t> stride() const; - - private: - struct _Indexer { - size_t _M_count; - size_t _M_start; - valarray<size_t> _M_size; - valarray<size_t> _M_stride; - valarray<size_t> _M_index; // Linear array of referenced indices - _Indexer(size_t, const valarray<size_t>&, - const valarray<size_t>&); - void _M_increment_use() { ++_M_count; } - size_t _M_decrement_use() { return --_M_count; } - }; - - _Indexer* _M_index; - - template<typename _Tp> friend class valarray; - }; - - inline size_t - gslice::start () const - { return _M_index ? _M_index->_M_start : 0; } - - inline valarray<size_t> - gslice::size () const - { return _M_index ? _M_index->_M_size : valarray<size_t>(); } - - inline valarray<size_t> - gslice::stride () const - { return _M_index ? _M_index->_M_stride : valarray<size_t>(); } - - inline gslice::gslice () : _M_index(0) {} - - inline - gslice::gslice(size_t __o, const valarray<size_t>& __l, - const valarray<size_t>& __s) - : _M_index(new gslice::_Indexer(__o, __l, __s)) {} - - inline - gslice::gslice(const gslice& __g) : _M_index(__g._M_index) - { if (_M_index) _M_index->_M_increment_use(); } - - inline - gslice::~gslice() - { if (_M_index && _M_index->_M_decrement_use() == 0) delete _M_index; } - - inline gslice& - gslice::operator= (const gslice& __g) - { - if (__g._M_index) __g._M_index->_M_increment_use(); - if (_M_index && _M_index->_M_decrement_use() == 0) delete _M_index; - _M_index = __g._M_index; - return *this; - } - - -} // std:: - - -#endif /* _GSLICE_H */ - -// Local Variables: -// mode:c++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/gslice_array.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/gslice_array.h deleted file mode 100644 index 7e2e6848e88..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/gslice_array.h +++ /dev/null @@ -1,220 +0,0 @@ -// The template and inlines for the -*- C++ -*- gslice_array class. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr> - -/** @file gslice_array.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _GSLICE_ARRAY_H -#define _GSLICE_ARRAY_H 1 - -#pragma GCC system_header - -namespace std { - - /** - * @brief Reference to multi-dimensional subset of an array. - * - * A gslice_array is a reference to the actual elements of an array - * specified by a gslice. The way to get a gslice_array is to call - * operator[](gslice) on a valarray. The returned gslice_array then - * permits carrying operations out on the referenced subset of elements in - * the original valarray. For example, operator+=(valarray) will add - * values to the subset of elements in the underlying valarray this - * gslice_array refers to. - * - * @param Tp Element type. - */ - template<typename _Tp> - class gslice_array - { - public: - typedef _Tp value_type; - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 253. valarray helper functions are almost entirely useless - - /// Copy constructor. Both slices refer to the same underlying array. - gslice_array(const gslice_array&); - - /// Assignment operator. Assigns slice elements to corresponding - /// elements of @a a. - gslice_array& operator=(const gslice_array&); - - /// Assign slice elements to corresponding elements of @a v. - void operator=(const valarray<_Tp>&) const; - /// Multiply slice elements by corresponding elements of @a v. - void operator*=(const valarray<_Tp>&) const; - /// Divide slice elements by corresponding elements of @a v. - void operator/=(const valarray<_Tp>&) const; - /// Modulo slice elements by corresponding elements of @a v. - void operator%=(const valarray<_Tp>&) const; - /// Add corresponding elements of @a v to slice elements. - void operator+=(const valarray<_Tp>&) const; - /// Subtract corresponding elements of @a v from slice elements. - void operator-=(const valarray<_Tp>&) const; - /// Logical xor slice elements with corresponding elements of @a v. - void operator^=(const valarray<_Tp>&) const; - /// Logical and slice elements with corresponding elements of @a v. - void operator&=(const valarray<_Tp>&) const; - /// Logical or slice elements with corresponding elements of @a v. - void operator|=(const valarray<_Tp>&) const; - /// Left shift slice elements by corresponding elements of @a v. - void operator<<=(const valarray<_Tp>&) const; - /// Right shift slice elements by corresponding elements of @a v. - void operator>>=(const valarray<_Tp>&) const; - /// Assign all slice elements to @a t. - void operator=(const _Tp&) const; - - template<class _Dom> - void operator=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator*=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator/=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator%=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator+=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator-=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator^=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator&=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator|=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator<<=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator>>=(const _Expr<_Dom,_Tp>&) const; - - private: - _Array<_Tp> _M_array; - const valarray<size_t>& _M_index; - - friend class valarray<_Tp>; - - gslice_array(_Array<_Tp>, const valarray<size_t>&); - - // not implemented - gslice_array(); - }; - - template<typename _Tp> - inline - gslice_array<_Tp>::gslice_array(_Array<_Tp> __a, - const valarray<size_t>& __i) - : _M_array(__a), _M_index(__i) {} - - - template<typename _Tp> - inline - gslice_array<_Tp>::gslice_array(const gslice_array<_Tp>& __a) - : _M_array(__a._M_array), _M_index(__a._M_index) {} - - - template<typename _Tp> - inline gslice_array<_Tp>& - gslice_array<_Tp>::operator=(const gslice_array<_Tp>& __a) - { - std::__valarray_copy(_Array<_Tp>(__a._M_array), - _Array<size_t>(__a._M_index), _M_index.size(), - _M_array, _Array<size_t>(_M_index)); - return *this; - } - - template<typename _Tp> - inline void - gslice_array<_Tp>::operator=(const _Tp& __t) const - { - std::__valarray_fill(_M_array, _Array<size_t>(_M_index), - _M_index.size(), __t); - } - - template<typename _Tp> - inline void - gslice_array<_Tp>::operator=(const valarray<_Tp>& __v) const - { - std::__valarray_copy(_Array<_Tp>(__v), __v.size(), - _M_array, _Array<size_t>(_M_index)); - } - - template<typename _Tp> - template<class _Dom> - inline void - gslice_array<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e) const - { - std::__valarray_copy (__e, _M_index.size(), _M_array, - _Array<size_t>(_M_index)); - } - -#undef _DEFINE_VALARRAY_OPERATOR -#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name) \ - template<typename _Tp> \ - inline void \ - gslice_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const \ - { \ - _Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index), \ - _Array<_Tp>(__v), __v.size()); \ - } \ - \ - template<typename _Tp> \ - template<class _Dom> \ - inline void \ - gslice_array<_Tp>::operator _Op##= (const _Expr<_Dom, _Tp>& __e) const\ - { \ - _Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index), __e,\ - _M_index.size()); \ - } - -_DEFINE_VALARRAY_OPERATOR(*, __multiplies) -_DEFINE_VALARRAY_OPERATOR(/, __divides) -_DEFINE_VALARRAY_OPERATOR(%, __modulus) -_DEFINE_VALARRAY_OPERATOR(+, __plus) -_DEFINE_VALARRAY_OPERATOR(-, __minus) -_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor) -_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and) -_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or) -_DEFINE_VALARRAY_OPERATOR(<<, __shift_left) -_DEFINE_VALARRAY_OPERATOR(>>, __shift_right) - -#undef _DEFINE_VALARRAY_OPERATOR - -} // std:: - -#endif /* _GSLICE_ARRAY_H */ - -// Local Variables: -// mode:c++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/indirect_array.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/indirect_array.h deleted file mode 100644 index 912f522450d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/indirect_array.h +++ /dev/null @@ -1,212 +0,0 @@ -// The template and inlines for the -*- C++ -*- indirect_array class. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr> - -/** @file indirect_array.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _INDIRECT_ARRAY_H -#define _INDIRECT_ARRAY_H 1 - -#pragma GCC system_header - -namespace std -{ - /** - * @brief Reference to arbitrary subset of an array. - * - * An indirect_array is a reference to the actual elements of an array - * specified by an ordered array of indices. The way to get an indirect_array is to - * call operator[](valarray<size_t>) on a valarray. The returned - * indirect_array then permits carrying operations out on the referenced - * subset of elements in the original valarray. - * - * For example, if an indirect_array is obtained using the array (4,2,0) as - * an argument, and then assigned to an array containing (1,2,3), then the - * underlying array will have array[0]==3, array[2]==2, and array[4]==1. - * - * @param Tp Element type. - */ - template <class _Tp> - class indirect_array - { - public: - typedef _Tp value_type; - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 253. valarray helper functions are almost entirely useless - - /// Copy constructor. Both slices refer to the same underlying array. - indirect_array(const indirect_array&); - - /// Assignment operator. Assigns elements to corresponding elements - /// of @a a. - indirect_array& operator=(const indirect_array&); - - /// Assign slice elements to corresponding elements of @a v. - void operator=(const valarray<_Tp>&) const; - /// Multiply slice elements by corresponding elements of @a v. - void operator*=(const valarray<_Tp>&) const; - /// Divide slice elements by corresponding elements of @a v. - void operator/=(const valarray<_Tp>&) const; - /// Modulo slice elements by corresponding elements of @a v. - void operator%=(const valarray<_Tp>&) const; - /// Add corresponding elements of @a v to slice elements. - void operator+=(const valarray<_Tp>&) const; - /// Subtract corresponding elements of @a v from slice elements. - void operator-=(const valarray<_Tp>&) const; - /// Logical xor slice elements with corresponding elements of @a v. - void operator^=(const valarray<_Tp>&) const; - /// Logical and slice elements with corresponding elements of @a v. - void operator&=(const valarray<_Tp>&) const; - /// Logical or slice elements with corresponding elements of @a v. - void operator|=(const valarray<_Tp>&) const; - /// Left shift slice elements by corresponding elements of @a v. - void operator<<=(const valarray<_Tp>&) const; - /// Right shift slice elements by corresponding elements of @a v. - void operator>>=(const valarray<_Tp>&) const; - /// Assign all slice elements to @a t. - void operator= (const _Tp&) const; - // ~indirect_array(); - - template<class _Dom> - void operator=(const _Expr<_Dom, _Tp>&) const; - template<class _Dom> - void operator*=(const _Expr<_Dom, _Tp>&) const; - template<class _Dom> - void operator/=(const _Expr<_Dom, _Tp>&) const; - template<class _Dom> - void operator%=(const _Expr<_Dom, _Tp>&) const; - template<class _Dom> - void operator+=(const _Expr<_Dom, _Tp>&) const; - template<class _Dom> - void operator-=(const _Expr<_Dom, _Tp>&) const; - template<class _Dom> - void operator^=(const _Expr<_Dom, _Tp>&) const; - template<class _Dom> - void operator&=(const _Expr<_Dom, _Tp>&) const; - template<class _Dom> - void operator|=(const _Expr<_Dom, _Tp>&) const; - template<class _Dom> - void operator<<=(const _Expr<_Dom, _Tp>&) const; - template<class _Dom> - void operator>>=(const _Expr<_Dom, _Tp>&) const; - - private: - /// Copy constructor. Both slices refer to the same underlying array. - indirect_array(_Array<_Tp>, size_t, _Array<size_t>); - - friend class valarray<_Tp>; - friend class gslice_array<_Tp>; - - const size_t _M_sz; - const _Array<size_t> _M_index; - const _Array<_Tp> _M_array; - - // not implemented - indirect_array(); - }; - - template<typename _Tp> - inline - indirect_array<_Tp>::indirect_array(const indirect_array<_Tp>& __a) - : _M_sz(__a._M_sz), _M_index(__a._M_index), _M_array(__a._M_array) {} - - template<typename _Tp> - inline - indirect_array<_Tp>::indirect_array(_Array<_Tp> __a, size_t __s, - _Array<size_t> __i) - : _M_sz(__s), _M_index(__i), _M_array(__a) {} - - template<typename _Tp> - inline indirect_array<_Tp>& - indirect_array<_Tp>::operator=(const indirect_array<_Tp>& __a) - { - std::__valarray_copy(__a._M_array, _M_sz, __a._M_index, _M_array, _M_index); - return *this; - } - - - template<typename _Tp> - inline void - indirect_array<_Tp>::operator=(const _Tp& __t) const - { std::__valarray_fill(_M_array, _M_index, _M_sz, __t); } - - template<typename _Tp> - inline void - indirect_array<_Tp>::operator=(const valarray<_Tp>& __v) const - { std::__valarray_copy(_Array<_Tp>(__v), _M_sz, _M_array, _M_index); } - - template<typename _Tp> - template<class _Dom> - inline void - indirect_array<_Tp>::operator=(const _Expr<_Dom,_Tp>& __e) const - { std::__valarray_copy(__e, _M_sz, _M_array, _M_index); } - -#undef _DEFINE_VALARRAY_OPERATOR -#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name) \ - template<typename _Tp> \ - inline void \ - indirect_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const\ - { \ - _Array_augmented_##_Name(_M_array, _M_index, _Array<_Tp>(__v), _M_sz); \ - } \ - \ - template<typename _Tp> \ - template<class _Dom> \ - inline void \ - indirect_array<_Tp>::operator _Op##=(const _Expr<_Dom,_Tp>& __e) const\ - { \ - _Array_augmented_##_Name(_M_array, _M_index, __e, _M_sz); \ - } - -_DEFINE_VALARRAY_OPERATOR(*, __multiplies) -_DEFINE_VALARRAY_OPERATOR(/, __divides) -_DEFINE_VALARRAY_OPERATOR(%, __modulus) -_DEFINE_VALARRAY_OPERATOR(+, __plus) -_DEFINE_VALARRAY_OPERATOR(-, __minus) -_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor) -_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and) -_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or) -_DEFINE_VALARRAY_OPERATOR(<<, __shift_left) -_DEFINE_VALARRAY_OPERATOR(>>, __shift_right) - -#undef _DEFINE_VALARRAY_OPERATOR - -} // std:: - -#endif /* _INDIRECT_ARRAY_H */ - -// Local Variables: -// mode:c++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ios_base.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ios_base.h deleted file mode 100644 index 08c952d6ba5..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ios_base.h +++ /dev/null @@ -1,969 +0,0 @@ -// Iostreams base classes -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.4 Iostreams base classes -// - -/** @file ios_base.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _IOS_BASE_H -#define _IOS_BASE_H 1 - -#pragma GCC system_header - -#include <bits/atomicity.h> -#include <bits/localefwd.h> -#include <bits/locale_classes.h> - -namespace std -{ - // The following definitions of bitmask types are enums, not ints, - // as permitted (but not required) in the standard, in order to provide - // better type safety in iostream calls. A side effect is that - // expressions involving them are no longer compile-time constants. - enum _Ios_Fmtflags - { - _S_boolalpha = 1L << 0, - _S_dec = 1L << 1, - _S_fixed = 1L << 2, - _S_hex = 1L << 3, - _S_internal = 1L << 4, - _S_left = 1L << 5, - _S_oct = 1L << 6, - _S_right = 1L << 7, - _S_scientific = 1L << 8, - _S_showbase = 1L << 9, - _S_showpoint = 1L << 10, - _S_showpos = 1L << 11, - _S_skipws = 1L << 12, - _S_unitbuf = 1L << 13, - _S_uppercase = 1L << 14, - _S_adjustfield = _S_left | _S_right | _S_internal, - _S_basefield = _S_dec | _S_oct | _S_hex, - _S_floatfield = _S_scientific | _S_fixed, - _S_ios_fmtflags_end = 1L << 16 - }; - - inline _Ios_Fmtflags - operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) - { return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); } - - inline _Ios_Fmtflags - operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b) - { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); } - - inline _Ios_Fmtflags - operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) - { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); } - - inline _Ios_Fmtflags& - operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) - { return __a = __a | __b; } - - inline _Ios_Fmtflags& - operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) - { return __a = __a & __b; } - - inline _Ios_Fmtflags& - operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) - { return __a = __a ^ __b; } - - inline _Ios_Fmtflags - operator~(_Ios_Fmtflags __a) - { return _Ios_Fmtflags(~static_cast<int>(__a)); } - - - enum _Ios_Openmode - { - _S_app = 1L << 0, - _S_ate = 1L << 1, - _S_bin = 1L << 2, - _S_in = 1L << 3, - _S_out = 1L << 4, - _S_trunc = 1L << 5, - _S_ios_openmode_end = 1L << 16 - }; - - inline _Ios_Openmode - operator&(_Ios_Openmode __a, _Ios_Openmode __b) - { return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); } - - inline _Ios_Openmode - operator|(_Ios_Openmode __a, _Ios_Openmode __b) - { return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); } - - inline _Ios_Openmode - operator^(_Ios_Openmode __a, _Ios_Openmode __b) - { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); } - - inline _Ios_Openmode& - operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) - { return __a = __a | __b; } - - inline _Ios_Openmode& - operator&=(_Ios_Openmode& __a, _Ios_Openmode __b) - { return __a = __a & __b; } - - inline _Ios_Openmode& - operator^=(_Ios_Openmode& __a, _Ios_Openmode __b) - { return __a = __a ^ __b; } - - inline _Ios_Openmode - operator~(_Ios_Openmode __a) - { return _Ios_Openmode(~static_cast<int>(__a)); } - - - enum _Ios_Iostate - { - _S_goodbit = 0, - _S_badbit = 1L << 0, - _S_eofbit = 1L << 1, - _S_failbit = 1L << 2, - _S_ios_iostate_end = 1L << 16 - }; - - inline _Ios_Iostate - operator&(_Ios_Iostate __a, _Ios_Iostate __b) - { return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); } - - inline _Ios_Iostate - operator|(_Ios_Iostate __a, _Ios_Iostate __b) - { return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); } - - inline _Ios_Iostate - operator^(_Ios_Iostate __a, _Ios_Iostate __b) - { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); } - - inline _Ios_Iostate& - operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) - { return __a = __a | __b; } - - inline _Ios_Iostate& - operator&=(_Ios_Iostate& __a, _Ios_Iostate __b) - { return __a = __a & __b; } - - inline _Ios_Iostate& - operator^=(_Ios_Iostate& __a, _Ios_Iostate __b) - { return __a = __a ^ __b; } - - inline _Ios_Iostate - operator~(_Ios_Iostate __a) - { return _Ios_Iostate(~static_cast<int>(__a)); } - - enum _Ios_Seekdir - { - _S_beg = 0, - _S_cur = SEEK_CUR, - _S_end = SEEK_END, - _S_ios_seekdir_end = 1L << 16 - }; - - // 27.4.2 Class ios_base - /** - * @brief The very top of the I/O class hierarchy. - * - * This class defines everything that can be defined about I/O that does - * not depend on the type of characters being input or output. Most - * people will only see @c ios_base when they need to specify the full - * name of the various I/O flags (e.g., the openmodes). - */ - class ios_base - { - public: - - // 27.4.2.1.1 Class ios_base::failure - /// These are thrown to indicate problems. Doc me. - class failure : public exception - { - public: - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 48. Use of non-existent exception constructor - explicit - failure(const string& __str) throw(); - - // This declaration is not useless: - // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - virtual - ~failure() throw(); - - virtual const char* - what() const throw(); - - private: - string _M_msg; - }; - - // 27.4.2.1.2 Type ios_base::fmtflags - /** - * @brief This is a bitmask type. - * - * @c "_Ios_Fmtflags" is implementation-defined, but it is valid to - * perform bitwise operations on these values and expect the Right - * Thing to happen. Defined objects of type fmtflags are: - * - boolalpha - * - dec - * - fixed - * - hex - * - internal - * - left - * - oct - * - right - * - scientific - * - showbase - * - showpoint - * - showpos - * - skipws - * - unitbuf - * - uppercase - * - adjustfield - * - basefield - * - floatfield - */ - typedef _Ios_Fmtflags fmtflags; - - /// Insert/extract @c bool in alphabetic rather than numeric format. - static const fmtflags boolalpha = fmtflags(__ios_flags::_S_boolalpha); - - /// Converts integer input or generates integer output in decimal base. - static const fmtflags dec = fmtflags(__ios_flags::_S_dec); - - /// Generate floating-point output in fixed-point notation. - static const fmtflags fixed = fmtflags(__ios_flags::_S_fixed); - - /// Converts integer input or generates integer output in hexadecimal base. - static const fmtflags hex = fmtflags(__ios_flags::_S_hex); - - /// Adds fill characters at a designated internal point in certain - /// generated output, or identical to @c right if no such point is - /// designated. - static const fmtflags internal = fmtflags(__ios_flags::_S_internal); - - /// Adds fill characters on the right (final positions) of certain - /// generated output. (I.e., the thing you print is flush left.) - static const fmtflags left = fmtflags(__ios_flags::_S_left); - - /// Converts integer input or generates integer output in octal base. - static const fmtflags oct = fmtflags(__ios_flags::_S_oct); - - /// Adds fill characters on the left (initial positions) of certain - /// generated output. (I.e., the thing you print is flush right.) - static const fmtflags right = fmtflags(__ios_flags::_S_right); - - /// Generates floating-point output in scientific notation. - static const fmtflags scientific = fmtflags(__ios_flags::_S_scientific); - - /// Generates a prefix indicating the numeric base of generated integer - /// output. - static const fmtflags showbase = fmtflags(__ios_flags::_S_showbase); - - /// Generates a decimal-point character unconditionally in generated - /// floating-point output. - static const fmtflags showpoint = fmtflags(__ios_flags::_S_showpoint); - - /// Generates a + sign in non-negative generated numeric output. - static const fmtflags showpos = fmtflags(__ios_flags::_S_showpos); - - /// Skips leading white space before certain input operations. - static const fmtflags skipws = fmtflags(__ios_flags::_S_skipws); - - /// Flushes output after each output operation. - static const fmtflags unitbuf = fmtflags(__ios_flags::_S_unitbuf); - - /// Replaces certain lowercase letters with their uppercase equivalents - /// in generated output. - static const fmtflags uppercase = fmtflags(__ios_flags::_S_uppercase); - - /// A mask of left|right|internal. Useful for the 2-arg form of @c setf. - static const fmtflags adjustfield = fmtflags(__ios_flags::_S_adjustfield); - - /// A mask of dec|oct|hex. Useful for the 2-arg form of @c setf. - static const fmtflags basefield = fmtflags(__ios_flags::_S_basefield); - - /// A mask of scientific|fixed. Useful for the 2-arg form of @c setf. - static const fmtflags floatfield = fmtflags(__ios_flags::_S_floatfield); - - // 27.4.2.1.3 Type ios_base::iostate - /** - * @brief This is a bitmask type. - * - * @c "_Ios_Iostate" is implementation-defined, but it is valid to - * perform bitwise operations on these values and expect the Right - * Thing to happen. Defined objects of type iostate are: - * - badbit - * - eofbit - * - failbit - * - goodbit - */ - typedef _Ios_Iostate iostate; - - /// Indicates a loss of integrity in an input or output sequence (such - /// as an irrecoverable read error from a file). - static const iostate badbit = iostate(__ios_flags::_S_badbit); - - /// Indicates that an input operation reached the end of an input sequence. - static const iostate eofbit = iostate(__ios_flags::_S_eofbit); - - /// Indicates that an input operation failed to read the expected - /// characters, or that an output operation failed to generate the - /// desired characters. - static const iostate failbit = iostate(__ios_flags::_S_failbit); - - /// Indicates all is well. - static const iostate goodbit = iostate(0); - - // 27.4.2.1.4 Type ios_base::openmode - /** - * @brief This is a bitmask type. - * - * @c "_Ios_Openmode" is implementation-defined, but it is valid to - * perform bitwise operations on these values and expect the Right - * Thing to happen. Defined objects of type openmode are: - * - app - * - ate - * - binary - * - in - * - out - * - trunc - */ - typedef _Ios_Openmode openmode; - - /// Seek to end before each write. - static const openmode app = openmode(__ios_flags::_S_app); - - /// Open and seek to end immediately after opening. - static const openmode ate = openmode(__ios_flags::_S_ate); - - /// Perform input and output in binary mode (as opposed to text mode). - /// This is probably not what you think it is; see - /// http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#3 and - /// http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#7 for more. - static const openmode binary = openmode(__ios_flags::_S_bin); - - /// Open for input. Default for @c ifstream and fstream. - static const openmode in = openmode(__ios_flags::_S_in); - - /// Open for output. Default for @c ofstream and fstream. - static const openmode out = openmode(__ios_flags::_S_out); - - /// Open for input. Default for @c ofstream. - static const openmode trunc = openmode(__ios_flags::_S_trunc); - - // 27.4.2.1.5 Type ios_base::seekdir - /** - * @brief This is an enumerated type. - * - * @c "_Ios_Seekdir" is implementation-defined. Defined values - * of type seekdir are: - * - beg - * - cur, equivalent to @c SEEK_CUR in the C standard library. - * - end, equivalent to @c SEEK_END in the C standard library. - */ - typedef _Ios_Seekdir seekdir; - - /// Request a seek relative to the beginning of the stream. - static const seekdir beg = seekdir(0); - - /// Request a seek relative to the current position within the sequence. - static const seekdir cur = seekdir(SEEK_CUR); - - /// Request a seek relative to the current end of the sequence. - static const seekdir end = seekdir(SEEK_END); - -#ifdef _GLIBCXX_DEPRECATED - // Annex D.6 - typedef int io_state; - typedef int open_mode; - typedef int seek_dir; - - typedef std::streampos streampos; - typedef std::streamoff streamoff; -#endif - - // Callbacks; - /** - * @brief The set of events that may be passed to an event callback. - * - * erase_event is used during ~ios() and copyfmt(). imbue_event is used - * during imbue(). copyfmt_event is used during copyfmt(). - */ - enum event - { - erase_event, - imbue_event, - copyfmt_event - }; - - /** - * @brief The type of an event callback function. - * @param event One of the members of the event enum. - * @param ios_base Reference to the ios_base object. - * @param int The integer provided when the callback was registered. - * - * Event callbacks are user defined functions that get called during - * several ios_base and basic_ios functions, specifically imbue(), - * copyfmt(), and ~ios(). - */ - typedef void (*event_callback) (event, ios_base&, int); - - /** - * @brief Add the callback __fn with parameter __index. - * @param __fn The function to add. - * @param __index The integer to pass to the function when invoked. - * - * Registers a function as an event callback with an integer parameter to - * be passed to the function when invoked. Multiple copies of the - * function are allowed. If there are multiple callbacks, they are - * invoked in the order they were registered. - */ - void - register_callback(event_callback __fn, int __index); - - protected: - //@{ - /** - * @if maint - * ios_base data members (doc me) - * @endif - */ - streamsize _M_precision; - streamsize _M_width; - fmtflags _M_flags; - iostate _M_exception; - iostate _M_streambuf_state; - //@} - - // 27.4.2.6 Members for callbacks - // 27.4.2.6 ios_base callbacks - struct _Callback_list - { - // Data Members - _Callback_list* _M_next; - ios_base::event_callback _M_fn; - int _M_index; - _Atomic_word _M_refcount; // 0 means one reference. - - _Callback_list(ios_base::event_callback __fn, int __index, - _Callback_list* __cb) - : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { } - - void - _M_add_reference() { __gnu_cxx::__atomic_add(&_M_refcount, 1); } - - // 0 => OK to delete. - int - _M_remove_reference() - { return __gnu_cxx::__exchange_and_add(&_M_refcount, -1); } - }; - - _Callback_list* _M_callbacks; - - void - _M_call_callbacks(event __ev) throw(); - - void - _M_dispose_callbacks(void); - - // 27.4.2.5 Members for iword/pword storage - struct _Words - { - void* _M_pword; - long _M_iword; - _Words() : _M_pword(0), _M_iword(0) { } - }; - - // Only for failed iword/pword calls. - _Words _M_word_zero; - - // Guaranteed storage. - // The first 5 iword and pword slots are reserved for internal use. - static const int _S_local_word_size = 8; - _Words _M_local_word[_S_local_word_size]; - - // Allocated storage. - int _M_word_size; - _Words* _M_word; - - _Words& - _M_grow_words(int __index, bool __iword); - - // Members for locale and locale caching. - locale _M_ios_locale; - - void - _M_init(); - - public: - - // 27.4.2.1.6 Class ios_base::Init - // Used to initialize standard streams. In theory, g++ could use - // -finit-priority to order this stuff correctly without going - // through these machinations. - class Init - { - friend class ios_base; - public: - Init(); - ~Init(); - - private: - static _Atomic_word _S_refcount; - static bool _S_synced_with_stdio; - }; - - // [27.4.2.2] fmtflags state functions - /** - * @brief Access to format flags. - * @return The format control flags for both input and output. - */ - inline fmtflags - flags() const { return _M_flags; } - - /** - * @brief Setting new format flags all at once. - * @param fmtfl The new flags to set. - * @return The previous format control flags. - * - * This function overwrites all the format flags with @a fmtfl. - */ - inline fmtflags - flags(fmtflags __fmtfl) - { - fmtflags __old = _M_flags; - _M_flags = __fmtfl; - return __old; - } - - /** - * @brief Setting new format flags. - * @param fmtfl Additional flags to set. - * @return The previous format control flags. - * - * This function sets additional flags in format control. Flags that - * were previously set remain set. - */ - inline fmtflags - setf(fmtflags __fmtfl) - { - fmtflags __old = _M_flags; - _M_flags |= __fmtfl; - return __old; - } - - /** - * @brief Setting new format flags. - * @param fmtfl Additional flags to set. - * @param mask The flags mask for @a fmtfl. - * @return The previous format control flags. - * - * This function clears @a mask in the format flags, then sets - * @a fmtfl @c & @a mask. An example mask is @c ios_base::adjustfield. - */ - inline fmtflags - setf(fmtflags __fmtfl, fmtflags __mask) - { - fmtflags __old = _M_flags; - _M_flags &= ~__mask; - _M_flags |= (__fmtfl & __mask); - return __old; - } - - /** - * @brief Clearing format flags. - * @param mask The flags to unset. - * - * This function clears @a mask in the format flags. - */ - inline void - unsetf(fmtflags __mask) { _M_flags &= ~__mask; } - - /** - * @brief Flags access. - * @return The precision to generate on certain output operations. - * - * @if maint - * Be careful if you try to give a definition of "precision" here; see - * DR 189. - * @endif - */ - inline streamsize - precision() const { return _M_precision; } - - /** - * @brief Changing flags. - * @param prec The new precision value. - * @return The previous value of precision(). - */ - inline streamsize - precision(streamsize __prec) - { - streamsize __old = _M_precision; - _M_precision = __prec; - return __old; - } - - /** - * @brief Flags access. - * @return The minimum field width to generate on output operations. - * - * "Minimum field width" refers to the number of characters. - */ - inline streamsize - width() const { return _M_width; } - - /** - * @brief Changing flags. - * @param wide The new width value. - * @return The previous value of width(). - */ - inline streamsize - width(streamsize __wide) - { - streamsize __old = _M_width; - _M_width = __wide; - return __old; - } - - // [27.4.2.4] ios_base static members - /** - * @brief Interaction with the standard C I/O objects. - * @param sync Whether to synchronize or not. - * @return True if the standard streams were previously synchronized. - * - * The synchronization referred to is @e only that between the standard - * C facilities (e.g., stdout) and the standard C++ objects (e.g., - * cout). User-declared streams are unaffected. See - * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#8 for more. - */ - static bool - sync_with_stdio(bool __sync = true); - - // [27.4.2.3] ios_base locale functions - /** - * @brief Setting a new locale. - * @param loc The new locale. - * @return The previous locale. - * - * Sets the new locale for this stream, and then invokes each callback - * with imbue_event. - */ - locale - imbue(const locale& __loc); - - /** - * @brief Locale access - * @return A copy of the current locale. - * - * If @c imbue(loc) has previously been called, then this function - * returns @c loc. Otherwise, it returns a copy of @c std::locale(), - * the global C++ locale. - */ - inline locale - getloc() const { return _M_ios_locale; } - - /** - * @brief Locale access - * @return A reference to the current locale. - * - * Like getloc above, but returns a reference instead of - * generating a copy. - */ - inline const locale& - _M_getloc() const { return _M_ios_locale; } - - // [27.4.2.5] ios_base storage functions - /** - * @brief Access to unique indices. - * @return An integer different from all previous calls. - * - * This function returns a unique integer every time it is called. It - * can be used for any purpose, but is primarily intended to be a unique - * index for the iword and pword functions. The expectation is that an - * application calls xalloc in order to obtain an index in the iword and - * pword arrays that can be used without fear of conflict. - * - * The implementation maintains a static variable that is incremented and - * returned on each invocation. xalloc is guaranteed to return an index - * that is safe to use in the iword and pword arrays. - */ - static int - xalloc() throw(); - - /** - * @brief Access to integer array. - * @param __ix Index into the array. - * @return A reference to an integer associated with the index. - * - * The iword function provides access to an array of integers that can be - * used for any purpose. The array grows as required to hold the - * supplied index. All integers in the array are initialized to 0. - * - * The implementation reserves several indices. You should use xalloc to - * obtain an index that is safe to use. Also note that since the array - * can grow dynamically, it is not safe to hold onto the reference. - */ - inline long& - iword(int __ix) - { - _Words& __word = (__ix < _M_word_size) - ? _M_word[__ix] : _M_grow_words(__ix, true); - return __word._M_iword; - } - - /** - * @brief Access to void pointer array. - * @param __ix Index into the array. - * @return A reference to a void* associated with the index. - * - * The pword function provides access to an array of pointers that can be - * used for any purpose. The array grows as required to hold the - * supplied index. All pointers in the array are initialized to 0. - * - * The implementation reserves several indices. You should use xalloc to - * obtain an index that is safe to use. Also note that since the array - * can grow dynamically, it is not safe to hold onto the reference. - */ - inline void*& - pword(int __ix) - { - _Words& __word = (__ix < _M_word_size) - ? _M_word[__ix] : _M_grow_words(__ix, false); - return __word._M_pword; - } - - // Destructor - /** - * Invokes each callback with erase_event. Destroys local storage. - * - * Note that the ios_base object for the standard streams never gets - * destroyed. As a result, any callbacks registered with the standard - * streams will not get invoked with erase_event (unless copyfmt is - * used). - */ - virtual ~ios_base(); - - protected: - ios_base(); - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 50. Copy constructor and assignment operator of ios_base - private: - ios_base(const ios_base&); - - ios_base& - operator=(const ios_base&); - }; - - // [27.4.5.1] fmtflags manipulators - /// Calls base.setf(ios_base::boolalpha). - inline ios_base& - boolalpha(ios_base& __base) - { - __base.setf(ios_base::boolalpha); - return __base; - } - - /// Calls base.unsetf(ios_base::boolalpha). - inline ios_base& - noboolalpha(ios_base& __base) - { - __base.unsetf(ios_base::boolalpha); - return __base; - } - - /// Calls base.setf(ios_base::showbase). - inline ios_base& - showbase(ios_base& __base) - { - __base.setf(ios_base::showbase); - return __base; - } - - /// Calls base.unsetf(ios_base::showbase). - inline ios_base& - noshowbase(ios_base& __base) - { - __base.unsetf(ios_base::showbase); - return __base; - } - - /// Calls base.setf(ios_base::showpoint). - inline ios_base& - showpoint(ios_base& __base) - { - __base.setf(ios_base::showpoint); - return __base; - } - - /// Calls base.unsetf(ios_base::showpoint). - inline ios_base& - noshowpoint(ios_base& __base) - { - __base.unsetf(ios_base::showpoint); - return __base; - } - - /// Calls base.setf(ios_base::showpos). - inline ios_base& - showpos(ios_base& __base) - { - __base.setf(ios_base::showpos); - return __base; - } - - /// Calls base.unsetf(ios_base::showpos). - inline ios_base& - noshowpos(ios_base& __base) - { - __base.unsetf(ios_base::showpos); - return __base; - } - - /// Calls base.setf(ios_base::skipws). - inline ios_base& - skipws(ios_base& __base) - { - __base.setf(ios_base::skipws); - return __base; - } - - /// Calls base.unsetf(ios_base::skipws). - inline ios_base& - noskipws(ios_base& __base) - { - __base.unsetf(ios_base::skipws); - return __base; - } - - /// Calls base.setf(ios_base::uppercase). - inline ios_base& - uppercase(ios_base& __base) - { - __base.setf(ios_base::uppercase); - return __base; - } - - /// Calls base.unsetf(ios_base::uppercase). - inline ios_base& - nouppercase(ios_base& __base) - { - __base.unsetf(ios_base::uppercase); - return __base; - } - - /// Calls base.setf(ios_base::unitbuf). - inline ios_base& - unitbuf(ios_base& __base) - { - __base.setf(ios_base::unitbuf); - return __base; - } - - /// Calls base.unsetf(ios_base::unitbuf). - inline ios_base& - nounitbuf(ios_base& __base) - { - __base.unsetf(ios_base::unitbuf); - return __base; - } - - // [27.4.5.2] adjustfield anipulators - /// Calls base.setf(ios_base::internal, ios_base::adjustfield). - inline ios_base& - internal(ios_base& __base) - { - __base.setf(ios_base::internal, ios_base::adjustfield); - return __base; - } - - /// Calls base.setf(ios_base::left, ios_base::adjustfield). - inline ios_base& - left(ios_base& __base) - { - __base.setf(ios_base::left, ios_base::adjustfield); - return __base; - } - - /// Calls base.setf(ios_base::right, ios_base::adjustfield). - inline ios_base& - right(ios_base& __base) - { - __base.setf(ios_base::right, ios_base::adjustfield); - return __base; - } - - // [27.4.5.3] basefield anipulators - /// Calls base.setf(ios_base::dec, ios_base::basefield). - inline ios_base& - dec(ios_base& __base) - { - __base.setf(ios_base::dec, ios_base::basefield); - return __base; - } - - /// Calls base.setf(ios_base::hex, ios_base::basefield). - inline ios_base& - hex(ios_base& __base) - { - __base.setf(ios_base::hex, ios_base::basefield); - return __base; - } - - /// Calls base.setf(ios_base::oct, ios_base::basefield). - inline ios_base& - oct(ios_base& __base) - { - __base.setf(ios_base::oct, ios_base::basefield); - return __base; - } - - // [27.4.5.4] floatfield anipulators - /// Calls base.setf(ios_base::fixed, ios_base::floatfield). - inline ios_base& - fixed(ios_base& __base) - { - __base.setf(ios_base::fixed, ios_base::floatfield); - return __base; - } - - /// Calls base.setf(ios_base::scientific, ios_base::floatfield). - inline ios_base& - scientific(ios_base& __base) - { - __base.setf(ios_base::scientific, ios_base::floatfield); - return __base; - } -} // namespace std - -#endif /* _IOS_BASE_H */ - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/istream.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/istream.tcc deleted file mode 100644 index 9decce32d24..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/istream.tcc +++ /dev/null @@ -1,1192 +0,0 @@ -// istream classes -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.6.1 Input streams -// - -#ifndef _ISTREAM_TCC -#define _ISTREAM_TCC 1 - -#pragma GCC system_header - -#include <locale> -#include <ostream> // For flush() - -namespace std -{ - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>::sentry:: - sentry(basic_istream<_CharT, _Traits>& __in, bool __noskip) : _M_ok(false) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - if (__in.good()) - { - if (__in.tie()) - __in.tie()->flush(); - if (!__noskip && (__in.flags() & ios_base::skipws)) - { - const __int_type __eof = traits_type::eof(); - __streambuf_type* __sb = __in.rdbuf(); - __int_type __c = __sb->sgetc(); - - const __ctype_type& __ct = __check_facet(__in._M_ctype); - while (!traits_type::eq_int_type(__c, __eof) - && __ct.is(ctype_base::space, - traits_type::to_char_type(__c))) - __c = __sb->snextc(); - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 195. Should basic_istream::sentry's constructor ever - // set eofbit? - if (traits_type::eq_int_type(__c, __eof)) - __err |= ios_base::eofbit; - } - } - - if (__in.good() && __err == ios_base::goodbit) - _M_ok = true; - else - { - __err |= ios_base::failbit; - __in.setstate(__err); - } - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(__istream_type& (*__pf)(__istream_type&)) - { return __pf(*this); } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(__ios_type& (*__pf)(__ios_type&)) - { - __pf(*this); - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(ios_base& (*__pf)(ios_base&)) - { - __pf(*this); - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(bool& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __n); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(short& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - long __l; - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __l); - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 118. basic_istream uses nonexistent num_get member functions. - if (!(__err & ios_base::failbit) - && (numeric_limits<short>::min() <= __l - && __l <= numeric_limits<short>::max())) - __n = __l; - else - __err |= ios_base::failbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(unsigned short& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __n); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(int& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - long __l; - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __l); - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 118. basic_istream uses nonexistent num_get member functions. - if (!(__err & ios_base::failbit) - && (numeric_limits<int>::min() <= __l - && __l <= numeric_limits<int>::max())) - __n = __l; - else - __err |= ios_base::failbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(unsigned int& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __n); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(long& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __n); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(unsigned long& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __n); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - -#ifdef _GLIBCXX_USE_LONG_LONG - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(long long& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __n); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(unsigned long long& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __n); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } -#endif - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(float& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __n); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(double& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __n); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(long double& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __n); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(void*& __n) - { - sentry __cerb(*this, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_get_type& __ng = __check_facet(this->_M_num_get); - __ng.get(*this, 0, *this, __err, __n); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - operator>>(__streambuf_type* __sbout) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - sentry __cerb(*this, false); - if (__cerb && __sbout) - { - try - { - if (!__copy_streambufs(this->rdbuf(), __sbout)) - __err |= ios_base::failbit; - } - catch(...) - { this->_M_setstate(ios_base::failbit); } - } - else if (!__sbout) - __err |= ios_base::failbit; - if (__err) - this->setstate(__err); - return *this; - } - - template<typename _CharT, typename _Traits> - typename basic_istream<_CharT, _Traits>::int_type - basic_istream<_CharT, _Traits>:: - get(void) - { - const int_type __eof = traits_type::eof(); - int_type __c = __eof; - _M_gcount = 0; - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - sentry __cerb(*this, true); - if (__cerb) - { - try - { - __c = this->rdbuf()->sbumpc(); - // 27.6.1.1 paragraph 3 - if (!traits_type::eq_int_type(__c, __eof)) - _M_gcount = 1; - else - __err |= ios_base::eofbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - } - if (!_M_gcount) - __err |= ios_base::failbit; - if (__err) - this->setstate(__err); - return __c; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - get(char_type& __c) - { - _M_gcount = 0; - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - sentry __cerb(*this, true); - if (__cerb) - { - try - { - const int_type __cb = this->rdbuf()->sbumpc(); - // 27.6.1.1 paragraph 3 - if (!traits_type::eq_int_type(__cb, traits_type::eof())) - { - _M_gcount = 1; - __c = traits_type::to_char_type(__cb); - } - else - __err |= ios_base::eofbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - } - if (!_M_gcount) - __err |= ios_base::failbit; - if (__err) - this->setstate(__err); - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - get(char_type* __s, streamsize __n, char_type __delim) - { - _M_gcount = 0; - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - sentry __cerb(*this, true); - if (__cerb) - { - try - { - const int_type __idelim = traits_type::to_int_type(__delim); - const int_type __eof = traits_type::eof(); - __streambuf_type* __sb = this->rdbuf(); - int_type __c = __sb->sgetc(); - - while (_M_gcount + 1 < __n - && !traits_type::eq_int_type(__c, __eof) - && !traits_type::eq_int_type(__c, __idelim)) - { - *__s++ = traits_type::to_char_type(__c); - ++_M_gcount; - __c = __sb->snextc(); - } - if (traits_type::eq_int_type(__c, __eof)) - __err |= ios_base::eofbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - } - *__s = char_type(); - if (!_M_gcount) - __err |= ios_base::failbit; - if (__err) - this->setstate(__err); - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - get(__streambuf_type& __sb, char_type __delim) - { - _M_gcount = 0; - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - sentry __cerb(*this, true); - if (__cerb) - { - try - { - const int_type __idelim = traits_type::to_int_type(__delim); - const int_type __eof = traits_type::eof(); - __streambuf_type* __this_sb = this->rdbuf(); - int_type __c = __this_sb->sgetc(); - char_type __c2 = traits_type::to_char_type(__c); - - while (!traits_type::eq_int_type(__c, __eof) - && !traits_type::eq_int_type(__c, __idelim) - && !traits_type::eq_int_type(__sb.sputc(__c2), __eof)) - { - ++_M_gcount; - __c = __this_sb->snextc(); - __c2 = traits_type::to_char_type(__c); - } - if (traits_type::eq_int_type(__c, __eof)) - __err |= ios_base::eofbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - } - if (!_M_gcount) - __err |= ios_base::failbit; - if (__err) - this->setstate(__err); - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - getline(char_type* __s, streamsize __n, char_type __delim) - { - _M_gcount = 0; - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - sentry __cerb(*this, true); - if (__cerb) - { - try - { - const int_type __idelim = traits_type::to_int_type(__delim); - const int_type __eof = traits_type::eof(); - __streambuf_type* __sb = this->rdbuf(); - int_type __c = __sb->sgetc(); - - while (_M_gcount + 1 < __n - && !traits_type::eq_int_type(__c, __eof) - && !traits_type::eq_int_type(__c, __idelim)) - { - streamsize __size = std::min(streamsize(__sb->egptr() - - __sb->gptr()), - __n - _M_gcount - 1); - if (__size > 1) - { - const char_type* __p = traits_type::find(__sb->gptr(), - __size, - __delim); - if (__p) - __size = __p - __sb->gptr(); - traits_type::copy(__s, __sb->gptr(), __size); - __s += __size; - __sb->gbump(__size); - _M_gcount += __size; - __c = __sb->sgetc(); - } - else - { - *__s++ = traits_type::to_char_type(__c); - ++_M_gcount; - __c = __sb->snextc(); - } - } - - if (traits_type::eq_int_type(__c, __eof)) - __err |= ios_base::eofbit; - else if (traits_type::eq_int_type(__c, __idelim)) - { - ++_M_gcount; - __sb->sbumpc(); - } - else - __err |= ios_base::failbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - } - *__s = char_type(); - if (!_M_gcount) - __err |= ios_base::failbit; - if (__err) - this->setstate(__err); - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - ignore(streamsize __n, int_type __delim) - { - _M_gcount = 0; - sentry __cerb(*this, true); - if (__cerb && __n > 0) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const int_type __eof = traits_type::eof(); - __streambuf_type* __sb = this->rdbuf(); - int_type __c; - - if (__n != numeric_limits<streamsize>::max()) - --__n; - while (_M_gcount <= __n - && !traits_type::eq_int_type(__c = __sb->sbumpc(), __eof)) - { - ++_M_gcount; - if (traits_type::eq_int_type(__c, __delim)) - break; - } - if (traits_type::eq_int_type(__c, __eof)) - __err |= ios_base::eofbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - typename basic_istream<_CharT, _Traits>::int_type - basic_istream<_CharT, _Traits>:: - peek(void) - { - int_type __c = traits_type::eof(); - _M_gcount = 0; - sentry __cerb(*this, true); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - __c = this->rdbuf()->sgetc(); - if (traits_type::eq_int_type(__c, traits_type::eof())) - __err |= ios_base::eofbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return __c; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - read(char_type* __s, streamsize __n) - { - _M_gcount = 0; - sentry __cerb(*this, true); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - _M_gcount = this->rdbuf()->sgetn(__s, __n); - if (_M_gcount != __n) - __err |= (ios_base::eofbit | ios_base::failbit); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - streamsize - basic_istream<_CharT, _Traits>:: - readsome(char_type* __s, streamsize __n) - { - _M_gcount = 0; - sentry __cerb(*this, true); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - // Cannot compare int_type with streamsize generically. - const streamsize __num = this->rdbuf()->in_avail(); - if (__num > 0) - _M_gcount = this->rdbuf()->sgetn(__s, std::min(__num, __n)); - else if (__num == -1) - __err |= ios_base::eofbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return _M_gcount; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - putback(char_type __c) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 60. What is a formatted input function? - _M_gcount = 0; - sentry __cerb(*this, true); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const int_type __eof = traits_type::eof(); - __streambuf_type* __sb = this->rdbuf(); - if (!__sb - || traits_type::eq_int_type(__sb->sputbackc(__c), __eof)) - __err |= ios_base::badbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - unget(void) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 60. What is a formatted input function? - _M_gcount = 0; - sentry __cerb(*this, true); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const int_type __eof = traits_type::eof(); - __streambuf_type* __sb = this->rdbuf(); - if (!__sb - || traits_type::eq_int_type(__sb->sungetc(), __eof)) - __err |= ios_base::badbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - int - basic_istream<_CharT, _Traits>:: - sync(void) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR60. Do not change _M_gcount. - int __ret = -1; - sentry __cerb(*this, true); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - __streambuf_type* __sb = this->rdbuf(); - if (__sb) - { - if (__sb->pubsync() == -1) - __err |= ios_base::badbit; - else - __ret = 0; - } - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return __ret; - } - - template<typename _CharT, typename _Traits> - typename basic_istream<_CharT, _Traits>::pos_type - basic_istream<_CharT, _Traits>:: - tellg(void) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR60. Do not change _M_gcount. - pos_type __ret = pos_type(-1); - try - { - if (!this->fail()) - __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - return __ret; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - seekg(pos_type __pos) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR60. Do not change _M_gcount. - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - if (!this->fail()) - { - // 136. seekp, seekg setting wrong streams? - const pos_type __p = this->rdbuf()->pubseekpos(__pos, - ios_base::in); - - // 129. Need error indication from seekp() and seekg() - if (__p == pos_type(off_type(-1))) - __err |= ios_base::failbit; - } - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - return *this; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - basic_istream<_CharT, _Traits>:: - seekg(off_type __off, ios_base::seekdir __dir) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR60. Do not change _M_gcount. - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - if (!this->fail()) - { - // 136. seekp, seekg setting wrong streams? - const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir, - ios_base::in); - - // 129. Need error indication from seekp() and seekg() - if (__p == pos_type(off_type(-1))) - __err |= ios_base::failbit; - } - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - return *this; - } - - // 27.6.1.2.3 Character extraction templates - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) - { - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef typename __istream_type::int_type __int_type; - - typename __istream_type::sentry __cerb(__in, false); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __int_type __cb = __in.rdbuf()->sbumpc(); - if (!_Traits::eq_int_type(__cb, _Traits::eof())) - __c = _Traits::to_char_type(__cb); - else - __err |= (ios_base::eofbit | ios_base::failbit); - } - catch(...) - { __in._M_setstate(ios_base::badbit); } - if (__err) - __in.setstate(__err); - } - return __in; - } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) - { - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef typename __istream_type::__streambuf_type __streambuf_type; - typedef typename _Traits::int_type int_type; - typedef _CharT char_type; - typedef ctype<_CharT> __ctype_type; - - streamsize __extracted = 0; - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - typename __istream_type::sentry __cerb(__in, false); - if (__cerb) - { - try - { - // Figure out how many characters to extract. - streamsize __num = __in.width(); - if (__num <= 0) - __num = numeric_limits<streamsize>::max(); - - const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc()); - - const int_type __eof = _Traits::eof(); - __streambuf_type* __sb = __in.rdbuf(); - int_type __c = __sb->sgetc(); - - while (__extracted < __num - 1 - && !_Traits::eq_int_type(__c, __eof) - && !__ct.is(ctype_base::space, - _Traits::to_char_type(__c))) - { - *__s++ = _Traits::to_char_type(__c); - ++__extracted; - __c = __sb->snextc(); - } - if (_Traits::eq_int_type(__c, __eof)) - __err |= ios_base::eofbit; - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 68. Extractors for char* should store null at end - *__s = char_type(); - __in.width(0); - } - catch(...) - { __in._M_setstate(ios_base::badbit); } - } - if (!__extracted) - __err |= ios_base::failbit; - if (__err) - __in.setstate(__err); - return __in; - } - - // 27.6.1.4 Standard basic_istream manipulators - template<typename _CharT, typename _Traits> - basic_istream<_CharT,_Traits>& - ws(basic_istream<_CharT,_Traits>& __in) - { - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef typename __istream_type::__streambuf_type __streambuf_type; - typedef typename __istream_type::__ctype_type __ctype_type; - typedef typename __istream_type::int_type __int_type; - - const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc()); - const __int_type __eof = _Traits::eof(); - __streambuf_type* __sb = __in.rdbuf(); - __int_type __c = __sb->sgetc(); - - while (!_Traits::eq_int_type(__c, __eof) - && __ct.is(ctype_base::space, _Traits::to_char_type(__c))) - __c = __sb->snextc(); - - if (_Traits::eq_int_type(__c, __eof)) - __in.setstate(ios_base::eofbit); - return __in; - } - - // 21.3.7.9 basic_string::getline and operators - template<typename _CharT, typename _Traits, typename _Alloc> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __in, - basic_string<_CharT, _Traits, _Alloc>& __str) - { - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef typename __istream_type::int_type __int_type; - typedef typename __istream_type::__streambuf_type __streambuf_type; - typedef typename __istream_type::__ctype_type __ctype_type; - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - typedef typename __string_type::size_type __size_type; - - __size_type __extracted = 0; - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - typename __istream_type::sentry __cerb(__in, false); - if (__cerb) - { - try - { - // Avoid reallocation for common case. - __str.erase(); - _CharT __buf[128]; - __size_type __len = 0; - const streamsize __w = __in.width(); - const __size_type __n = __w > 0 ? static_cast<__size_type>(__w) - : __str.max_size(); - const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc()); - const __int_type __eof = _Traits::eof(); - __streambuf_type* __sb = __in.rdbuf(); - __int_type __c = __sb->sgetc(); - - while (__extracted < __n - && !_Traits::eq_int_type(__c, __eof) - && !__ct.is(ctype_base::space, _Traits::to_char_type(__c))) - { - if (__len == sizeof(__buf) / sizeof(_CharT)) - { - __str.append(__buf, sizeof(__buf) / sizeof(_CharT)); - __len = 0; - } - __buf[__len++] = _Traits::to_char_type(__c); - ++__extracted; - __c = __sb->snextc(); - } - __str.append(__buf, __len); - - if (_Traits::eq_int_type(__c, __eof)) - __err |= ios_base::eofbit; - __in.width(0); - } - catch(...) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 91. Description of operator>> and getline() for string<> - // might cause endless loop - __in._M_setstate(ios_base::badbit); - } - } - // 211. operator>>(istream&, string&) doesn't set failbit - if (!__extracted) - __err |= ios_base::failbit; - if (__err) - __in.setstate(__err); - return __in; - } - - template<typename _CharT, typename _Traits, typename _Alloc> - basic_istream<_CharT, _Traits>& - getline(basic_istream<_CharT, _Traits>& __in, - basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim) - { - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef typename __istream_type::int_type __int_type; - typedef typename __istream_type::__streambuf_type __streambuf_type; - typedef typename __istream_type::__ctype_type __ctype_type; - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - typedef typename __string_type::size_type __size_type; - - __size_type __extracted = 0; - const __size_type __n = __str.max_size(); - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - typename __istream_type::sentry __cerb(__in, true); - if (__cerb) - { - try - { - // Avoid reallocation for common case. - __str.erase(); - _CharT __buf[128]; - __size_type __len = 0; - const __int_type __idelim = _Traits::to_int_type(__delim); - const __int_type __eof = _Traits::eof(); - __streambuf_type* __sb = __in.rdbuf(); - __int_type __c = __sb->sgetc(); - - while (__extracted < __n - && !_Traits::eq_int_type(__c, __eof) - && !_Traits::eq_int_type(__c, __idelim)) - { - if (__len == sizeof(__buf) / sizeof(_CharT)) - { - __str.append(__buf, sizeof(__buf) / sizeof(_CharT)); - __len = 0; - } - __buf[__len++] = _Traits::to_char_type(__c); - ++__extracted; - __c = __sb->snextc(); - } - __str.append(__buf, __len); - - if (_Traits::eq_int_type(__c, __eof)) - __err |= ios_base::eofbit; - else if (_Traits::eq_int_type(__c, __idelim)) - { - ++__extracted; - __sb->sbumpc(); - } - else - __err |= ios_base::failbit; - } - catch(...) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 91. Description of operator>> and getline() for string<> - // might cause endless loop - __in._M_setstate(ios_base::badbit); - } - } - if (!__extracted) - __err |= ios_base::failbit; - if (__err) - __in.setstate(__err); - return __in; - } - - template<class _CharT, class _Traits, class _Alloc> - inline basic_istream<_CharT,_Traits>& - getline(basic_istream<_CharT, _Traits>& __in, - basic_string<_CharT,_Traits,_Alloc>& __str) - { return getline(__in, __str, __in.widen('\n')); } - - // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. -#if _GLIBCXX_EXTERN_TEMPLATE - extern template class basic_istream<char>; - extern template istream& ws(istream&); - extern template istream& operator>>(istream&, char&); - extern template istream& operator>>(istream&, char*); - extern template istream& operator>>(istream&, unsigned char&); - extern template istream& operator>>(istream&, signed char&); - extern template istream& operator>>(istream&, unsigned char*); - extern template istream& operator>>(istream&, signed char*); - - extern template class basic_iostream<char>; - -#ifdef _GLIBCXX_USE_WCHAR_T - extern template class basic_istream<wchar_t>; - extern template wistream& ws(wistream&); - extern template wistream& operator>>(wistream&, wchar_t&); - extern template wistream& operator>>(wistream&, wchar_t*); - - extern template class basic_iostream<wchar_t>; -#endif -#endif -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/list.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/list.tcc deleted file mode 100644 index aaaa8c364bd..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/list.tcc +++ /dev/null @@ -1,377 +0,0 @@ -// List implementation (out of line) -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file list.tcc - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _LIST_TCC -#define _LIST_TCC 1 - -namespace _GLIBCXX_STD -{ - template<typename _Tp, typename _Alloc> - void - _List_base<_Tp,_Alloc>:: - _M_clear() - { - typedef _List_node<_Tp> _Node; - _Node* __cur = static_cast<_Node*>(this->_M_impl._M_node._M_next); - while (__cur != &this->_M_impl._M_node) - { - _Node* __tmp = __cur; - __cur = static_cast<_Node*>(__cur->_M_next); - std::_Destroy(&__tmp->_M_data); - _M_put_node(__tmp); - } - } - - template<typename _Tp, typename _Alloc> - typename list<_Tp,_Alloc>::iterator - list<_Tp,_Alloc>:: - insert(iterator __position, const value_type& __x) - { - _Node* __tmp = _M_create_node(__x); - __tmp->hook(__position._M_node); - return __tmp; - } - - template<typename _Tp, typename _Alloc> - typename list<_Tp,_Alloc>::iterator - list<_Tp,_Alloc>:: - erase(iterator __position) - { - iterator __ret = __position._M_node->_M_next; - _M_erase(__position); - return __ret; - } - - template<typename _Tp, typename _Alloc> - void - list<_Tp,_Alloc>:: - resize(size_type __new_size, const value_type& __x) - { - iterator __i = begin(); - size_type __len = 0; - for ( ; __i != end() && __len < __new_size; ++__i, ++__len) - ; - if (__len == __new_size) - erase(__i, end()); - else // __i == end() - insert(end(), __new_size - __len, __x); - } - - template<typename _Tp, typename _Alloc> - list<_Tp,_Alloc>& - list<_Tp,_Alloc>:: - operator=(const list& __x) - { - if (this != &__x) - { - iterator __first1 = begin(); - iterator __last1 = end(); - const_iterator __first2 = __x.begin(); - const_iterator __last2 = __x.end(); - while (__first1 != __last1 && __first2 != __last2) - *__first1++ = *__first2++; - if (__first2 == __last2) - erase(__first1, __last1); - else - insert(__last1, __first2, __last2); - } - return *this; - } - - template<typename _Tp, typename _Alloc> - void - list<_Tp,_Alloc>:: - _M_fill_assign(size_type __n, const value_type& __val) - { - iterator __i = begin(); - for ( ; __i != end() && __n > 0; ++__i, --__n) - *__i = __val; - if (__n > 0) - insert(end(), __n, __val); - else - erase(__i, end()); - } - - template<typename _Tp, typename _Alloc> - template <typename _InputIterator> - void - list<_Tp,_Alloc>:: - _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2, - __false_type) - { - iterator __first1 = begin(); - iterator __last1 = end(); - for (; __first1 != __last1 && __first2 != __last2; - ++__first1, ++__first2) - *__first1 = *__first2; - if (__first2 == __last2) - erase(__first1, __last1); - else - insert(__last1, __first2, __last2); - } - - template<typename _Tp, typename _Alloc> - void - list<_Tp,_Alloc>:: - remove(const value_type& __value) - { - iterator __first = begin(); - iterator __last = end(); - while (__first != __last) - { - iterator __next = __first; - ++__next; - if (*__first == __value) - _M_erase(__first); - __first = __next; - } - } - - template<typename _Tp, typename _Alloc> - void - list<_Tp,_Alloc>:: - unique() - { - iterator __first = begin(); - iterator __last = end(); - if (__first == __last) - return; - iterator __next = __first; - while (++__next != __last) - { - if (*__first == *__next) - _M_erase(__next); - else - __first = __next; - __next = __first; - } - } - - template<typename _Tp, typename _Alloc> - void - list<_Tp,_Alloc>:: - merge(list& __x) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 300. list::merge() specification incomplete - if (this != &__x) - { - iterator __first1 = begin(); - iterator __last1 = end(); - iterator __first2 = __x.begin(); - iterator __last2 = __x.end(); - while (__first1 != __last1 && __first2 != __last2) - if (*__first2 < *__first1) - { - iterator __next = __first2; - _M_transfer(__first1, __first2, ++__next); - __first2 = __next; - } - else - ++__first1; - if (__first2 != __last2) - _M_transfer(__last1, __first2, __last2); - } - } - - template<typename _Tp, typename _Alloc> - void - list<_Tp,_Alloc>:: - sort() - { - // Do nothing if the list has length 0 or 1. - if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node - && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node) - { - list __carry; - list __tmp[64]; - list * __fill = &__tmp[0]; - list * __counter; - - do - { - __carry.splice(__carry.begin(), *this, begin()); - - for(__counter = &__tmp[0]; - (__counter != __fill) && !__counter->empty(); - ++__counter) - { - __counter->merge(__carry); - __carry.swap(*__counter); - } - __carry.swap(*__counter); - if (__counter == __fill) - ++__fill; - } - while ( !empty() ); - - for (__counter = &__tmp[1]; __counter != __fill; ++__counter) - __counter->merge( *(__counter-1) ); - swap( *(__fill-1) ); - } - } - - template<typename _Tp, typename _Alloc> - template <typename _Predicate> - void - list<_Tp,_Alloc>:: - remove_if(_Predicate __pred) - { - iterator __first = begin(); - iterator __last = end(); - while (__first != __last) - { - iterator __next = __first; - ++__next; - if (__pred(*__first)) - _M_erase(__first); - __first = __next; - } - } - - template<typename _Tp, typename _Alloc> - template <typename _BinaryPredicate> - void - list<_Tp,_Alloc>:: - unique(_BinaryPredicate __binary_pred) - { - iterator __first = begin(); - iterator __last = end(); - if (__first == __last) return; - iterator __next = __first; - while (++__next != __last) - { - if (__binary_pred(*__first, *__next)) - _M_erase(__next); - else - __first = __next; - __next = __first; - } - } - - template<typename _Tp, typename _Alloc> - template <typename _StrictWeakOrdering> - void - list<_Tp,_Alloc>:: - merge(list& __x, _StrictWeakOrdering __comp) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 300. list::merge() specification incomplete - if (this != &__x) - { - iterator __first1 = begin(); - iterator __last1 = end(); - iterator __first2 = __x.begin(); - iterator __last2 = __x.end(); - while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first2, *__first1)) - { - iterator __next = __first2; - _M_transfer(__first1, __first2, ++__next); - __first2 = __next; - } - else - ++__first1; - if (__first2 != __last2) - _M_transfer(__last1, __first2, __last2); - } - } - - template<typename _Tp, typename _Alloc> - template <typename _StrictWeakOrdering> - void - list<_Tp,_Alloc>:: - sort(_StrictWeakOrdering __comp) - { - // Do nothing if the list has length 0 or 1. - if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node - && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node) - { - list __carry; - list __tmp[64]; - list * __fill = &__tmp[0]; - list * __counter; - - do - { - __carry.splice(__carry.begin(), *this, begin()); - - for(__counter = &__tmp[0]; - (__counter != __fill) && !__counter->empty(); - ++__counter) - { - __counter->merge(__carry, __comp); - __carry.swap(*__counter); - } - __carry.swap(*__counter); - if (__counter == __fill) - ++__fill; - } - while ( !empty() ); - - for (__counter = &__tmp[1]; __counter != __fill; ++__counter) - __counter->merge( *(__counter-1), __comp ); - swap( *(__fill-1) ); - } - } -} // namespace std - -#endif /* _LIST_TCC */ - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_classes.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_classes.h deleted file mode 100644 index 95d9c0366a0..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_classes.h +++ /dev/null @@ -1,599 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.1 Locales -// - -/** @file localefwd.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _LOCALE_CLASSES_H -#define _LOCALE_CLASSES_H 1 - -#pragma GCC system_header - -#include <bits/localefwd.h> -#include <cstring> // For strcmp. -#include <string> -#include <bits/atomicity.h> -#include <bits/gthr.h> - -namespace std -{ - // 22.1.1 Class locale - /** - * @brief Container class for localization functionality. - * - * The locale class is first a class wrapper for C library locales. It is - * also an extensible container for user-defined localization. A locale is - * a collection of facets that implement various localization features such - * as money, time, and number printing. - * - * Constructing C++ locales does not change the C library locale. - * - * This library supports efficient construction and copying of locales - * through a reference counting implementation of the locale class. - */ - class locale - { - public: - // Types: - /// Definition of locale::category. - typedef int category; - - // Forward decls and friends: - class facet; - class id; - class _Impl; - - friend class facet; - friend class _Impl; - - template<typename _Facet> - friend bool - has_facet(const locale&) throw(); - - template<typename _Facet> - friend const _Facet& - use_facet(const locale&); - - template<typename _Cache> - friend struct __use_cache; - - //@{ - /** - * @brief Category values. - * - * The standard category values are none, ctype, numeric, collate, time, - * monetary, and messages. They form a bitmask that supports union and - * intersection. The category all is the union of these values. - * - * @if maint - * NB: Order must match _S_facet_categories definition in locale.cc - * @endif - */ - static const category none = 0; - static const category ctype = 1L << 0; - static const category numeric = 1L << 1; - static const category collate = 1L << 2; - static const category time = 1L << 3; - static const category monetary = 1L << 4; - static const category messages = 1L << 5; - static const category all = (ctype | numeric | collate | - time | monetary | messages); - //@} - - // Construct/copy/destroy: - - /** - * @brief Default constructor. - * - * Constructs a copy of the global locale. If no locale has been - * explicitly set, this is the "C" locale. - */ - locale() throw(); - - /** - * @brief Copy constructor. - * - * Constructs a copy of @a other. - * - * @param other The locale to copy. - */ - locale(const locale& __other) throw(); - - /** - * @brief Named locale constructor. - * - * Constructs a copy of the named C library locale. - * - * @param s Name of the locale to construct. - * @throw std::runtime_error if s is null or an undefined locale. - */ - explicit - locale(const char* __s); - - /** - * @brief Construct locale with facets from another locale. - * - * Constructs a copy of the locale @a base. The facets specified by @a - * cat are replaced with those from the locale named by @a s. If base is - * named, this locale instance will also be named. - * - * @param base The locale to copy. - * @param s Name of the locale to use facets from. - * @param cat Set of categories defining the facets to use from s. - * @throw std::runtime_error if s is null or an undefined locale. - */ - locale(const locale& __base, const char* __s, category __cat); - - /** - * @brief Construct locale with facets from another locale. - * - * Constructs a copy of the locale @a base. The facets specified by @a - * cat are replaced with those from the locale @a add. If @a base and @a - * add are named, this locale instance will also be named. - * - * @param base The locale to copy. - * @param add The locale to use facets from. - * @param cat Set of categories defining the facets to use from add. - */ - locale(const locale& __base, const locale& __add, category __cat); - - /** - * @brief Construct locale with another facet. - * - * Constructs a copy of the locale @a other. The facet @f is added to - * @other, replacing an existing facet of type Facet if there is one. If - * @f is null, this locale is a copy of @a other. - * - * @param other The locale to copy. - * @param f The facet to add in. - */ - template<typename _Facet> - locale(const locale& __other, _Facet* __f); - - /// Locale destructor. - ~locale() throw(); - - /** - * @brief Assignment operator. - * - * Set this locale to be a copy of @a other. - * - * @param other The locale to copy. - * @return A reference to this locale. - */ - const locale& - operator=(const locale& __other) throw(); - - /** - * @brief Construct locale with another facet. - * - * Constructs and returns a new copy of this locale. Adds or replaces an - * existing facet of type Facet from the locale @a other into the new - * locale. - * - * @param Facet The facet type to copy from other - * @param other The locale to copy from. - * @return Newly constructed locale. - * @throw std::runtime_error if other has no facet of type Facet. - */ - template<typename _Facet> - locale - combine(const locale& __other) const; - - // Locale operations: - /** - * @brief Return locale name. - * @return Locale name or "*" if unnamed. - */ - string - name() const; - - /** - * @brief Locale equality. - * - * @param other The locale to compare against. - * @return True if other and this refer to the same locale instance, are - * copies, or have the same name. False otherwise. - */ - bool - operator==(const locale& __other) const throw (); - - /** - * @brief Locale inequality. - * - * @param other The locale to compare against. - * @return ! (*this == other) - */ - inline bool - operator!=(const locale& __other) const throw () - { return !(this->operator==(__other)); } - - /** - * @brief Compare two strings according to collate. - * - * Template operator to compare two strings using the compare function of - * the collate facet in this locale. One use is to provide the locale to - * the sort function. For example, a vector v of strings could be sorted - * according to locale loc by doing: - * @code - * std::sort(v.begin(), v.end(), loc); - * @endcode - * - * @param s1 First string to compare. - * @param s2 Second string to compare. - * @return True if collate<Char> facet compares s1 < s2, else false. - */ - template<typename _Char, typename _Traits, typename _Alloc> - bool - operator()(const basic_string<_Char, _Traits, _Alloc>& __s1, - const basic_string<_Char, _Traits, _Alloc>& __s2) const; - - // Global locale objects: - /** - * @brief Set global locale - * - * This function sets the global locale to the argument and returns a - * copy of the previous global locale. If the argument has a name, it - * will also call std::setlocale(LC_ALL, loc.name()). - * - * @param locale The new locale to make global. - * @return Copy of the old global locale. - */ - static locale - global(const locale&); - - /** - * @brief Return reference to the "C" locale. - */ - static const locale& - classic(); - - private: - // The (shared) implementation - _Impl* _M_impl; - - // The "C" reference locale - static _Impl* _S_classic; - - // Current global locale - static _Impl* _S_global; - - // Names of underlying locale categories. - // NB: locale::global() has to know how to modify all the - // underlying categories, not just the ones required by the C++ - // standard. - static const char* const* const _S_categories; - - // Number of standard categories. For C++, these categories are - // collate, ctype, monetary, numeric, time, and messages. These - // directly correspond to ISO C99 macros LC_COLLATE, LC_CTYPE, - // LC_MONETARY, LC_NUMERIC, and LC_TIME. In addition, POSIX (IEEE - // 1003.1-2001) specifies LC_MESSAGES. - // In addition to the standard categories, the underlying - // operating system is allowed to define extra LC_* - // macros. For GNU systems, the following are also valid: - // LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT, - // and LC_IDENTIFICATION. - static const size_t _S_categories_size = 6 + _GLIBCXX_NUM_CATEGORIES; - -#ifdef __GTHREADS - static __gthread_once_t _S_once; -#endif - - explicit - locale(_Impl*) throw(); - - static void - _S_initialize(); - - static void - _S_initialize_once(); - - static category - _S_normalize_category(category); - - void - _M_coalesce(const locale& __base, const locale& __add, category __cat); - }; - - - // 22.1.1.1.2 Class locale::facet - /** - * @brief Localization functionality base class. - * - * The facet class is the base class for a localization feature, such as - * money, time, and number printing. It provides common support for facets - * and reference management. - * - * Facets may not be copied or assigned. - */ - class locale::facet - { - private: - friend class locale; - friend class locale::_Impl; - - mutable _Atomic_word _M_refcount; - - // Contains data from the underlying "C" library for the classic locale. - static __c_locale _S_c_locale; - - // String literal for the name of the classic locale. - static const char _S_c_name[2]; - -#ifdef __GTHREADS - static __gthread_once_t _S_once; -#endif - - static void - _S_initialize_once(); - - protected: - /** - * @brief Facet constructor. - * - * This is the constructor provided by the standard. If refs is 0, the - * facet is destroyed when the last referencing locale is destroyed. - * Otherwise the facet will never be destroyed. - * - * @param refs The initial value for reference count. - */ - explicit - facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0) - { } - - /// Facet destructor. - virtual - ~facet(); - - static void - _S_create_c_locale(__c_locale& __cloc, const char* __s, - __c_locale __old = 0); - - static __c_locale - _S_clone_c_locale(__c_locale& __cloc); - - static void - _S_destroy_c_locale(__c_locale& __cloc); - - // Returns data from the underlying "C" library data for the - // classic locale. - static __c_locale - _S_get_c_locale(); - - static const char* - _S_get_c_name(); - - private: - inline void - _M_add_reference() const throw() - { __gnu_cxx::__atomic_add(&_M_refcount, 1); } - - inline void - _M_remove_reference() const throw() - { - if (__gnu_cxx::__exchange_and_add(&_M_refcount, -1) == 1) - { - try - { delete this; } - catch (...) - { } - } - } - - facet(const facet&); // Not defined. - - facet& - operator=(const facet&); // Not defined. - }; - - - // 22.1.1.1.3 Class locale::id - /** - * @brief Facet ID class. - * - * The ID class provides facets with an index used to identify them. - * Every facet class must define a public static member locale::id, or be - * derived from a facet that provides this member, otherwise the facet - * cannot be used in a locale. The locale::id ensures that each class - * type gets a unique identifier. - */ - class locale::id - { - private: - friend class locale; - friend class locale::_Impl; - - template<typename _Facet> - friend const _Facet& - use_facet(const locale&); - - template<typename _Facet> - friend bool - has_facet(const locale&) throw (); - - // NB: There is no accessor for _M_index because it may be used - // before the constructor is run; the effect of calling a member - // function (even an inline) would be undefined. - mutable size_t _M_index; - - // Last id number assigned. - static _Atomic_word _S_refcount; - - void - operator=(const id&); // Not defined. - - id(const id&); // Not defined. - - public: - // NB: This class is always a static data member, and thus can be - // counted on to be zero-initialized. - /// Constructor. - id() { } - - size_t - _M_id() const; - }; - - - // Implementation object for locale. - class locale::_Impl - { - public: - // Friends. - friend class locale; - friend class locale::facet; - - template<typename _Facet> - friend bool - has_facet(const locale&) throw(); - - template<typename _Facet> - friend const _Facet& - use_facet(const locale&); - - template<typename _Cache> - friend struct __use_cache; - - private: - // Data Members. - _Atomic_word _M_refcount; - const facet** _M_facets; - size_t _M_facets_size; - const facet** _M_caches; - char** _M_names; - static const locale::id* const _S_id_ctype[]; - static const locale::id* const _S_id_numeric[]; - static const locale::id* const _S_id_collate[]; - static const locale::id* const _S_id_time[]; - static const locale::id* const _S_id_monetary[]; - static const locale::id* const _S_id_messages[]; - static const locale::id* const* const _S_facet_categories[]; - - inline void - _M_add_reference() throw() - { __gnu_cxx::__atomic_add(&_M_refcount, 1); } - - inline void - _M_remove_reference() throw() - { - if (__gnu_cxx::__exchange_and_add(&_M_refcount, -1) == 1) - { - try - { delete this; } - catch(...) - { } - } - } - - _Impl(const _Impl&, size_t); - _Impl(const char*, size_t); - _Impl(size_t) throw(); - - ~_Impl() throw(); - - _Impl(const _Impl&); // Not defined. - - void - operator=(const _Impl&); // Not defined. - - inline bool - _M_check_same_name() - { - bool __ret = true; - for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i) - __ret = std::strcmp(_M_names[__i], _M_names[__i + 1]) == 0; - return __ret; - } - - void - _M_replace_categories(const _Impl*, category); - - void - _M_replace_category(const _Impl*, const locale::id* const*); - - void - _M_replace_facet(const _Impl*, const locale::id*); - - void - _M_install_facet(const locale::id*, const facet*); - - template<typename _Facet> - inline void - _M_init_facet(_Facet* __facet) - { _M_install_facet(&_Facet::id, __facet); } - - void - _M_install_cache(const facet* __cache, size_t __index) throw() - { - __cache->_M_add_reference(); - _M_caches[__index] = __cache; - } - }; - - template<typename _Facet> - locale::locale(const locale& __other, _Facet* __f) - { - _M_impl = new _Impl(*__other._M_impl, 1); - - char* _M_tmp_names[_S_categories_size]; - size_t __i = 0; - try - { - for (; __i < _S_categories_size; ++__i) - { - _M_tmp_names[__i] = new char[2]; - std::strcpy(_M_tmp_names[__i], "*"); - } - _M_impl->_M_install_facet(&_Facet::id, __f); - } - catch(...) - { - _M_impl->_M_remove_reference(); - for (size_t __j = 0; __j < __i; ++__j) - delete [] _M_tmp_names[__j]; - __throw_exception_again; - } - - for (size_t __k = 0; __k < _S_categories_size; ++__k) - { - delete [] _M_impl->_M_names[__k]; - _M_impl->_M_names[__k] = _M_tmp_names[__k]; - } - } -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_facets.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_facets.h deleted file mode 100644 index db0e9514623..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_facets.h +++ /dev/null @@ -1,4558 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.1 Locales -// - -/** @file locale_facets.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _LOCALE_FACETS_H -#define _LOCALE_FACETS_H 1 - -#pragma GCC system_header - -#include <ctime> // For struct tm -#include <cwctype> // For wctype_t -#include <iosfwd> -#include <bits/ios_base.h> // For ios_base, ios_base::iostate -#include <streambuf> - -namespace std -{ - // NB: Don't instantiate required wchar_t facets if no wchar_t support. -#ifdef _GLIBCXX_USE_WCHAR_T -# define _GLIBCXX_NUM_FACETS 28 -#else -# define _GLIBCXX_NUM_FACETS 14 -#endif - - // Convert string to numeric value of type _Tv and store results. - // NB: This is specialized for all required types, there is no - // generic definition. - template<typename _Tv> - void - __convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err, - const __c_locale& __cloc); - - // Explicit specializations for required types. - template<> - void - __convert_to_v(const char*, float&, ios_base::iostate&, - const __c_locale&); - - template<> - void - __convert_to_v(const char*, double&, ios_base::iostate&, - const __c_locale&); - - template<> - void - __convert_to_v(const char*, long double&, ios_base::iostate&, - const __c_locale&); - - // NB: __pad is a struct, rather than a function, so it can be - // partially-specialized. - template<typename _CharT, typename _Traits> - struct __pad - { - static void - _S_pad(ios_base& __io, _CharT __fill, _CharT* __news, - const _CharT* __olds, const streamsize __newlen, - const streamsize __oldlen, const bool __num); - }; - - // Used by both numeric and monetary facets. - // Inserts "group separator" characters into an array of characters. - // It's recursive, one iteration per group. It moves the characters - // in the buffer this way: "xxxx12345" -> "12,345xxx". Call this - // only with __glen != 0. - template<typename _CharT> - _CharT* - __add_grouping(_CharT* __s, _CharT __sep, - const char* __gbeg, size_t __gsize, - const _CharT* __first, const _CharT* __last); - - // This template permits specializing facet output code for - // ostreambuf_iterator. For ostreambuf_iterator, sputn is - // significantly more efficient than incrementing iterators. - template<typename _CharT> - inline - ostreambuf_iterator<_CharT> - __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len) - { - __s._M_put(__ws, __len); - return __s; - } - - // This is the unspecialized form of the template. - template<typename _CharT, typename _OutIter> - inline - _OutIter - __write(_OutIter __s, const _CharT* __ws, int __len) - { - for (int __j = 0; __j < __len; __j++, ++__s) - *__s = __ws[__j]; - return __s; - } - - - // 22.2.1.1 Template class ctype - // Include host and configuration specific ctype enums for ctype_base. - #include <bits/ctype_base.h> - - // Common base for ctype<_CharT>. - /** - * @brief Common base for ctype facet - * - * This template class provides implementations of the public functions - * that forward to the protected virtual functions. - * - * This template also provides abtract stubs for the protected virtual - * functions. - */ - template<typename _CharT> - class __ctype_abstract_base : public locale::facet, public ctype_base - { - public: - // Types: - /// Typedef for the template parameter - typedef _CharT char_type; - - /** - * @brief Test char_type classification. - * - * This function finds a mask M for @a c and compares it to mask @a m. - * It does so by returning the value of ctype<char_type>::do_is(). - * - * @param c The char_type to compare the mask of. - * @param m The mask to compare against. - * @return (M & m) != 0. - */ - bool - is(mask __m, char_type __c) const - { return this->do_is(__m, __c); } - - /** - * @brief Return a mask array. - * - * This function finds the mask for each char_type in the range [lo,hi) - * and successively writes it to vec. vec must have as many elements - * as the char array. It does so by returning the value of - * ctype<char_type>::do_is(). - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @param vec Pointer to an array of mask storage. - * @return @a hi. - */ - const char_type* - is(const char_type *__lo, const char_type *__hi, mask *__vec) const - { return this->do_is(__lo, __hi, __vec); } - - /** - * @brief Find char_type matching a mask - * - * This function searches for and returns the first char_type c in - * [lo,hi) for which is(m,c) is true. It does so by returning - * ctype<char_type>::do_scan_is(). - * - * @param m The mask to compare against. - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return Pointer to matching char_type if found, else @a hi. - */ - const char_type* - scan_is(mask __m, const char_type* __lo, const char_type* __hi) const - { return this->do_scan_is(__m, __lo, __hi); } - - /** - * @brief Find char_type not matching a mask - * - * This function searches for and returns the first char_type c in - * [lo,hi) for which is(m,c) is false. It does so by returning - * ctype<char_type>::do_scan_not(). - * - * @param m The mask to compare against. - * @param lo Pointer to first char in range. - * @param hi Pointer to end of range. - * @return Pointer to non-matching char if found, else @a hi. - */ - const char_type* - scan_not(mask __m, const char_type* __lo, const char_type* __hi) const - { return this->do_scan_not(__m, __lo, __hi); } - - /** - * @brief Convert to uppercase. - * - * This function converts the argument to uppercase if possible. - * If not possible (for example, '2'), returns the argument. It does - * so by returning ctype<char_type>::do_toupper(). - * - * @param c The char_type to convert. - * @return The uppercase char_type if convertible, else @a c. - */ - char_type - toupper(char_type __c) const - { return this->do_toupper(__c); } - - /** - * @brief Convert array to uppercase. - * - * This function converts each char_type in the range [lo,hi) to - * uppercase if possible. Other elements remain untouched. It does so - * by returning ctype<char_type>:: do_toupper(lo, hi). - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return @a hi. - */ - const char_type* - toupper(char_type *__lo, const char_type* __hi) const - { return this->do_toupper(__lo, __hi); } - - /** - * @brief Convert to lowercase. - * - * This function converts the argument to lowercase if possible. If - * not possible (for example, '2'), returns the argument. It does so - * by returning ctype<char_type>::do_tolower(c). - * - * @param c The char_type to convert. - * @return The lowercase char_type if convertible, else @a c. - */ - char_type - tolower(char_type __c) const - { return this->do_tolower(__c); } - - /** - * @brief Convert array to lowercase. - * - * This function converts each char_type in the range [lo,hi) to - * lowercase if possible. Other elements remain untouched. It does so - * by returning ctype<char_type>:: do_tolower(lo, hi). - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return @a hi. - */ - const char_type* - tolower(char_type* __lo, const char_type* __hi) const - { return this->do_tolower(__lo, __hi); } - - /** - * @brief Widen char to char_type - * - * This function converts the char argument to char_type using the - * simplest reasonable transformation. It does so by returning - * ctype<char_type>::do_widen(c). - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param c The char to convert. - * @return The converted char_type. - */ - char_type - widen(char __c) const - { return this->do_widen(__c); } - - /** - * @brief Widen array to char_type - * - * This function converts each char in the input to char_type using the - * simplest reasonable transformation. It does so by returning - * ctype<char_type>::do_widen(c). - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @param to Pointer to the destination array. - * @return @a hi. - */ - const char* - widen(const char* __lo, const char* __hi, char_type* __to) const - { return this->do_widen(__lo, __hi, __to); } - - /** - * @brief Narrow char_type to char - * - * This function converts the char_type to char using the simplest - * reasonable transformation. If the conversion fails, dfault is - * returned instead. It does so by returning - * ctype<char_type>::do_narrow(c). - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param c The char_type to convert. - * @param dfault Char to return if conversion fails. - * @return The converted char. - */ - char - narrow(char_type __c, char __dfault) const - { return this->do_narrow(__c, __dfault); } - - /** - * @brief Narrow array to char array - * - * This function converts each char_type in the input to char using the - * simplest reasonable transformation and writes the results to the - * destination array. For any char_type in the input that cannot be - * converted, @a dfault is used instead. It does so by returning - * ctype<char_type>::do_narrow(lo, hi, dfault, to). - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @param dfault Char to use if conversion fails. - * @param to Pointer to the destination array. - * @return @a hi. - */ - const char_type* - narrow(const char_type* __lo, const char_type* __hi, - char __dfault, char *__to) const - { return this->do_narrow(__lo, __hi, __dfault, __to); } - - protected: - explicit - __ctype_abstract_base(size_t __refs = 0): facet(__refs) { } - - virtual - ~__ctype_abstract_base() { } - - /** - * @brief Test char_type classification. - * - * This function finds a mask M for @a c and compares it to mask @a m. - * - * do_is() is a hook for a derived facet to change the behavior of - * classifying. do_is() must always return the same result for the - * same input. - * - * @param c The char_type to find the mask of. - * @param m The mask to compare against. - * @return (M & m) != 0. - */ - virtual bool - do_is(mask __m, char_type __c) const = 0; - - /** - * @brief Return a mask array. - * - * This function finds the mask for each char_type in the range [lo,hi) - * and successively writes it to vec. vec must have as many elements - * as the input. - * - * do_is() is a hook for a derived facet to change the behavior of - * classifying. do_is() must always return the same result for the - * same input. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @param vec Pointer to an array of mask storage. - * @return @a hi. - */ - virtual const char_type* - do_is(const char_type* __lo, const char_type* __hi, - mask* __vec) const = 0; - - /** - * @brief Find char_type matching mask - * - * This function searches for and returns the first char_type c in - * [lo,hi) for which is(m,c) is true. - * - * do_scan_is() is a hook for a derived facet to change the behavior of - * match searching. do_is() must always return the same result for the - * same input. - * - * @param m The mask to compare against. - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return Pointer to a matching char_type if found, else @a hi. - */ - virtual const char_type* - do_scan_is(mask __m, const char_type* __lo, - const char_type* __hi) const = 0; - - /** - * @brief Find char_type not matching mask - * - * This function searches for and returns a pointer to the first - * char_type c of [lo,hi) for which is(m,c) is false. - * - * do_scan_is() is a hook for a derived facet to change the behavior of - * match searching. do_is() must always return the same result for the - * same input. - * - * @param m The mask to compare against. - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return Pointer to a non-matching char_type if found, else @a hi. - */ - virtual const char_type* - do_scan_not(mask __m, const char_type* __lo, - const char_type* __hi) const = 0; - - /** - * @brief Convert to uppercase. - * - * This virtual function converts the char_type argument to uppercase - * if possible. If not possible (for example, '2'), returns the - * argument. - * - * do_toupper() is a hook for a derived facet to change the behavior of - * uppercasing. do_toupper() must always return the same result for - * the same input. - * - * @param c The char_type to convert. - * @return The uppercase char_type if convertible, else @a c. - */ - virtual char_type - do_toupper(char_type) const = 0; - - /** - * @brief Convert array to uppercase. - * - * This virtual function converts each char_type in the range [lo,hi) - * to uppercase if possible. Other elements remain untouched. - * - * do_toupper() is a hook for a derived facet to change the behavior of - * uppercasing. do_toupper() must always return the same result for - * the same input. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return @a hi. - */ - virtual const char_type* - do_toupper(char_type* __lo, const char_type* __hi) const = 0; - - /** - * @brief Convert to lowercase. - * - * This virtual function converts the argument to lowercase if - * possible. If not possible (for example, '2'), returns the argument. - * - * do_tolower() is a hook for a derived facet to change the behavior of - * lowercasing. do_tolower() must always return the same result for - * the same input. - * - * @param c The char_type to convert. - * @return The lowercase char_type if convertible, else @a c. - */ - virtual char_type - do_tolower(char_type) const = 0; - - /** - * @brief Convert array to lowercase. - * - * This virtual function converts each char_type in the range [lo,hi) - * to lowercase if possible. Other elements remain untouched. - * - * do_tolower() is a hook for a derived facet to change the behavior of - * lowercasing. do_tolower() must always return the same result for - * the same input. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return @a hi. - */ - virtual const char_type* - do_tolower(char_type* __lo, const char_type* __hi) const = 0; - - /** - * @brief Widen char - * - * This virtual function converts the char to char_type using the - * simplest reasonable transformation. - * - * do_widen() is a hook for a derived facet to change the behavior of - * widening. do_widen() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param c The char to convert. - * @return The converted char_type - */ - virtual char_type - do_widen(char) const = 0; - - /** - * @brief Widen char array - * - * This function converts each char in the input to char_type using the - * simplest reasonable transformation. - * - * do_widen() is a hook for a derived facet to change the behavior of - * widening. do_widen() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param lo Pointer to start range. - * @param hi Pointer to end of range. - * @param to Pointer to the destination array. - * @return @a hi. - */ - virtual const char* - do_widen(const char* __lo, const char* __hi, - char_type* __dest) const = 0; - - /** - * @brief Narrow char_type to char - * - * This virtual function converts the argument to char using the - * simplest reasonable transformation. If the conversion fails, dfault - * is returned instead. - * - * do_narrow() is a hook for a derived facet to change the behavior of - * narrowing. do_narrow() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param c The char_type to convert. - * @param dfault Char to return if conversion fails. - * @return The converted char. - */ - virtual char - do_narrow(char_type, char __dfault) const = 0; - - /** - * @brief Narrow char_type array to char - * - * This virtual function converts each char_type in the range [lo,hi) to - * char using the simplest reasonable transformation and writes the - * results to the destination array. For any element in the input that - * cannot be converted, @a dfault is used instead. - * - * do_narrow() is a hook for a derived facet to change the behavior of - * narrowing. do_narrow() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @param dfault Char to use if conversion fails. - * @param to Pointer to the destination array. - * @return @a hi. - */ - virtual const char_type* - do_narrow(const char_type* __lo, const char_type* __hi, - char __dfault, char* __dest) const = 0; - }; - - // NB: Generic, mostly useless implementation. - /** - * @brief Template ctype facet - * - * This template class defines classification and conversion functions for - * character sets. It wraps <cctype> functionality. Ctype gets used by - * streams for many I/O operations. - * - * This template provides the protected virtual functions the developer - * will have to replace in a derived class or specialization to make a - * working facet. The public functions that access them are defined in - * __ctype_abstract_base, to allow for implementation flexibility. See - * ctype<wchar_t> for an example. The functions are documented in - * __ctype_abstract_base. - * - * Note: implementations are provided for all the protected virtual - * functions, but will likely not be useful. - */ - template<typename _CharT> - class ctype : public __ctype_abstract_base<_CharT> - { - public: - // Types: - typedef _CharT char_type; - typedef typename __ctype_abstract_base<_CharT>::mask mask; - - /// The facet id for ctype<char_type> - static locale::id id; - - explicit - ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { } - - protected: - virtual - ~ctype(); - - virtual bool - do_is(mask __m, char_type __c) const; - - virtual const char_type* - do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const; - - virtual const char_type* - do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const; - - virtual const char_type* - do_scan_not(mask __m, const char_type* __lo, - const char_type* __hi) const; - - virtual char_type - do_toupper(char_type __c) const; - - virtual const char_type* - do_toupper(char_type* __lo, const char_type* __hi) const; - - virtual char_type - do_tolower(char_type __c) const; - - virtual const char_type* - do_tolower(char_type* __lo, const char_type* __hi) const; - - virtual char_type - do_widen(char __c) const; - - virtual const char* - do_widen(const char* __lo, const char* __hi, char_type* __dest) const; - - virtual char - do_narrow(char_type, char __dfault) const; - - virtual const char_type* - do_narrow(const char_type* __lo, const char_type* __hi, - char __dfault, char* __dest) const; - }; - - template<typename _CharT> - locale::id ctype<_CharT>::id; - - // 22.2.1.3 ctype<char> specialization. - /** - * @brief The ctype<char> specialization. - * - * This class defines classification and conversion functions for - * the char type. It gets used by char streams for many I/O - * operations. The char specialization provides a number of - * optimizations as well. - */ - template<> - class ctype<char> : public locale::facet, public ctype_base - { - public: - // Types: - /// Typedef for the template parameter char. - typedef char char_type; - - protected: - // Data Members: - __c_locale _M_c_locale_ctype; - bool _M_del; - __to_type _M_toupper; - __to_type _M_tolower; - const mask* _M_table; - mutable char _M_widen_ok; - mutable char _M_widen[1 + static_cast<unsigned char>(-1)]; - mutable char _M_narrow[1 + static_cast<unsigned char>(-1)]; - mutable char _M_narrow_ok; // 0 uninitialized, 1 init, - // 2 memcpy can't be used - - public: - /// The facet id for ctype<char> - static locale::id id; - /// The size of the mask table. It is SCHAR_MAX + 1. - static const size_t table_size = 1 + static_cast<unsigned char>(-1); - - /** - * @brief Constructor performs initialization. - * - * This is the constructor provided by the standard. - * - * @param table If non-zero, table is used as the per-char mask. - * Else classic_table() is used. - * @param del If true, passes ownership of table to this facet. - * @param refs Passed to the base facet class. - */ - explicit - ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0); - - /** - * @brief Constructor performs static initialization. - * - * This constructor is used to construct the initial C locale facet. - * - * @param cloc Handle to C locale data. - * @param table If non-zero, table is used as the per-char mask. - * @param del If true, passes ownership of table to this facet. - * @param refs Passed to the base facet class. - */ - explicit - ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false, - size_t __refs = 0); - - /** - * @brief Test char classification. - * - * This function compares the mask table[c] to @a m. - * - * @param c The char to compare the mask of. - * @param m The mask to compare against. - * @return True if m & table[c] is true, false otherwise. - */ - inline bool - is(mask __m, char __c) const; - - /** - * @brief Return a mask array. - * - * This function finds the mask for each char in the range [lo, hi) and - * successively writes it to vec. vec must have as many elements as - * the char array. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @param vec Pointer to an array of mask storage. - * @return @a hi. - */ - inline const char* - is(const char* __lo, const char* __hi, mask* __vec) const; - - /** - * @brief Find char matching a mask - * - * This function searches for and returns the first char in [lo,hi) for - * which is(m,char) is true. - * - * @param m The mask to compare against. - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return Pointer to a matching char if found, else @a hi. - */ - inline const char* - scan_is(mask __m, const char* __lo, const char* __hi) const; - - /** - * @brief Find char not matching a mask - * - * This function searches for and returns a pointer to the first char - * in [lo,hi) for which is(m,char) is false. - * - * @param m The mask to compare against. - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return Pointer to a non-matching char if found, else @a hi. - */ - inline const char* - scan_not(mask __m, const char* __lo, const char* __hi) const; - - /** - * @brief Convert to uppercase. - * - * This function converts the char argument to uppercase if possible. - * If not possible (for example, '2'), returns the argument. - * - * toupper() acts as if it returns ctype<char>::do_toupper(c). - * do_toupper() must always return the same result for the same input. - * - * @param c The char to convert. - * @return The uppercase char if convertible, else @a c. - */ - char_type - toupper(char_type __c) const - { return this->do_toupper(__c); } - - /** - * @brief Convert array to uppercase. - * - * This function converts each char in the range [lo,hi) to uppercase - * if possible. Other chars remain untouched. - * - * toupper() acts as if it returns ctype<char>:: do_toupper(lo, hi). - * do_toupper() must always return the same result for the same input. - * - * @param lo Pointer to first char in range. - * @param hi Pointer to end of range. - * @return @a hi. - */ - const char_type* - toupper(char_type *__lo, const char_type* __hi) const - { return this->do_toupper(__lo, __hi); } - - /** - * @brief Convert to lowercase. - * - * This function converts the char argument to lowercase if possible. - * If not possible (for example, '2'), returns the argument. - * - * tolower() acts as if it returns ctype<char>::do_tolower(c). - * do_tolower() must always return the same result for the same input. - * - * @param c The char to convert. - * @return The lowercase char if convertible, else @a c. - */ - char_type - tolower(char_type __c) const - { return this->do_tolower(__c); } - - /** - * @brief Convert array to lowercase. - * - * This function converts each char in the range [lo,hi) to lowercase - * if possible. Other chars remain untouched. - * - * tolower() acts as if it returns ctype<char>:: do_tolower(lo, hi). - * do_tolower() must always return the same result for the same input. - * - * @param lo Pointer to first char in range. - * @param hi Pointer to end of range. - * @return @a hi. - */ - const char_type* - tolower(char_type* __lo, const char_type* __hi) const - { return this->do_tolower(__lo, __hi); } - - /** - * @brief Widen char - * - * This function converts the char to char_type using the simplest - * reasonable transformation. For an underived ctype<char> facet, the - * argument will be returned unchanged. - * - * This function works as if it returns ctype<char>::do_widen(c). - * do_widen() must always return the same result for the same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param c The char to convert. - * @return The converted character. - */ - char_type - widen(char __c) const - { - if (_M_widen_ok) - return _M_widen[static_cast<unsigned char>(__c)]; - this->_M_widen_init(); - return this->do_widen(__c); - } - - /** - * @brief Widen char array - * - * This function converts each char in the input to char using the - * simplest reasonable transformation. For an underived ctype<char> - * facet, the argument will be copied unchanged. - * - * This function works as if it returns ctype<char>::do_widen(c). - * do_widen() must always return the same result for the same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param lo Pointer to first char in range. - * @param hi Pointer to end of range. - * @param to Pointer to the destination array. - * @return @a hi. - */ - const char* - widen(const char* __lo, const char* __hi, char_type* __to) const - { - if (_M_widen_ok == 1) - { - memcpy(__to, __lo, __hi - __lo); - return __hi; - } - if (!_M_widen_ok) - _M_widen_init(); - return this->do_widen(__lo, __hi, __to); - } - - /** - * @brief Narrow char - * - * This function converts the char to char using the simplest - * reasonable transformation. If the conversion fails, dfault is - * returned instead. For an underived ctype<char> facet, @a c - * will be returned unchanged. - * - * This function works as if it returns ctype<char>::do_narrow(c). - * do_narrow() must always return the same result for the same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param c The char to convert. - * @param dfault Char to return if conversion fails. - * @return The converted character. - */ - char - narrow(char_type __c, char __dfault) const - { - if (_M_narrow[static_cast<unsigned char>(__c)]) - return _M_narrow[static_cast<unsigned char>(__c)]; - const char __t = do_narrow(__c, __dfault); - if (__t != __dfault) - _M_narrow[static_cast<unsigned char>(__c)] = __t; - return __t; - } - - /** - * @brief Narrow char array - * - * This function converts each char in the input to char using the - * simplest reasonable transformation and writes the results to the - * destination array. For any char in the input that cannot be - * converted, @a dfault is used instead. For an underived ctype<char> - * facet, the argument will be copied unchanged. - * - * This function works as if it returns ctype<char>::do_narrow(lo, hi, - * dfault, to). do_narrow() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @param dfault Char to use if conversion fails. - * @param to Pointer to the destination array. - * @return @a hi. - */ - const char_type* - narrow(const char_type* __lo, const char_type* __hi, - char __dfault, char *__to) const - { - if (__builtin_expect(_M_narrow_ok == 1, true)) - { - memcpy(__to, __lo, __hi - __lo); - return __hi; - } - if (!_M_narrow_ok) - _M_narrow_init(); - return this->do_narrow(__lo, __hi, __dfault, __to); - } - - protected: - /// Returns a pointer to the mask table provided to the constructor, or - /// the default from classic_table() if none was provided. - const mask* - table() const throw() - { return _M_table; } - - /// Returns a pointer to the C locale mask table. - static const mask* - classic_table() throw(); - - /** - * @brief Destructor. - * - * This function deletes table() if @a del was true in the - * constructor. - */ - virtual - ~ctype(); - - /** - * @brief Convert to uppercase. - * - * This virtual function converts the char argument to uppercase if - * possible. If not possible (for example, '2'), returns the argument. - * - * do_toupper() is a hook for a derived facet to change the behavior of - * uppercasing. do_toupper() must always return the same result for - * the same input. - * - * @param c The char to convert. - * @return The uppercase char if convertible, else @a c. - */ - virtual char_type - do_toupper(char_type) const; - - /** - * @brief Convert array to uppercase. - * - * This virtual function converts each char in the range [lo,hi) to - * uppercase if possible. Other chars remain untouched. - * - * do_toupper() is a hook for a derived facet to change the behavior of - * uppercasing. do_toupper() must always return the same result for - * the same input. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return @a hi. - */ - virtual const char_type* - do_toupper(char_type* __lo, const char_type* __hi) const; - - /** - * @brief Convert to lowercase. - * - * This virtual function converts the char argument to lowercase if - * possible. If not possible (for example, '2'), returns the argument. - * - * do_tolower() is a hook for a derived facet to change the behavior of - * lowercasing. do_tolower() must always return the same result for - * the same input. - * - * @param c The char to convert. - * @return The lowercase char if convertible, else @a c. - */ - virtual char_type - do_tolower(char_type) const; - - /** - * @brief Convert array to lowercase. - * - * This virtual function converts each char in the range [lo,hi) to - * lowercase if possible. Other chars remain untouched. - * - * do_tolower() is a hook for a derived facet to change the behavior of - * lowercasing. do_tolower() must always return the same result for - * the same input. - * - * @param lo Pointer to first char in range. - * @param hi Pointer to end of range. - * @return @a hi. - */ - virtual const char_type* - do_tolower(char_type* __lo, const char_type* __hi) const; - - /** - * @brief Widen char - * - * This virtual function converts the char to char using the simplest - * reasonable transformation. For an underived ctype<char> facet, the - * argument will be returned unchanged. - * - * do_widen() is a hook for a derived facet to change the behavior of - * widening. do_widen() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param c The char to convert. - * @return The converted character. - */ - virtual char_type - do_widen(char __c) const - { return __c; } - - /** - * @brief Widen char array - * - * This function converts each char in the range [lo,hi) to char using - * the simplest reasonable transformation. For an underived - * ctype<char> facet, the argument will be copied unchanged. - * - * do_widen() is a hook for a derived facet to change the behavior of - * widening. do_widen() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @param to Pointer to the destination array. - * @return @a hi. - */ - virtual const char* - do_widen(const char* __lo, const char* __hi, char_type* __dest) const - { - memcpy(__dest, __lo, __hi - __lo); - return __hi; - } - - /** - * @brief Narrow char - * - * This virtual function converts the char to char using the simplest - * reasonable transformation. If the conversion fails, dfault is - * returned instead. For an underived ctype<char> facet, @a c will be - * returned unchanged. - * - * do_narrow() is a hook for a derived facet to change the behavior of - * narrowing. do_narrow() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param c The char to convert. - * @param dfault Char to return if conversion fails. - * @return The converted char. - */ - virtual char - do_narrow(char_type __c, char) const - { return __c; } - - /** - * @brief Narrow char array to char array - * - * This virtual function converts each char in the range [lo,hi) to - * char using the simplest reasonable transformation and writes the - * results to the destination array. For any char in the input that - * cannot be converted, @a dfault is used instead. For an underived - * ctype<char> facet, the argument will be copied unchanged. - * - * do_narrow() is a hook for a derived facet to change the behavior of - * narrowing. do_narrow() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @param dfault Char to use if conversion fails. - * @param to Pointer to the destination array. - * @return @a hi. - */ - virtual const char_type* - do_narrow(const char_type* __lo, const char_type* __hi, - char, char* __dest) const - { - memcpy(__dest, __lo, __hi - __lo); - return __hi; - } - - private: - - void _M_widen_init() const - { - char __tmp[sizeof(_M_widen)]; - for (size_t __i = 0; __i < sizeof(_M_widen); ++__i) - __tmp[__i] = __i; - do_widen(__tmp, __tmp + sizeof(__tmp), _M_widen); - - _M_widen_ok = 1; - // Set _M_widen_ok to 2 if memcpy can't be used. - if (memcmp(__tmp, _M_widen, sizeof(_M_widen))) - _M_widen_ok = 2; - } - - // Fill in the narrowing cache and flag whether all values are - // valid or not. _M_narrow_ok is set to 2 if memcpy can't - // be used. - void _M_narrow_init() const - { - char __tmp[sizeof(_M_narrow)]; - for (size_t __i = 0; __i < sizeof(_M_narrow); ++__i) - __tmp[__i] = __i; - do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow); - - _M_narrow_ok = 1; - if (memcmp(__tmp, _M_narrow, sizeof(_M_narrow))) - _M_narrow_ok = 2; - else - { - // Deal with the special case of zero: renarrow with a - // different default and compare. - char __c; - do_narrow(__tmp, __tmp + 1, 1, &__c); - if (__c == 1) - _M_narrow_ok = 2; - } - } - }; - - template<> - const ctype<char>& - use_facet<ctype<char> >(const locale& __loc); - -#ifdef _GLIBCXX_USE_WCHAR_T - // 22.2.1.3 ctype<wchar_t> specialization - /** - * @brief The ctype<wchar_t> specialization. - * - * This class defines classification and conversion functions for the - * wchar_t type. It gets used by wchar_t streams for many I/O operations. - * The wchar_t specialization provides a number of optimizations as well. - * - * ctype<wchar_t> inherits its public methods from - * __ctype_abstract_base<wchar_t>. - */ - template<> - class ctype<wchar_t> : public __ctype_abstract_base<wchar_t> - { - public: - // Types: - /// Typedef for the template parameter wchar_t. - typedef wchar_t char_type; - typedef wctype_t __wmask_type; - - protected: - __c_locale _M_c_locale_ctype; - - // Pre-computed narrowed and widened chars. - bool _M_narrow_ok; - char _M_narrow[128]; - wint_t _M_widen[1 + static_cast<unsigned char>(-1)]; - - // Pre-computed elements for do_is. - mask _M_bit[16]; - __wmask_type _M_wmask[16]; - - public: - // Data Members: - /// The facet id for ctype<wchar_t> - static locale::id id; - - /** - * @brief Constructor performs initialization. - * - * This is the constructor provided by the standard. - * - * @param refs Passed to the base facet class. - */ - explicit - ctype(size_t __refs = 0); - - /** - * @brief Constructor performs static initialization. - * - * This constructor is used to construct the initial C locale facet. - * - * @param cloc Handle to C locale data. - * @param refs Passed to the base facet class. - */ - explicit - ctype(__c_locale __cloc, size_t __refs = 0); - - protected: - __wmask_type - _M_convert_to_wmask(const mask __m) const; - - /// Destructor - virtual - ~ctype(); - - /** - * @brief Test wchar_t classification. - * - * This function finds a mask M for @a c and compares it to mask @a m. - * - * do_is() is a hook for a derived facet to change the behavior of - * classifying. do_is() must always return the same result for the - * same input. - * - * @param c The wchar_t to find the mask of. - * @param m The mask to compare against. - * @return (M & m) != 0. - */ - virtual bool - do_is(mask __m, char_type __c) const; - - /** - * @brief Return a mask array. - * - * This function finds the mask for each wchar_t in the range [lo,hi) - * and successively writes it to vec. vec must have as many elements - * as the input. - * - * do_is() is a hook for a derived facet to change the behavior of - * classifying. do_is() must always return the same result for the - * same input. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @param vec Pointer to an array of mask storage. - * @return @a hi. - */ - virtual const char_type* - do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const; - - /** - * @brief Find wchar_t matching mask - * - * This function searches for and returns the first wchar_t c in - * [lo,hi) for which is(m,c) is true. - * - * do_scan_is() is a hook for a derived facet to change the behavior of - * match searching. do_is() must always return the same result for the - * same input. - * - * @param m The mask to compare against. - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return Pointer to a matching wchar_t if found, else @a hi. - */ - virtual const char_type* - do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const; - - /** - * @brief Find wchar_t not matching mask - * - * This function searches for and returns a pointer to the first - * wchar_t c of [lo,hi) for which is(m,c) is false. - * - * do_scan_is() is a hook for a derived facet to change the behavior of - * match searching. do_is() must always return the same result for the - * same input. - * - * @param m The mask to compare against. - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return Pointer to a non-matching wchar_t if found, else @a hi. - */ - virtual const char_type* - do_scan_not(mask __m, const char_type* __lo, - const char_type* __hi) const; - - /** - * @brief Convert to uppercase. - * - * This virtual function converts the wchar_t argument to uppercase if - * possible. If not possible (for example, '2'), returns the argument. - * - * do_toupper() is a hook for a derived facet to change the behavior of - * uppercasing. do_toupper() must always return the same result for - * the same input. - * - * @param c The wchar_t to convert. - * @return The uppercase wchar_t if convertible, else @a c. - */ - virtual char_type - do_toupper(char_type) const; - - /** - * @brief Convert array to uppercase. - * - * This virtual function converts each wchar_t in the range [lo,hi) to - * uppercase if possible. Other elements remain untouched. - * - * do_toupper() is a hook for a derived facet to change the behavior of - * uppercasing. do_toupper() must always return the same result for - * the same input. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return @a hi. - */ - virtual const char_type* - do_toupper(char_type* __lo, const char_type* __hi) const; - - /** - * @brief Convert to lowercase. - * - * This virtual function converts the argument to lowercase if - * possible. If not possible (for example, '2'), returns the argument. - * - * do_tolower() is a hook for a derived facet to change the behavior of - * lowercasing. do_tolower() must always return the same result for - * the same input. - * - * @param c The wchar_t to convert. - * @return The lowercase wchar_t if convertible, else @a c. - */ - virtual char_type - do_tolower(char_type) const; - - /** - * @brief Convert array to lowercase. - * - * This virtual function converts each wchar_t in the range [lo,hi) to - * lowercase if possible. Other elements remain untouched. - * - * do_tolower() is a hook for a derived facet to change the behavior of - * lowercasing. do_tolower() must always return the same result for - * the same input. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @return @a hi. - */ - virtual const char_type* - do_tolower(char_type* __lo, const char_type* __hi) const; - - /** - * @brief Widen char to wchar_t - * - * This virtual function converts the char to wchar_t using the - * simplest reasonable transformation. For an underived ctype<wchar_t> - * facet, the argument will be cast to wchar_t. - * - * do_widen() is a hook for a derived facet to change the behavior of - * widening. do_widen() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param c The char to convert. - * @return The converted wchar_t. - */ - virtual char_type - do_widen(char) const; - - /** - * @brief Widen char array to wchar_t array - * - * This function converts each char in the input to wchar_t using the - * simplest reasonable transformation. For an underived ctype<wchar_t> - * facet, the argument will be copied, casting each element to wchar_t. - * - * do_widen() is a hook for a derived facet to change the behavior of - * widening. do_widen() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param lo Pointer to start range. - * @param hi Pointer to end of range. - * @param to Pointer to the destination array. - * @return @a hi. - */ - virtual const char* - do_widen(const char* __lo, const char* __hi, char_type* __dest) const; - - /** - * @brief Narrow wchar_t to char - * - * This virtual function converts the argument to char using - * the simplest reasonable transformation. If the conversion - * fails, dfault is returned instead. For an underived - * ctype<wchar_t> facet, @a c will be cast to char and - * returned. - * - * do_narrow() is a hook for a derived facet to change the - * behavior of narrowing. do_narrow() must always return the - * same result for the same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param c The wchar_t to convert. - * @param dfault Char to return if conversion fails. - * @return The converted char. - */ - virtual char - do_narrow(char_type, char __dfault) const; - - /** - * @brief Narrow wchar_t array to char array - * - * This virtual function converts each wchar_t in the range [lo,hi) to - * char using the simplest reasonable transformation and writes the - * results to the destination array. For any wchar_t in the input that - * cannot be converted, @a dfault is used instead. For an underived - * ctype<wchar_t> facet, the argument will be copied, casting each - * element to char. - * - * do_narrow() is a hook for a derived facet to change the behavior of - * narrowing. do_narrow() must always return the same result for the - * same input. - * - * Note: this is not what you want for codepage conversions. See - * codecvt for that. - * - * @param lo Pointer to start of range. - * @param hi Pointer to end of range. - * @param dfault Char to use if conversion fails. - * @param to Pointer to the destination array. - * @return @a hi. - */ - virtual const char_type* - do_narrow(const char_type* __lo, const char_type* __hi, - char __dfault, char* __dest) const; - - // For use at construction time only. - void - _M_initialize_ctype(); - }; - - template<> - const ctype<wchar_t>& - use_facet<ctype<wchar_t> >(const locale& __loc); -#endif //_GLIBCXX_USE_WCHAR_T - - // Include host and configuration specific ctype inlines. - #include <bits/ctype_inline.h> - - // 22.2.1.2 Template class ctype_byname - template<typename _CharT> - class ctype_byname : public ctype<_CharT> - { - public: - typedef _CharT char_type; - - explicit - ctype_byname(const char* __s, size_t __refs = 0); - - protected: - virtual - ~ctype_byname() { }; - }; - - // 22.2.1.4 Class ctype_byname specializations. - template<> - ctype_byname<char>::ctype_byname(const char*, size_t refs); - - template<> - ctype_byname<wchar_t>::ctype_byname(const char*, size_t refs); - - // 22.2.1.5 Template class codecvt - #include <bits/codecvt.h> - - // 22.2.2 The numeric category. - class __num_base - { - public: - // NB: Code depends on the order of _S_atoms_out elements. - // Below are the indices into _S_atoms_out. - enum - { - _S_ominus, - _S_oplus, - _S_ox, - _S_oX, - _S_odigits, - _S_odigits_end = _S_odigits + 16, - _S_oudigits = _S_odigits_end, - _S_oudigits_end = _S_oudigits + 16, - _S_oe = _S_odigits + 14, // For scientific notation, 'e' - _S_oE = _S_oudigits + 14, // For scientific notation, 'E' - _S_oend = _S_oudigits_end - }; - - // A list of valid numeric literals for output. This array - // contains chars that will be passed through the current locale's - // ctype<_CharT>.widen() and then used to render numbers. - // For the standard "C" locale, this is - // "-+xX0123456789abcdef0123456789ABCDEF". - static const char* _S_atoms_out; - - // String literal of acceptable (narrow) input, for num_get. - // "-+xX0123456789abcdefABCDEF" - static const char* _S_atoms_in; - - enum - { - _S_iminus, - _S_iplus, - _S_ix, - _S_iX, - _S_izero, - _S_ie = _S_izero + 14, - _S_iE = _S_izero + 20, - _S_iend = 26 - }; - - // num_put - // Construct and return valid scanf format for floating point types. - static void - _S_format_float(const ios_base& __io, char* __fptr, char __mod); - }; - - template<typename _CharT> - struct __numpunct_cache : public locale::facet - { - const char* _M_grouping; - size_t _M_grouping_size; - bool _M_use_grouping; - const _CharT* _M_truename; - size_t _M_truename_size; - const _CharT* _M_falsename; - size_t _M_falsename_size; - _CharT _M_decimal_point; - _CharT _M_thousands_sep; - - // A list of valid numeric literals for output: in the standard - // "C" locale, this is "-+xX0123456789abcdef0123456789ABCDEF". - // This array contains the chars after having been passed - // through the current locale's ctype<_CharT>.widen(). - _CharT _M_atoms_out[__num_base::_S_oend]; - - // A list of valid numeric literals for input: in the standard - // "C" locale, this is "-+xX0123456789abcdefABCDEF" - // This array contains the chars after having been passed - // through the current locale's ctype<_CharT>.widen(). - _CharT _M_atoms_in[__num_base::_S_iend]; - - bool _M_allocated; - - __numpunct_cache(size_t __refs = 0) : facet(__refs), - _M_grouping(NULL), _M_grouping_size(0), _M_use_grouping(false), - _M_truename(NULL), _M_truename_size(0), _M_falsename(NULL), - _M_falsename_size(0), _M_decimal_point(_CharT()), - _M_thousands_sep(_CharT()), _M_allocated(false) - { } - - ~__numpunct_cache(); - - void - _M_cache(const locale& __loc); - - private: - __numpunct_cache& - operator=(const __numpunct_cache&); - - explicit - __numpunct_cache(const __numpunct_cache&); - }; - - template<typename _CharT> - __numpunct_cache<_CharT>::~__numpunct_cache() - { - if (_M_allocated) - { - delete [] _M_grouping; - delete [] _M_truename; - delete [] _M_falsename; - } - } - - /** - * @brief Numpunct facet. - * - * This facet stores several pieces of information related to printing and - * scanning numbers, such as the decimal point character. It takes a - * template parameter specifying the char type. The numpunct facet is - * used by streams for many I/O operations involving numbers. - * - * The numpunct template uses protected virtual functions to provide the - * actual results. The public accessors forward the call to the virtual - * functions. These virtual functions are hooks for developers to - * implement the behavior they require from a numpunct facet. - */ - template<typename _CharT> - class numpunct : public locale::facet - { - public: - // Types: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; - //@} - typedef __numpunct_cache<_CharT> __cache_type; - - protected: - __cache_type* _M_data; - - public: - /// Numpunct facet id. - static locale::id id; - - /** - * @brief Numpunct constructor. - * - * @param refs Refcount to pass to the base class. - */ - explicit - numpunct(size_t __refs = 0) : facet(__refs), _M_data(NULL) - { _M_initialize_numpunct(); } - - /** - * @brief Internal constructor. Not for general use. - * - * This is a constructor for use by the library itself to set up the - * predefined locale facets. - * - * @param cache __numpunct_cache object. - * @param refs Refcount to pass to the base class. - */ - explicit - numpunct(__cache_type* __cache, size_t __refs = 0) - : facet(__refs), _M_data(__cache) - { _M_initialize_numpunct(); } - - /** - * @brief Internal constructor. Not for general use. - * - * This is a constructor for use by the library itself to set up new - * locales. - * - * @param cloc The "C" locale. - * @param refs Refcount to pass to the base class. - */ - explicit - numpunct(__c_locale __cloc, size_t __refs = 0) - : facet(__refs), _M_data(NULL) - { _M_initialize_numpunct(__cloc); } - - /** - * @brief Return decimal point character. - * - * This function returns a char_type to use as a decimal point. It - * does so by returning returning - * numpunct<char_type>::do_decimal_point(). - * - * @return @a char_type representing a decimal point. - */ - char_type - decimal_point() const - { return this->do_decimal_point(); } - - /** - * @brief Return thousands separator character. - * - * This function returns a char_type to use as a thousands - * separator. It does so by returning returning - * numpunct<char_type>::do_thousands_sep(). - * - * @return char_type representing a thousands separator. - */ - char_type - thousands_sep() const - { return this->do_thousands_sep(); } - - /** - * @brief Return grouping specification. - * - * This function returns a string representing groupings for the - * integer part of a number. Groupings indicate where thousands - * separators should be inserted in the integer part of a number. - * - * Each char in the return string is interpret as an integer - * rather than a character. These numbers represent the number - * of digits in a group. The first char in the string - * represents the number of digits in the least significant - * group. If a char is negative, it indicates an unlimited - * number of digits for the group. If more chars from the - * string are required to group a number, the last char is used - * repeatedly. - * - * For example, if the grouping() returns "\003\002" and is - * applied to the number 123456789, this corresponds to - * 12,34,56,789. Note that if the string was "32", this would - * put more than 50 digits into the least significant group if - * the character set is ASCII. - * - * The string is returned by calling - * numpunct<char_type>::do_grouping(). - * - * @return string representing grouping specification. - */ - string - grouping() const - { return this->do_grouping(); } - - /** - * @brief Return string representation of bool true. - * - * This function returns a string_type containing the text - * representation for true bool variables. It does so by calling - * numpunct<char_type>::do_truename(). - * - * @return string_type representing printed form of true. - */ - string_type - truename() const - { return this->do_truename(); } - - /** - * @brief Return string representation of bool false. - * - * This function returns a string_type containing the text - * representation for false bool variables. It does so by calling - * numpunct<char_type>::do_falsename(). - * - * @return string_type representing printed form of false. - */ - string_type - falsename() const - { return this->do_falsename(); } - - protected: - /// Destructor. - virtual - ~numpunct(); - - /** - * @brief Return decimal point character. - * - * Returns a char_type to use as a decimal point. This function is a - * hook for derived classes to change the value returned. - * - * @return @a char_type representing a decimal point. - */ - virtual char_type - do_decimal_point() const - { return _M_data->_M_decimal_point; } - - /** - * @brief Return thousands separator character. - * - * Returns a char_type to use as a thousands separator. This function - * is a hook for derived classes to change the value returned. - * - * @return @a char_type representing a thousands separator. - */ - virtual char_type - do_thousands_sep() const - { return _M_data->_M_thousands_sep; } - - /** - * @brief Return grouping specification. - * - * Returns a string representing groupings for the integer part of a - * number. This function is a hook for derived classes to change the - * value returned. @see grouping() for details. - * - * @return String representing grouping specification. - */ - virtual string - do_grouping() const - { return _M_data->_M_grouping; } - - /** - * @brief Return string representation of bool true. - * - * Returns a string_type containing the text representation for true - * bool variables. This function is a hook for derived classes to - * change the value returned. - * - * @return string_type representing printed form of true. - */ - virtual string_type - do_truename() const - { return _M_data->_M_truename; } - - /** - * @brief Return string representation of bool false. - * - * Returns a string_type containing the text representation for false - * bool variables. This function is a hook for derived classes to - * change the value returned. - * - * @return string_type representing printed form of false. - */ - virtual string_type - do_falsename() const - { return _M_data->_M_falsename; } - - // For use at construction time only. - void - _M_initialize_numpunct(__c_locale __cloc = NULL); - }; - - template<typename _CharT> - locale::id numpunct<_CharT>::id; - - template<> - numpunct<char>::~numpunct(); - - template<> - void - numpunct<char>::_M_initialize_numpunct(__c_locale __cloc); - -#ifdef _GLIBCXX_USE_WCHAR_T - template<> - numpunct<wchar_t>::~numpunct(); - - template<> - void - numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc); -#endif - - template<typename _CharT> - class numpunct_byname : public numpunct<_CharT> - { - public: - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; - - explicit - numpunct_byname(const char* __s, size_t __refs = 0) - : numpunct<_CharT>(__refs) - { - if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) - { - __c_locale __tmp; - this->_S_create_c_locale(__tmp, __s); - this->_M_initialize_numpunct(__tmp); - this->_S_destroy_c_locale(__tmp); - } - } - - protected: - virtual - ~numpunct_byname() { } - }; - - /** - * @brief Facet for parsing number strings. - * - * This facet encapsulates the code to parse and return a number - * from a string. It is used by the istream numeric extraction - * operators. - * - * The num_get template uses protected virtual functions to provide the - * actual results. The public accessors forward the call to the virtual - * functions. These virtual functions are hooks for developers to - * implement the behavior they require from the num_get facet. - */ - template<typename _CharT, typename _InIter> - class num_get : public locale::facet - { - public: - // Types: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef _InIter iter_type; - //@} - - /// Numpunct facet id. - static locale::id id; - - /** - * @brief Constructor performs initialization. - * - * This is the constructor provided by the standard. - * - * @param refs Passed to the base facet class. - */ - explicit - num_get(size_t __refs = 0) : facet(__refs) { } - - /** - * @brief Numeric parsing. - * - * Parses the input stream into the bool @a v. It does so by calling - * num_put::do_put(). - * - * If ios_base::boolalpha is set, attempts to read - * ctype<CharT>::truename() or ctype<CharT>::falsename(). Sets - * @a v to true or false if successful. Sets err to - * ios_base::failbit if reading the string fails. Sets err to - * ios_base::eofbit if the stream is emptied. - * - * If ios_base::boolalpha is not set, proceeds as with reading a long, - * except if the value is 1, sets @a v to true, if the value is 0, sets - * @a v to false, and otherwise set err to ios_base::failbit. - * - * @param in Start of input stream. - * @param end End of input stream. - * @param io Source of locale and flags. - * @param err Error flags to set. - * @param v Value to format and insert. - * @return Iterator after reading. - */ - iter_type - get(iter_type __in, iter_type __end, ios_base& __io, - ios_base::iostate& __err, bool& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } - - //@{ - /** - * @brief Numeric parsing. - * - * Parses the input stream into the integral variable @a v. It does so - * by calling num_put::do_put(). - * - * Parsing is affected by the flag settings in @a io. - * - * The basic parse is affected by the value of io.flags() & - * ios_base::basefield. If equal to ios_base::oct, parses like the - * scanf %o specifier. Else if equal to ios_base::hex, parses like %X - * specifier. Else if basefield equal to 0, parses like the %i - * specifier. Otherwise, parses like %d for signed and %u for unsigned - * types. The matching type length modifier is also used. - * - * Digit grouping is intrepreted according to numpunct::grouping() and - * numpunct::thousands_sep(). If the pattern of digit groups isn't - * consistent, sets err to ios_base::failbit. - * - * If parsing the string yields a valid value for @a v, @a v is set. - * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered. - * Sets err to ios_base::eofbit if the stream is emptied. - * - * @param in Start of input stream. - * @param end End of input stream. - * @param io Source of locale and flags. - * @param err Error flags to set. - * @param v Value to format and insert. - * @return Iterator after reading. - */ - iter_type - get(iter_type __in, iter_type __end, ios_base& __io, - ios_base::iostate& __err, long& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } - - iter_type - get(iter_type __in, iter_type __end, ios_base& __io, - ios_base::iostate& __err, unsigned short& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } - - iter_type - get(iter_type __in, iter_type __end, ios_base& __io, - ios_base::iostate& __err, unsigned int& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } - - iter_type - get(iter_type __in, iter_type __end, ios_base& __io, - ios_base::iostate& __err, unsigned long& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } - -#ifdef _GLIBCXX_USE_LONG_LONG - iter_type - get(iter_type __in, iter_type __end, ios_base& __io, - ios_base::iostate& __err, long long& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } - - iter_type - get(iter_type __in, iter_type __end, ios_base& __io, - ios_base::iostate& __err, unsigned long long& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } -#endif - //@} - - //@{ - /** - * @brief Numeric parsing. - * - * Parses the input stream into the integral variable @a v. It does so - * by calling num_put::do_put(). - * - * The input characters are parsed like the scanf %g specifier. The - * matching type length modifier is also used. - * - * The decimal point character used is numpunct::decimal_point(). - * Digit grouping is intrepreted according to numpunct::grouping() and - * numpunct::thousands_sep(). If the pattern of digit groups isn't - * consistent, sets err to ios_base::failbit. - * - * If parsing the string yields a valid value for @a v, @a v is set. - * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered. - * Sets err to ios_base::eofbit if the stream is emptied. - * - * @param in Start of input stream. - * @param end End of input stream. - * @param io Source of locale and flags. - * @param err Error flags to set. - * @param v Value to format and insert. - * @return Iterator after reading. - */ - iter_type - get(iter_type __in, iter_type __end, ios_base& __io, - ios_base::iostate& __err, float& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } - - iter_type - get(iter_type __in, iter_type __end, ios_base& __io, - ios_base::iostate& __err, double& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } - - iter_type - get(iter_type __in, iter_type __end, ios_base& __io, - ios_base::iostate& __err, long double& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } - //@} - - /** - * @brief Numeric parsing. - * - * Parses the input stream into the pointer variable @a v. It does so - * by calling num_put::do_put(). - * - * The input characters are parsed like the scanf %p specifier. - * - * Digit grouping is intrepreted according to numpunct::grouping() and - * numpunct::thousands_sep(). If the pattern of digit groups isn't - * consistent, sets err to ios_base::failbit. - * - * Note that the digit grouping effect for pointers is a bit ambiguous - * in the standard and shouldn't be relied on. See DR 344. - * - * If parsing the string yields a valid value for @a v, @a v is set. - * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered. - * Sets err to ios_base::eofbit if the stream is emptied. - * - * @param in Start of input stream. - * @param end End of input stream. - * @param io Source of locale and flags. - * @param err Error flags to set. - * @param v Value to format and insert. - * @return Iterator after reading. - */ - iter_type - get(iter_type __in, iter_type __end, ios_base& __io, - ios_base::iostate& __err, void*& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } - - protected: - /// Destructor. - virtual ~num_get() { } - - iter_type - _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&, - string& __xtrc) const; - - template<typename _ValueT> - iter_type - _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&, - _ValueT& __v) const; - - //@{ - /** - * @brief Numeric parsing. - * - * Parses the input stream into the variable @a v. This function is a - * hook for derived classes to change the value returned. @see get() - * for more details. - * - * @param in Start of input stream. - * @param end End of input stream. - * @param io Source of locale and flags. - * @param err Error flags to set. - * @param v Value to format and insert. - * @return Iterator after reading. - */ - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const; - - - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, long&) const; - - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, - unsigned short&) const; - - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, - unsigned int&) const; - - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, - unsigned long&) const; - -#ifdef _GLIBCXX_USE_LONG_LONG - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, - long long&) const; - - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, - unsigned long long&) const; -#endif - - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, - float&) const; - - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, - double&) const; - - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, - long double&) const; - - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, - void*&) const; - //@} - }; - - template<typename _CharT, typename _InIter> - locale::id num_get<_CharT, _InIter>::id; - - - /** - * @brief Facet for converting numbers to strings. - * - * This facet encapsulates the code to convert a number to a string. It is - * used by the ostream numeric insertion operators. - * - * The num_put template uses protected virtual functions to provide the - * actual results. The public accessors forward the call to the virtual - * functions. These virtual functions are hooks for developers to - * implement the behavior they require from the num_put facet. - */ - template<typename _CharT, typename _OutIter> - class num_put : public locale::facet - { - public: - // Types: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef _OutIter iter_type; - //@} - - /// Numpunct facet id. - static locale::id id; - - /** - * @brief Constructor performs initialization. - * - * This is the constructor provided by the standard. - * - * @param refs Passed to the base facet class. - */ - explicit - num_put(size_t __refs = 0) : facet(__refs) { } - - /** - * @brief Numeric formatting. - * - * Formats the boolean @a v and inserts it into a stream. It does so - * by calling num_put::do_put(). - * - * If ios_base::boolalpha is set, writes ctype<CharT>::truename() or - * ctype<CharT>::falsename(). Otherwise formats @a v as an int. - * - * @param s Stream to write to. - * @param io Source of locale and flags. - * @param fill Char_type to use for filling. - * @param v Value to format and insert. - * @return Iterator after writing. - */ - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const - { return this->do_put(__s, __f, __fill, __v); } - - //@{ - /** - * @brief Numeric formatting. - * - * Formats the integral value @a v and inserts it into a - * stream. It does so by calling num_put::do_put(). - * - * Formatting is affected by the flag settings in @a io. - * - * The basic format is affected by the value of io.flags() & - * ios_base::basefield. If equal to ios_base::oct, formats like the - * printf %o specifier. Else if equal to ios_base::hex, formats like - * %x or %X with ios_base::uppercase unset or set respectively. - * Otherwise, formats like %d, %ld, %lld for signed and %u, %lu, %llu - * for unsigned values. Note that if both oct and hex are set, neither - * will take effect. - * - * If ios_base::showpos is set, '+' is output before positive values. - * If ios_base::showbase is set, '0' precedes octal values (except 0) - * and '0[xX]' precedes hex values. - * - * Thousands separators are inserted according to numpunct::grouping() - * and numpunct::thousands_sep(). The decimal point character used is - * numpunct::decimal_point(). - * - * If io.width() is non-zero, enough @a fill characters are inserted to - * make the result at least that wide. If - * (io.flags() & ios_base::adjustfield) == ios_base::left, result is - * padded at the end. If ios_base::internal, then padding occurs - * immediately after either a '+' or '-' or after '0x' or '0X'. - * Otherwise, padding occurs at the beginning. - * - * @param s Stream to write to. - * @param io Source of locale and flags. - * @param fill Char_type to use for filling. - * @param v Value to format and insert. - * @return Iterator after writing. - */ - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, long __v) const - { return this->do_put(__s, __f, __fill, __v); } - - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, - unsigned long __v) const - { return this->do_put(__s, __f, __fill, __v); } - -#ifdef _GLIBCXX_USE_LONG_LONG - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const - { return this->do_put(__s, __f, __fill, __v); } - - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, - unsigned long long __v) const - { return this->do_put(__s, __f, __fill, __v); } -#endif - //@} - - //@{ - /** - * @brief Numeric formatting. - * - * Formats the floating point value @a v and inserts it into a stream. - * It does so by calling num_put::do_put(). - * - * Formatting is affected by the flag settings in @a io. - * - * The basic format is affected by the value of io.flags() & - * ios_base::floatfield. If equal to ios_base::fixed, formats like the - * printf %f specifier. Else if equal to ios_base::scientific, formats - * like %e or %E with ios_base::uppercase unset or set respectively. - * Otherwise, formats like %g or %G depending on uppercase. Note that - * if both fixed and scientific are set, the effect will also be like - * %g or %G. - * - * The output precision is given by io.precision(). This precision is - * capped at numeric_limits::digits10 + 2 (different for double and - * long double). The default precision is 6. - * - * If ios_base::showpos is set, '+' is output before positive values. - * If ios_base::showpoint is set, a decimal point will always be - * output. - * - * Thousands separators are inserted according to numpunct::grouping() - * and numpunct::thousands_sep(). The decimal point character used is - * numpunct::decimal_point(). - * - * If io.width() is non-zero, enough @a fill characters are inserted to - * make the result at least that wide. If - * (io.flags() & ios_base::adjustfield) == ios_base::left, result is - * padded at the end. If ios_base::internal, then padding occurs - * immediately after either a '+' or '-' or after '0x' or '0X'. - * Otherwise, padding occurs at the beginning. - * - * @param s Stream to write to. - * @param io Source of locale and flags. - * @param fill Char_type to use for filling. - * @param v Value to format and insert. - * @return Iterator after writing. - */ - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, double __v) const - { return this->do_put(__s, __f, __fill, __v); } - - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, - long double __v) const - { return this->do_put(__s, __f, __fill, __v); } - //@} - - /** - * @brief Numeric formatting. - * - * Formats the pointer value @a v and inserts it into a stream. It - * does so by calling num_put::do_put(). - * - * This function formats @a v as an unsigned long with ios_base::hex - * and ios_base::showbase set. - * - * @param s Stream to write to. - * @param io Source of locale and flags. - * @param fill Char_type to use for filling. - * @param v Value to format and insert. - * @return Iterator after writing. - */ - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, - const void* __v) const - { return this->do_put(__s, __f, __fill, __v); } - - protected: - template<typename _ValueT> - iter_type - _M_insert_float(iter_type, ios_base& __io, char_type __fill, - char __mod, _ValueT __v) const; - - void - _M_group_float(const char* __grouping, size_t __grouping_size, - char_type __sep, const char_type* __p, char_type* __new, - char_type* __cs, int& __len) const; - - template<typename _ValueT> - iter_type - _M_insert_int(iter_type, ios_base& __io, char_type __fill, - _ValueT __v) const; - - void - _M_group_int(const char* __grouping, size_t __grouping_size, - char_type __sep, ios_base& __io, char_type* __new, - char_type* __cs, int& __len) const; - - void - _M_pad(char_type __fill, streamsize __w, ios_base& __io, - char_type* __new, const char_type* __cs, int& __len) const; - - /// Destructor. - virtual - ~num_put() { }; - - //@{ - /** - * @brief Numeric formatting. - * - * These functions do the work of formatting numeric values and - * inserting them into a stream. This function is a hook for derived - * classes to change the value returned. - * - * @param s Stream to write to. - * @param io Source of locale and flags. - * @param fill Char_type to use for filling. - * @param v Value to format and insert. - * @return Iterator after writing. - */ - virtual iter_type - do_put(iter_type, ios_base&, char_type __fill, bool __v) const; - - virtual iter_type - do_put(iter_type, ios_base&, char_type __fill, long __v) const; - - virtual iter_type - do_put(iter_type, ios_base&, char_type __fill, unsigned long) const; - -#ifdef _GLIBCXX_USE_LONG_LONG - virtual iter_type - do_put(iter_type, ios_base&, char_type __fill, long long __v) const; - - virtual iter_type - do_put(iter_type, ios_base&, char_type __fill, unsigned long long) const; -#endif - - virtual iter_type - do_put(iter_type, ios_base&, char_type __fill, double __v) const; - - virtual iter_type - do_put(iter_type, ios_base&, char_type __fill, long double __v) const; - - virtual iter_type - do_put(iter_type, ios_base&, char_type __fill, const void* __v) const; - //@} - }; - - template <typename _CharT, typename _OutIter> - locale::id num_put<_CharT, _OutIter>::id; - - - /** - * @brief Facet for localized string comparison. - * - * This facet encapsulates the code to compare strings in a localized - * manner. - * - * The collate template uses protected virtual functions to provide - * the actual results. The public accessors forward the call to - * the virtual functions. These virtual functions are hooks for - * developers to implement the behavior they require from the - * collate facet. - */ - template<typename _CharT> - class collate : public locale::facet - { - public: - // Types: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; - //@} - - protected: - // Underlying "C" library locale information saved from - // initialization, needed by collate_byname as well. - __c_locale _M_c_locale_collate; - - public: - /// Numpunct facet id. - static locale::id id; - - /** - * @brief Constructor performs initialization. - * - * This is the constructor provided by the standard. - * - * @param refs Passed to the base facet class. - */ - explicit - collate(size_t __refs = 0) - : facet(__refs), _M_c_locale_collate(_S_get_c_locale()) - { } - - /** - * @brief Internal constructor. Not for general use. - * - * This is a constructor for use by the library itself to set up new - * locales. - * - * @param cloc The "C" locale. - * @param refs Passed to the base facet class. - */ - explicit - collate(__c_locale __cloc, size_t __refs = 0) - : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc)) - { } - - /** - * @brief Compare two strings. - * - * This function compares two strings and returns the result by calling - * collate::do_compare(). - * - * @param lo1 Start of string 1. - * @param hi1 End of string 1. - * @param lo2 Start of string 2. - * @param hi2 End of string 2. - * @return 1 if string1 > string2, -1 if string1 < string2, else 0. - */ - int - compare(const _CharT* __lo1, const _CharT* __hi1, - const _CharT* __lo2, const _CharT* __hi2) const - { return this->do_compare(__lo1, __hi1, __lo2, __hi2); } - - /** - * @brief Transform string to comparable form. - * - * This function is a wrapper for strxfrm functionality. It takes the - * input string and returns a modified string that can be directly - * compared to other transformed strings. In the "C" locale, this - * function just returns a copy of the input string. In some other - * locales, it may replace two chars with one, change a char for - * another, etc. It does so by returning collate::do_transform(). - * - * @param lo Start of string. - * @param hi End of string. - * @return Transformed string_type. - */ - string_type - transform(const _CharT* __lo, const _CharT* __hi) const - { return this->do_transform(__lo, __hi); } - - /** - * @brief Return hash of a string. - * - * This function computes and returns a hash on the input string. It - * does so by returning collate::do_hash(). - * - * @param lo Start of string. - * @param hi End of string. - * @return Hash value. - */ - long - hash(const _CharT* __lo, const _CharT* __hi) const - { return this->do_hash(__lo, __hi); } - - // Used to abstract out _CharT bits in virtual member functions, below. - int - _M_compare(const _CharT*, const _CharT*) const; - - size_t - _M_transform(_CharT*, const _CharT*, size_t) const; - - protected: - /// Destructor. - virtual - ~collate() - { _S_destroy_c_locale(_M_c_locale_collate); } - - /** - * @brief Compare two strings. - * - * This function is a hook for derived classes to change the value - * returned. @see compare(). - * - * @param lo1 Start of string 1. - * @param hi1 End of string 1. - * @param lo2 Start of string 2. - * @param hi2 End of string 2. - * @return 1 if string1 > string2, -1 if string1 < string2, else 0. - */ - virtual int - do_compare(const _CharT* __lo1, const _CharT* __hi1, - const _CharT* __lo2, const _CharT* __hi2) const; - - /** - * @brief Transform string to comparable form. - * - * This function is a hook for derived classes to change the value - * returned. - * - * @param lo1 Start of string 1. - * @param hi1 End of string 1. - * @param lo2 Start of string 2. - * @param hi2 End of string 2. - * @return 1 if string1 > string2, -1 if string1 < string2, else 0. - */ - virtual string_type - do_transform(const _CharT* __lo, const _CharT* __hi) const; - - /** - * @brief Return hash of a string. - * - * This function computes and returns a hash on the input string. This - * function is a hook for derived classes to change the value returned. - * - * @param lo Start of string. - * @param hi End of string. - * @return Hash value. - */ - virtual long - do_hash(const _CharT* __lo, const _CharT* __hi) const; - }; - - template<typename _CharT> - locale::id collate<_CharT>::id; - - // Specializations. - template<> - int - collate<char>::_M_compare(const char*, const char*) const; - - template<> - size_t - collate<char>::_M_transform(char*, const char*, size_t) const; - -#ifdef _GLIBCXX_USE_WCHAR_T - template<> - int - collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const; - - template<> - size_t - collate<wchar_t>::_M_transform(wchar_t*, const wchar_t*, size_t) const; -#endif - - template<typename _CharT> - class collate_byname : public collate<_CharT> - { - public: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; - //@} - - explicit - collate_byname(const char* __s, size_t __refs = 0) - : collate<_CharT>(__refs) - { - if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) - { - this->_S_destroy_c_locale(this->_M_c_locale_collate); - this->_S_create_c_locale(this->_M_c_locale_collate, __s); - } - } - - protected: - virtual - ~collate_byname() { } - }; - - - /** - * @brief Time format ordering data. - * - * This class provides an enum representing different orderings of day, - * month, and year. - */ - class time_base - { - public: - enum dateorder { no_order, dmy, mdy, ymd, ydm }; - }; - - template<typename _CharT> - struct __timepunct_cache : public locale::facet - { - // List of all known timezones, with GMT first. - static const _CharT* _S_timezones[14]; - - const _CharT* _M_date_format; - const _CharT* _M_date_era_format; - const _CharT* _M_time_format; - const _CharT* _M_time_era_format; - const _CharT* _M_date_time_format; - const _CharT* _M_date_time_era_format; - const _CharT* _M_am; - const _CharT* _M_pm; - const _CharT* _M_am_pm_format; - - // Day names, starting with "C"'s Sunday. - const _CharT* _M_day1; - const _CharT* _M_day2; - const _CharT* _M_day3; - const _CharT* _M_day4; - const _CharT* _M_day5; - const _CharT* _M_day6; - const _CharT* _M_day7; - - // Abbreviated day names, starting with "C"'s Sun. - const _CharT* _M_aday1; - const _CharT* _M_aday2; - const _CharT* _M_aday3; - const _CharT* _M_aday4; - const _CharT* _M_aday5; - const _CharT* _M_aday6; - const _CharT* _M_aday7; - - // Month names, starting with "C"'s January. - const _CharT* _M_month01; - const _CharT* _M_month02; - const _CharT* _M_month03; - const _CharT* _M_month04; - const _CharT* _M_month05; - const _CharT* _M_month06; - const _CharT* _M_month07; - const _CharT* _M_month08; - const _CharT* _M_month09; - const _CharT* _M_month10; - const _CharT* _M_month11; - const _CharT* _M_month12; - - // Abbreviated month names, starting with "C"'s Jan. - const _CharT* _M_amonth01; - const _CharT* _M_amonth02; - const _CharT* _M_amonth03; - const _CharT* _M_amonth04; - const _CharT* _M_amonth05; - const _CharT* _M_amonth06; - const _CharT* _M_amonth07; - const _CharT* _M_amonth08; - const _CharT* _M_amonth09; - const _CharT* _M_amonth10; - const _CharT* _M_amonth11; - const _CharT* _M_amonth12; - - bool _M_allocated; - - __timepunct_cache(size_t __refs = 0) : facet(__refs), - _M_date_format(NULL), _M_date_era_format(NULL), _M_time_format(NULL), - _M_time_era_format(NULL), _M_date_time_format(NULL), - _M_date_time_era_format(NULL), _M_am(NULL), _M_pm(NULL), - _M_am_pm_format(NULL), _M_day1(NULL), _M_day2(NULL), _M_day3(NULL), - _M_day4(NULL), _M_day5(NULL), _M_day6(NULL), _M_day7(NULL), - _M_aday1(NULL), _M_aday2(NULL), _M_aday3(NULL), _M_aday4(NULL), - _M_aday5(NULL), _M_aday6(NULL), _M_aday7(NULL), _M_month01(NULL), - _M_month02(NULL), _M_month03(NULL), _M_month04(NULL), _M_month05(NULL), - _M_month06(NULL), _M_month07(NULL), _M_month08(NULL), _M_month09(NULL), - _M_month10(NULL), _M_month11(NULL), _M_month12(NULL), _M_amonth01(NULL), - _M_amonth02(NULL), _M_amonth03(NULL), _M_amonth04(NULL), - _M_amonth05(NULL), _M_amonth06(NULL), _M_amonth07(NULL), - _M_amonth08(NULL), _M_amonth09(NULL), _M_amonth10(NULL), - _M_amonth11(NULL), _M_amonth12(NULL), _M_allocated(false) - { } - - ~__timepunct_cache(); - - void - _M_cache(const locale& __loc); - - private: - __timepunct_cache& - operator=(const __timepunct_cache&); - - explicit - __timepunct_cache(const __timepunct_cache&); - }; - - template<typename _CharT> - __timepunct_cache<_CharT>::~__timepunct_cache() - { - if (_M_allocated) - { - // Unused. - } - } - - // Specializations. - template<> - const char* - __timepunct_cache<char>::_S_timezones[14]; - -#ifdef _GLIBCXX_USE_WCHAR_T - template<> - const wchar_t* - __timepunct_cache<wchar_t>::_S_timezones[14]; -#endif - - // Generic. - template<typename _CharT> - const _CharT* __timepunct_cache<_CharT>::_S_timezones[14]; - - template<typename _CharT> - class __timepunct : public locale::facet - { - public: - // Types: - typedef _CharT __char_type; - typedef basic_string<_CharT> __string_type; - typedef __timepunct_cache<_CharT> __cache_type; - - protected: - __cache_type* _M_data; - __c_locale _M_c_locale_timepunct; - const char* _M_name_timepunct; - - public: - /// Numpunct facet id. - static locale::id id; - - explicit - __timepunct(size_t __refs = 0); - - explicit - __timepunct(__cache_type* __cache, size_t __refs = 0); - - /** - * @brief Internal constructor. Not for general use. - * - * This is a constructor for use by the library itself to set up new - * locales. - * - * @param cloc The "C" locale. - * @param s The name of a locale. - * @param refs Passed to the base facet class. - */ - explicit - __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0); - - void - _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format, - const tm* __tm) const; - - void - _M_date_formats(const _CharT** __date) const - { - // Always have default first. - __date[0] = _M_data->_M_date_format; - __date[1] = _M_data->_M_date_era_format; - } - - void - _M_time_formats(const _CharT** __time) const - { - // Always have default first. - __time[0] = _M_data->_M_time_format; - __time[1] = _M_data->_M_time_era_format; - } - - void - _M_date_time_formats(const _CharT** __dt) const - { - // Always have default first. - __dt[0] = _M_data->_M_date_time_format; - __dt[1] = _M_data->_M_date_time_era_format; - } - - void - _M_am_pm_format(const _CharT* __ampm) const - { __ampm = _M_data->_M_am_pm_format; } - - void - _M_am_pm(const _CharT** __ampm) const - { - __ampm[0] = _M_data->_M_am; - __ampm[1] = _M_data->_M_pm; - } - - void - _M_days(const _CharT** __days) const - { - __days[0] = _M_data->_M_day1; - __days[1] = _M_data->_M_day2; - __days[2] = _M_data->_M_day3; - __days[3] = _M_data->_M_day4; - __days[4] = _M_data->_M_day5; - __days[5] = _M_data->_M_day6; - __days[6] = _M_data->_M_day7; - } - - void - _M_days_abbreviated(const _CharT** __days) const - { - __days[0] = _M_data->_M_aday1; - __days[1] = _M_data->_M_aday2; - __days[2] = _M_data->_M_aday3; - __days[3] = _M_data->_M_aday4; - __days[4] = _M_data->_M_aday5; - __days[5] = _M_data->_M_aday6; - __days[6] = _M_data->_M_aday7; - } - - void - _M_months(const _CharT** __months) const - { - __months[0] = _M_data->_M_month01; - __months[1] = _M_data->_M_month02; - __months[2] = _M_data->_M_month03; - __months[3] = _M_data->_M_month04; - __months[4] = _M_data->_M_month05; - __months[5] = _M_data->_M_month06; - __months[6] = _M_data->_M_month07; - __months[7] = _M_data->_M_month08; - __months[8] = _M_data->_M_month09; - __months[9] = _M_data->_M_month10; - __months[10] = _M_data->_M_month11; - __months[11] = _M_data->_M_month12; - } - - void - _M_months_abbreviated(const _CharT** __months) const - { - __months[0] = _M_data->_M_amonth01; - __months[1] = _M_data->_M_amonth02; - __months[2] = _M_data->_M_amonth03; - __months[3] = _M_data->_M_amonth04; - __months[4] = _M_data->_M_amonth05; - __months[5] = _M_data->_M_amonth06; - __months[6] = _M_data->_M_amonth07; - __months[7] = _M_data->_M_amonth08; - __months[8] = _M_data->_M_amonth09; - __months[9] = _M_data->_M_amonth10; - __months[10] = _M_data->_M_amonth11; - __months[11] = _M_data->_M_amonth12; - } - - protected: - virtual - ~__timepunct(); - - // For use at construction time only. - void - _M_initialize_timepunct(__c_locale __cloc = NULL); - }; - - template<typename _CharT> - locale::id __timepunct<_CharT>::id; - - // Specializations. - template<> - void - __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc); - - template<> - void - __timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const; - -#ifdef _GLIBCXX_USE_WCHAR_T - template<> - void - __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc); - - template<> - void - __timepunct<wchar_t>::_M_put(wchar_t*, size_t, const wchar_t*, - const tm*) const; -#endif - - // Include host and configuration specific timepunct functions. - #include <bits/time_members.h> - - /** - * @brief Facet for parsing dates and times. - * - * This facet encapsulates the code to parse and return a date or - * time from a string. It is used by the istream numeric - * extraction operators. - * - * The time_get template uses protected virtual functions to provide the - * actual results. The public accessors forward the call to the virtual - * functions. These virtual functions are hooks for developers to - * implement the behavior they require from the time_get facet. - */ - template<typename _CharT, typename _InIter> - class time_get : public locale::facet, public time_base - { - public: - // Types: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef _InIter iter_type; - //@} - typedef basic_string<_CharT> __string_type; - - /// Numpunct facet id. - static locale::id id; - - /** - * @brief Constructor performs initialization. - * - * This is the constructor provided by the standard. - * - * @param refs Passed to the base facet class. - */ - explicit - time_get(size_t __refs = 0) - : facet (__refs) { } - - /** - * @brief Return preferred order of month, day, and year. - * - * This function returns an enum from timebase::dateorder giving the - * preferred ordering if the format "x" given to time_put::put() only - * uses month, day, and year. If the format "x" for the associated - * locale uses other fields, this function returns - * timebase::dateorder::noorder. - * - * NOTE: The library always returns noorder at the moment. - * - * @return A member of timebase::dateorder. - */ - dateorder - date_order() const - { return this->do_date_order(); } - - /** - * @brief Parse input time string. - * - * This function parses a time according to the format "x" and puts the - * results into a user-supplied struct tm. The result is returned by - * calling time_get::do_get_time(). - * - * If there is a valid time string according to format "x", @a tm will - * be filled in accordingly and the returned iterator will point to the - * first character beyond the time string. If an error occurs before - * the end, err |= ios_base::failbit. If parsing reads all the - * characters, err |= ios_base::eofbit. - * - * @param beg Start of string to parse. - * @param end End of string to parse. - * @param io Source of the locale. - * @param err Error flags to set. - * @param tm Pointer to struct tm to fill in. - * @return Iterator to first char beyond time string. - */ - iter_type - get_time(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const - { return this->do_get_time(__beg, __end, __io, __err, __tm); } - - /** - * @brief Parse input date string. - * - * This function parses a date according to the format "X" and puts the - * results into a user-supplied struct tm. The result is returned by - * calling time_get::do_get_date(). - * - * If there is a valid date string according to format "X", @a tm will - * be filled in accordingly and the returned iterator will point to the - * first character beyond the date string. If an error occurs before - * the end, err |= ios_base::failbit. If parsing reads all the - * characters, err |= ios_base::eofbit. - * - * @param beg Start of string to parse. - * @param end End of string to parse. - * @param io Source of the locale. - * @param err Error flags to set. - * @param tm Pointer to struct tm to fill in. - * @return Iterator to first char beyond date string. - */ - iter_type - get_date(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const - { return this->do_get_date(__beg, __end, __io, __err, __tm); } - - /** - * @brief Parse input weekday string. - * - * This function parses a weekday name and puts the results into a - * user-supplied struct tm. The result is returned by calling - * time_get::do_get_weekday(). - * - * Parsing starts by parsing an abbreviated weekday name. If a valid - * abbreviation is followed by a character that would lead to the full - * weekday name, parsing continues until the full name is found or an - * error occurs. Otherwise parsing finishes at the end of the - * abbreviated name. - * - * If an error occurs before the end, err |= ios_base::failbit. If - * parsing reads all the characters, err |= ios_base::eofbit. - * - * @param beg Start of string to parse. - * @param end End of string to parse. - * @param io Source of the locale. - * @param err Error flags to set. - * @param tm Pointer to struct tm to fill in. - * @return Iterator to first char beyond weekday name. - */ - iter_type - get_weekday(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const - { return this->do_get_weekday(__beg, __end, __io, __err, __tm); } - - /** - * @brief Parse input month string. - * - * This function parses a month name and puts the results into a - * user-supplied struct tm. The result is returned by calling - * time_get::do_get_monthname(). - * - * Parsing starts by parsing an abbreviated month name. If a valid - * abbreviation is followed by a character that would lead to the full - * month name, parsing continues until the full name is found or an - * error occurs. Otherwise parsing finishes at the end of the - * abbreviated name. - * - * If an error occurs before the end, err |= ios_base::failbit. If - * parsing reads all the characters, err |= - * ios_base::eofbit. - * - * @param beg Start of string to parse. - * @param end End of string to parse. - * @param io Source of the locale. - * @param err Error flags to set. - * @param tm Pointer to struct tm to fill in. - * @return Iterator to first char beyond month name. - */ - iter_type - get_monthname(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const - { return this->do_get_monthname(__beg, __end, __io, __err, __tm); } - - /** - * @brief Parse input year string. - * - * This function reads up to 4 characters to parse a year string and - * puts the results into a user-supplied struct tm. The result is - * returned by calling time_get::do_get_year(). - * - * 4 consecutive digits are interpreted as a full year. If there are - * exactly 2 consecutive digits, the library interprets this as the - * number of years since 1900. - * - * If an error occurs before the end, err |= ios_base::failbit. If - * parsing reads all the characters, err |= ios_base::eofbit. - * - * @param beg Start of string to parse. - * @param end End of string to parse. - * @param io Source of the locale. - * @param err Error flags to set. - * @param tm Pointer to struct tm to fill in. - * @return Iterator to first char beyond year. - */ - iter_type - get_year(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const - { return this->do_get_year(__beg, __end, __io, __err, __tm); } - - protected: - /// Destructor. - virtual - ~time_get() { } - - /** - * @brief Return preferred order of month, day, and year. - * - * This function returns an enum from timebase::dateorder giving the - * preferred ordering if the format "x" given to time_put::put() only - * uses month, day, and year. This function is a hook for derived - * classes to change the value returned. - * - * @return A member of timebase::dateorder. - */ - virtual dateorder - do_date_order() const; - - /** - * @brief Parse input time string. - * - * This function parses a time according to the format "x" and puts the - * results into a user-supplied struct tm. This function is a hook for - * derived classes to change the value returned. @see get_time() for - * details. - * - * @param beg Start of string to parse. - * @param end End of string to parse. - * @param io Source of the locale. - * @param err Error flags to set. - * @param tm Pointer to struct tm to fill in. - * @return Iterator to first char beyond time string. - */ - virtual iter_type - do_get_time(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const; - - /** - * @brief Parse input date string. - * - * This function parses a date according to the format "X" and puts the - * results into a user-supplied struct tm. This function is a hook for - * derived classes to change the value returned. @see get_date() for - * details. - * - * @param beg Start of string to parse. - * @param end End of string to parse. - * @param io Source of the locale. - * @param err Error flags to set. - * @param tm Pointer to struct tm to fill in. - * @return Iterator to first char beyond date string. - */ - virtual iter_type - do_get_date(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const; - - /** - * @brief Parse input weekday string. - * - * This function parses a weekday name and puts the results into a - * user-supplied struct tm. This function is a hook for derived - * classes to change the value returned. @see get_weekday() for - * details. - * - * @param beg Start of string to parse. - * @param end End of string to parse. - * @param io Source of the locale. - * @param err Error flags to set. - * @param tm Pointer to struct tm to fill in. - * @return Iterator to first char beyond weekday name. - */ - virtual iter_type - do_get_weekday(iter_type __beg, iter_type __end, ios_base&, - ios_base::iostate& __err, tm* __tm) const; - - /** - * @brief Parse input month string. - * - * This function parses a month name and puts the results into a - * user-supplied struct tm. This function is a hook for derived - * classes to change the value returned. @see get_monthname() for - * details. - * - * @param beg Start of string to parse. - * @param end End of string to parse. - * @param io Source of the locale. - * @param err Error flags to set. - * @param tm Pointer to struct tm to fill in. - * @return Iterator to first char beyond month name. - */ - virtual iter_type - do_get_monthname(iter_type __beg, iter_type __end, ios_base&, - ios_base::iostate& __err, tm* __tm) const; - - /** - * @brief Parse input year string. - * - * This function reads up to 4 characters to parse a year string and - * puts the results into a user-supplied struct tm. This function is a - * hook for derived classes to change the value returned. @see - * get_year() for details. - * - * @param beg Start of string to parse. - * @param end End of string to parse. - * @param io Source of the locale. - * @param err Error flags to set. - * @param tm Pointer to struct tm to fill in. - * @return Iterator to first char beyond year. - */ - virtual iter_type - do_get_year(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const; - - // Extract numeric component of length __len. - iter_type - _M_extract_num(iter_type __beg, iter_type __end, int& __member, - int __min, int __max, size_t __len, - ios_base& __io, ios_base::iostate& __err) const; - - // Extract day or month name, or any unique array of string - // literals in a const _CharT* array. - iter_type - _M_extract_name(iter_type __beg, iter_type __end, int& __member, - const _CharT** __names, size_t __indexlen, - ios_base& __io, ios_base::iostate& __err) const; - - // Extract on a component-by-component basis, via __format argument. - iter_type - _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm, - const _CharT* __format) const; - }; - - template<typename _CharT, typename _InIter> - locale::id time_get<_CharT, _InIter>::id; - - template<typename _CharT, typename _InIter> - class time_get_byname : public time_get<_CharT, _InIter> - { - public: - // Types: - typedef _CharT char_type; - typedef _InIter iter_type; - - explicit - time_get_byname(const char*, size_t __refs = 0) - : time_get<_CharT, _InIter>(__refs) { } - - protected: - virtual - ~time_get_byname() { } - }; - - /** - * @brief Facet for outputting dates and times. - * - * This facet encapsulates the code to format and output dates and times - * according to formats used by strftime(). - * - * The time_put template uses protected virtual functions to provide the - * actual results. The public accessors forward the call to the virtual - * functions. These virtual functions are hooks for developers to - * implement the behavior they require from the time_put facet. - */ - template<typename _CharT, typename _OutIter> - class time_put : public locale::facet - { - public: - // Types: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef _OutIter iter_type; - //@} - - /// Numpunct facet id. - static locale::id id; - - /** - * @brief Constructor performs initialization. - * - * This is the constructor provided by the standard. - * - * @param refs Passed to the base facet class. - */ - explicit - time_put(size_t __refs = 0) - : facet(__refs) { } - - /** - * @brief Format and output a time or date. - * - * This function formats the data in struct tm according to the - * provided format string. The format string is interpreted as by - * strftime(). - * - * @param s The stream to write to. - * @param io Source of locale. - * @param fill char_type to use for padding. - * @param tm Struct tm with date and time info to format. - * @param beg Start of format string. - * @param end End of format string. - * @return Iterator after writing. - */ - iter_type - put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, - const _CharT* __beg, const _CharT* __end) const; - - /** - * @brief Format and output a time or date. - * - * This function formats the data in struct tm according to the - * provided format char and optional modifier. The format and modifier - * are interpreted as by strftime(). It does so by returning - * time_put::do_put(). - * - * @param s The stream to write to. - * @param io Source of locale. - * @param fill char_type to use for padding. - * @param tm Struct tm with date and time info to format. - * @param format Format char. - * @param mod Optional modifier char. - * @return Iterator after writing. - */ - iter_type - put(iter_type __s, ios_base& __io, char_type __fill, - const tm* __tm, char __format, char __mod = 0) const - { return this->do_put(__s, __io, __fill, __tm, __format, __mod); } - - protected: - /// Destructor. - virtual - ~time_put() - { } - - /** - * @brief Format and output a time or date. - * - * This function formats the data in struct tm according to the - * provided format char and optional modifier. This function is a hook - * for derived classes to change the value returned. @see put() for - * more details. - * - * @param s The stream to write to. - * @param io Source of locale. - * @param fill char_type to use for padding. - * @param tm Struct tm with date and time info to format. - * @param format Format char. - * @param mod Optional modifier char. - * @return Iterator after writing. - */ - virtual iter_type - do_put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, - char __format, char __mod) const; - }; - - template<typename _CharT, typename _OutIter> - locale::id time_put<_CharT, _OutIter>::id; - - template<typename _CharT, typename _OutIter> - class time_put_byname : public time_put<_CharT, _OutIter> - { - public: - // Types: - typedef _CharT char_type; - typedef _OutIter iter_type; - - explicit - time_put_byname(const char*, size_t __refs = 0) - : time_put<_CharT, _OutIter>(__refs) - { }; - - protected: - virtual - ~time_put_byname() { } - }; - - - /** - * @brief Money format ordering data. - * - * This class contains an ordered array of 4 fields to represent the - * pattern for formatting a money amount. Each field may contain one entry - * from the part enum. symbol, sign, and value must be present and the - * remaining field must contain either none or space. @see - * moneypunct::pos_format() and moneypunct::neg_format() for details of how - * these fields are interpreted. - */ - class money_base - { - public: - enum part { none, space, symbol, sign, value }; - struct pattern { char field[4]; }; - - static const pattern _S_default_pattern; - - enum - { - _S_minus, - _S_zero, - _S_end = 11 - }; - - // String literal of acceptable (narrow) input/output, for - // money_get/money_put. "-0123456789" - static const char* _S_atoms; - - // Construct and return valid pattern consisting of some combination of: - // space none symbol sign value - static pattern - _S_construct_pattern(char __precedes, char __space, char __posn); - }; - - template<typename _CharT, bool _Intl> - struct __moneypunct_cache : public locale::facet - { - const char* _M_grouping; - size_t _M_grouping_size; - bool _M_use_grouping; - _CharT _M_decimal_point; - _CharT _M_thousands_sep; - const _CharT* _M_curr_symbol; - size_t _M_curr_symbol_size; - const _CharT* _M_positive_sign; - size_t _M_positive_sign_size; - const _CharT* _M_negative_sign; - size_t _M_negative_sign_size; - int _M_frac_digits; - money_base::pattern _M_pos_format; - money_base::pattern _M_neg_format; - - // A list of valid numeric literals for input and output: in the standard - // "C" locale, this is "-0123456789". This array contains the chars after - // having been passed through the current locale's ctype<_CharT>.widen(). - _CharT _M_atoms[money_base::_S_end]; - - bool _M_allocated; - - __moneypunct_cache(size_t __refs = 0) : facet(__refs), - _M_grouping(NULL), _M_grouping_size(0), _M_use_grouping(false), - _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()), - _M_curr_symbol(NULL), _M_curr_symbol_size(0), - _M_positive_sign(NULL), _M_positive_sign_size(0), - _M_negative_sign(NULL), _M_negative_sign_size(0), - _M_frac_digits(0), - _M_pos_format(money_base::pattern()), - _M_neg_format(money_base::pattern()), _M_allocated(false) - { } - - ~__moneypunct_cache(); - - void - _M_cache(const locale& __loc); - - private: - __moneypunct_cache& - operator=(const __moneypunct_cache&); - - explicit - __moneypunct_cache(const __moneypunct_cache&); - }; - - template<typename _CharT, bool _Intl> - __moneypunct_cache<_CharT, _Intl>::~__moneypunct_cache() - { - if (_M_allocated) - { - delete [] _M_grouping; - delete [] _M_curr_symbol; - delete [] _M_positive_sign; - delete [] _M_negative_sign; - } - } - - /** - * @brief Facet for formatting data for money amounts. - * - * This facet encapsulates the punctuation, grouping and other formatting - * features of money amount string representations. - */ - template<typename _CharT, bool _Intl> - class moneypunct : public locale::facet, public money_base - { - public: - // Types: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; - //@} - typedef __moneypunct_cache<_CharT, _Intl> __cache_type; - - private: - __cache_type* _M_data; - - public: - /// This value is provided by the standard, but no reason for its - /// existence. - static const bool intl = _Intl; - /// Numpunct facet id. - static locale::id id; - - /** - * @brief Constructor performs initialization. - * - * This is the constructor provided by the standard. - * - * @param refs Passed to the base facet class. - */ - explicit - moneypunct(size_t __refs = 0) : facet(__refs), _M_data(NULL) - { _M_initialize_moneypunct(); } - - /** - * @brief Constructor performs initialization. - * - * This is an internal constructor. - * - * @param cache Cache for optimization. - * @param refs Passed to the base facet class. - */ - explicit - moneypunct(__cache_type* __cache, size_t __refs = 0) - : facet(__refs), _M_data(__cache) - { _M_initialize_moneypunct(); } - - /** - * @brief Internal constructor. Not for general use. - * - * This is a constructor for use by the library itself to set up new - * locales. - * - * @param cloc The "C" locale. - * @param s The name of a locale. - * @param refs Passed to the base facet class. - */ - explicit - moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0) - : facet(__refs), _M_data(NULL) - { _M_initialize_moneypunct(__cloc, __s); } - - /** - * @brief Return decimal point character. - * - * This function returns a char_type to use as a decimal point. It - * does so by returning returning - * moneypunct<char_type>::do_decimal_point(). - * - * @return @a char_type representing a decimal point. - */ - char_type - decimal_point() const - { return this->do_decimal_point(); } - - /** - * @brief Return thousands separator character. - * - * This function returns a char_type to use as a thousands - * separator. It does so by returning returning - * moneypunct<char_type>::do_thousands_sep(). - * - * @return char_type representing a thousands separator. - */ - char_type - thousands_sep() const - { return this->do_thousands_sep(); } - - /** - * @brief Return grouping specification. - * - * This function returns a string representing groupings for the - * integer part of an amount. Groupings indicate where thousands - * separators should be inserted. - * - * Each char in the return string is interpret as an integer rather - * than a character. These numbers represent the number of digits in a - * group. The first char in the string represents the number of digits - * in the least significant group. If a char is negative, it indicates - * an unlimited number of digits for the group. If more chars from the - * string are required to group a number, the last char is used - * repeatedly. - * - * For example, if the grouping() returns "\003\002" and is applied to - * the number 123456789, this corresponds to 12,34,56,789. Note that - * if the string was "32", this would put more than 50 digits into the - * least significant group if the character set is ASCII. - * - * The string is returned by calling - * moneypunct<char_type>::do_grouping(). - * - * @return string representing grouping specification. - */ - string - grouping() const - { return this->do_grouping(); } - - /** - * @brief Return currency symbol string. - * - * This function returns a string_type to use as a currency symbol. It - * does so by returning returning - * moneypunct<char_type>::do_curr_symbol(). - * - * @return @a string_type representing a currency symbol. - */ - string_type - curr_symbol() const - { return this->do_curr_symbol(); } - - /** - * @brief Return positive sign string. - * - * This function returns a string_type to use as a sign for positive - * amounts. It does so by returning returning - * moneypunct<char_type>::do_positive_sign(). - * - * If the return value contains more than one character, the first - * character appears in the position indicated by pos_format() and the - * remainder appear at the end of the formatted string. - * - * @return @a string_type representing a positive sign. - */ - string_type - positive_sign() const - { return this->do_positive_sign(); } - - /** - * @brief Return negative sign string. - * - * This function returns a string_type to use as a sign for negative - * amounts. It does so by returning returning - * moneypunct<char_type>::do_negative_sign(). - * - * If the return value contains more than one character, the first - * character appears in the position indicated by neg_format() and the - * remainder appear at the end of the formatted string. - * - * @return @a string_type representing a negative sign. - */ - string_type - negative_sign() const - { return this->do_negative_sign(); } - - /** - * @brief Return number of digits in fraction. - * - * This function returns the exact number of digits that make up the - * fractional part of a money amount. It does so by returning - * returning moneypunct<char_type>::do_frac_digits(). - * - * The fractional part of a money amount is optional. But if it is - * present, there must be frac_digits() digits. - * - * @return Number of digits in amount fraction. - */ - int - frac_digits() const - { return this->do_frac_digits(); } - - //@{ - /** - * @brief Return pattern for money values. - * - * This function returns a pattern describing the formatting of a - * positive or negative valued money amount. It does so by returning - * returning moneypunct<char_type>::do_pos_format() or - * moneypunct<char_type>::do_neg_format(). - * - * The pattern has 4 fields describing the ordering of symbol, sign, - * value, and none or space. There must be one of each in the pattern. - * The none and space enums may not appear in the first field and space - * may not appear in the final field. - * - * The parts of a money string must appear in the order indicated by - * the fields of the pattern. The symbol field indicates that the - * value of curr_symbol() may be present. The sign field indicates - * that the value of positive_sign() or negative_sign() must be - * present. The value field indicates that the absolute value of the - * money amount is present. none indicates 0 or more whitespace - * characters, except at the end, where it permits no whitespace. - * space indicates that 1 or more whitespace characters must be - * present. - * - * For example, for the US locale and pos_format() pattern - * {symbol,sign,value,none}, curr_symbol() == '$' positive_sign() == - * '+', and value 10.01, and options set to force the symbol, the - * corresponding string is "$+10.01". - * - * @return Pattern for money values. - */ - pattern - pos_format() const - { return this->do_pos_format(); } - - pattern - neg_format() const - { return this->do_neg_format(); } - //@} - - protected: - /// Destructor. - virtual - ~moneypunct(); - - /** - * @brief Return decimal point character. - * - * Returns a char_type to use as a decimal point. This function is a - * hook for derived classes to change the value returned. - * - * @return @a char_type representing a decimal point. - */ - virtual char_type - do_decimal_point() const - { return _M_data->_M_decimal_point; } - - /** - * @brief Return thousands separator character. - * - * Returns a char_type to use as a thousands separator. This function - * is a hook for derived classes to change the value returned. - * - * @return @a char_type representing a thousands separator. - */ - virtual char_type - do_thousands_sep() const - { return _M_data->_M_thousands_sep; } - - /** - * @brief Return grouping specification. - * - * Returns a string representing groupings for the integer part of a - * number. This function is a hook for derived classes to change the - * value returned. @see grouping() for details. - * - * @return String representing grouping specification. - */ - virtual string - do_grouping() const - { return _M_data->_M_grouping; } - - /** - * @brief Return currency symbol string. - * - * This function returns a string_type to use as a currency symbol. - * This function is a hook for derived classes to change the value - * returned. @see curr_symbol() for details. - * - * @return @a string_type representing a currency symbol. - */ - virtual string_type - do_curr_symbol() const - { return _M_data->_M_curr_symbol; } - - /** - * @brief Return positive sign string. - * - * This function returns a string_type to use as a sign for positive - * amounts. This function is a hook for derived classes to change the - * value returned. @see positive_sign() for details. - * - * @return @a string_type representing a positive sign. - */ - virtual string_type - do_positive_sign() const - { return _M_data->_M_positive_sign; } - - /** - * @brief Return negative sign string. - * - * This function returns a string_type to use as a sign for negative - * amounts. This function is a hook for derived classes to change the - * value returned. @see negative_sign() for details. - * - * @return @a string_type representing a negative sign. - */ - virtual string_type - do_negative_sign() const - { return _M_data->_M_negative_sign; } - - /** - * @brief Return number of digits in fraction. - * - * This function returns the exact number of digits that make up the - * fractional part of a money amount. This function is a hook for - * derived classes to change the value returned. @see frac_digits() - * for details. - * - * @return Number of digits in amount fraction. - */ - virtual int - do_frac_digits() const - { return _M_data->_M_frac_digits; } - - /** - * @brief Return pattern for money values. - * - * This function returns a pattern describing the formatting of a - * positive valued money amount. This function is a hook for derived - * classes to change the value returned. @see pos_format() for - * details. - * - * @return Pattern for money values. - */ - virtual pattern - do_pos_format() const - { return _M_data->_M_pos_format; } - - /** - * @brief Return pattern for money values. - * - * This function returns a pattern describing the formatting of a - * negative valued money amount. This function is a hook for derived - * classes to change the value returned. @see neg_format() for - * details. - * - * @return Pattern for money values. - */ - virtual pattern - do_neg_format() const - { return _M_data->_M_neg_format; } - - // For use at construction time only. - void - _M_initialize_moneypunct(__c_locale __cloc = NULL, - const char* __name = NULL); - }; - - template<typename _CharT, bool _Intl> - locale::id moneypunct<_CharT, _Intl>::id; - - template<typename _CharT, bool _Intl> - const bool moneypunct<_CharT, _Intl>::intl; - - template<> - moneypunct<char, true>::~moneypunct(); - - template<> - moneypunct<char, false>::~moneypunct(); - - template<> - void - moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*); - - template<> - void - moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*); - -#ifdef _GLIBCXX_USE_WCHAR_T - template<> - moneypunct<wchar_t, true>::~moneypunct(); - - template<> - moneypunct<wchar_t, false>::~moneypunct(); - - template<> - void - moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale, - const char*); - - template<> - void - moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale, - const char*); -#endif - - template<typename _CharT, bool _Intl> - class moneypunct_byname : public moneypunct<_CharT, _Intl> - { - public: - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; - - static const bool intl = _Intl; - - explicit - moneypunct_byname(const char* __s, size_t __refs = 0) - : moneypunct<_CharT, _Intl>(__refs) - { - if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) - { - __c_locale __tmp; - this->_S_create_c_locale(__tmp, __s); - this->_M_initialize_moneypunct(__tmp); - this->_S_destroy_c_locale(__tmp); - } - } - - protected: - virtual - ~moneypunct_byname() { } - }; - - template<typename _CharT, bool _Intl> - const bool moneypunct_byname<_CharT, _Intl>::intl; - - /** - * @brief Facet for parsing monetary amounts. - * - * This facet encapsulates the code to parse and return a monetary - * amount from a string. - * - * The money_get template uses protected virtual functions to - * provide the actual results. The public accessors forward the - * call to the virtual functions. These virtual functions are - * hooks for developers to implement the behavior they require from - * the money_get facet. - */ - template<typename _CharT, typename _InIter> - class money_get : public locale::facet - { - public: - // Types: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef _InIter iter_type; - typedef basic_string<_CharT> string_type; - //@} - - /// Numpunct facet id. - static locale::id id; - - /** - * @brief Constructor performs initialization. - * - * This is the constructor provided by the standard. - * - * @param refs Passed to the base facet class. - */ - explicit - money_get(size_t __refs = 0) : facet(__refs) { } - - /** - * @brief Read and parse a monetary value. - * - * This function reads characters from @a s, interprets them as a - * monetary value according to moneypunct and ctype facets retrieved - * from io.getloc(), and returns the result in @a units as an integral - * value moneypunct::frac_digits() * the actual amount. For example, - * the string $10.01 in a US locale would store 1001 in @a units. - * - * Any characters not part of a valid money amount are not consumed. - * - * If a money value cannot be parsed from the input stream, sets - * err=(err|io.failbit). If the stream is consumed before finishing - * parsing, sets err=(err|io.failbit|io.eofbit). @a units is - * unchanged if parsing fails. - * - * This function works by returning the result of do_get(). - * - * @param s Start of characters to parse. - * @param end End of characters to parse. - * @param intl Parameter to use_facet<moneypunct<CharT,intl> >. - * @param io Source of facets and io state. - * @param err Error field to set if parsing fails. - * @param units Place to store result of parsing. - * @return Iterator referencing first character beyond valid money - * amount. - */ - iter_type - get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, - ios_base::iostate& __err, long double& __units) const - { return this->do_get(__s, __end, __intl, __io, __err, __units); } - - /** - * @brief Read and parse a monetary value. - * - * This function reads characters from @a s, interprets them as a - * monetary value according to moneypunct and ctype facets retrieved - * from io.getloc(), and returns the result in @a digits. For example, - * the string $10.01 in a US locale would store "1001" in @a digits. - * - * Any characters not part of a valid money amount are not consumed. - * - * If a money value cannot be parsed from the input stream, sets - * err=(err|io.failbit). If the stream is consumed before finishing - * parsing, sets err=(err|io.failbit|io.eofbit). - * - * This function works by returning the result of do_get(). - * - * @param s Start of characters to parse. - * @param end End of characters to parse. - * @param intl Parameter to use_facet<moneypunct<CharT,intl> >. - * @param io Source of facets and io state. - * @param err Error field to set if parsing fails. - * @param digits Place to store result of parsing. - * @return Iterator referencing first character beyond valid money - * amount. - */ - iter_type - get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, - ios_base::iostate& __err, string_type& __digits) const - { return this->do_get(__s, __end, __intl, __io, __err, __digits); } - - protected: - /// Destructor. - virtual - ~money_get() { } - - /** - * @brief Read and parse a monetary value. - * - * This function reads and parses characters representing a monetary - * value. This function is a hook for derived classes to change the - * value returned. @see get() for details. - */ - virtual iter_type - do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, - ios_base::iostate& __err, long double& __units) const; - - /** - * @brief Read and parse a monetary value. - * - * This function reads and parses characters representing a monetary - * value. This function is a hook for derived classes to change the - * value returned. @see get() for details. - */ - virtual iter_type - do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, - ios_base::iostate& __err, string_type& __digits) const; - - template<bool _Intl> - iter_type - _M_extract(iter_type __s, iter_type __end, ios_base& __io, - ios_base::iostate& __err, string& __digits) const; - }; - - template<typename _CharT, typename _InIter> - locale::id money_get<_CharT, _InIter>::id; - - /** - * @brief Facet for outputting monetary amounts. - * - * This facet encapsulates the code to format and output a monetary - * amount. - * - * The money_put template uses protected virtual functions to - * provide the actual results. The public accessors forward the - * call to the virtual functions. These virtual functions are - * hooks for developers to implement the behavior they require from - * the money_put facet. - */ - template<typename _CharT, typename _OutIter> - class money_put : public locale::facet - { - public: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef _OutIter iter_type; - typedef basic_string<_CharT> string_type; - //@} - - /// Numpunct facet id. - static locale::id id; - - /** - * @brief Constructor performs initialization. - * - * This is the constructor provided by the standard. - * - * @param refs Passed to the base facet class. - */ - explicit - money_put(size_t __refs = 0) : facet(__refs) { } - - /** - * @brief Format and output a monetary value. - * - * This function formats @a units as a monetary value according to - * moneypunct and ctype facets retrieved from io.getloc(), and writes - * the resulting characters to @a s. For example, the value 1001 in a - * US locale would write "$10.01" to @a s. - * - * This function works by returning the result of do_put(). - * - * @param s The stream to write to. - * @param intl Parameter to use_facet<moneypunct<CharT,intl> >. - * @param io Source of facets and io state. - * @param fill char_type to use for padding. - * @param units Place to store result of parsing. - * @return Iterator after writing. - */ - iter_type - put(iter_type __s, bool __intl, ios_base& __io, - char_type __fill, long double __units) const - { return this->do_put(__s, __intl, __io, __fill, __units); } - - /** - * @brief Format and output a monetary value. - * - * This function formats @a digits as a monetary value according to - * moneypunct and ctype facets retrieved from io.getloc(), and writes - * the resulting characters to @a s. For example, the string "1001" in - * a US locale would write "$10.01" to @a s. - * - * This function works by returning the result of do_put(). - * - * @param s The stream to write to. - * @param intl Parameter to use_facet<moneypunct<CharT,intl> >. - * @param io Source of facets and io state. - * @param fill char_type to use for padding. - * @param units Place to store result of parsing. - * @return Iterator after writing. - */ - iter_type - put(iter_type __s, bool __intl, ios_base& __io, - char_type __fill, const string_type& __digits) const - { return this->do_put(__s, __intl, __io, __fill, __digits); } - - protected: - /// Destructor. - virtual - ~money_put() { } - - /** - * @brief Format and output a monetary value. - * - * This function formats @a units as a monetary value according to - * moneypunct and ctype facets retrieved from io.getloc(), and writes - * the resulting characters to @a s. For example, the value 1001 in a - * US locale would write "$10.01" to @a s. - * - * This function is a hook for derived classes to change the value - * returned. @see put(). - * - * @param s The stream to write to. - * @param intl Parameter to use_facet<moneypunct<CharT,intl> >. - * @param io Source of facets and io state. - * @param fill char_type to use for padding. - * @param units Place to store result of parsing. - * @return Iterator after writing. - */ - virtual iter_type - do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, - long double __units) const; - - /** - * @brief Format and output a monetary value. - * - * This function formats @a digits as a monetary value according to - * moneypunct and ctype facets retrieved from io.getloc(), and writes - * the resulting characters to @a s. For example, the string "1001" in - * a US locale would write "$10.01" to @a s. - * - * This function is a hook for derived classes to change the value - * returned. @see put(). - * - * @param s The stream to write to. - * @param intl Parameter to use_facet<moneypunct<CharT,intl> >. - * @param io Source of facets and io state. - * @param fill char_type to use for padding. - * @param units Place to store result of parsing. - * @return Iterator after writing. - */ - virtual iter_type - do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, - const string_type& __digits) const; - - template<bool _Intl> - iter_type - _M_insert(iter_type __s, ios_base& __io, char_type __fill, - const string_type& __digits) const; - }; - - template<typename _CharT, typename _OutIter> - locale::id money_put<_CharT, _OutIter>::id; - - /** - * @brief Messages facet base class providing catalog typedef. - */ - struct messages_base - { - typedef int catalog; - }; - - /** - * @brief Facet for handling message catalogs - * - * This facet encapsulates the code to retrieve messages from - * message catalogs. The only thing defined by the standard for this facet - * is the interface. All underlying functionality is - * implementation-defined. - * - * This library currently implements 3 versions of the message facet. The - * first version (gnu) is a wrapper around gettext, provided by libintl. - * The second version (ieee) is a wrapper around catgets. The final - * version (default) does no actual translation. These implementations are - * only provided for char and wchar_t instantiations. - * - * The messages template uses protected virtual functions to - * provide the actual results. The public accessors forward the - * call to the virtual functions. These virtual functions are - * hooks for developers to implement the behavior they require from - * the messages facet. - */ - template<typename _CharT> - class messages : public locale::facet, public messages_base - { - public: - // Types: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; - //@} - - protected: - // Underlying "C" library locale information saved from - // initialization, needed by messages_byname as well. - __c_locale _M_c_locale_messages; - const char* _M_name_messages; - - public: - /// Numpunct facet id. - static locale::id id; - - /** - * @brief Constructor performs initialization. - * - * This is the constructor provided by the standard. - * - * @param refs Passed to the base facet class. - */ - explicit - messages(size_t __refs = 0); - - // Non-standard. - /** - * @brief Internal constructor. Not for general use. - * - * This is a constructor for use by the library itself to set up new - * locales. - * - * @param cloc The "C" locale. - * @param s The name of a locale. - * @param refs Refcount to pass to the base class. - */ - explicit - messages(__c_locale __cloc, const char* __s, size_t __refs = 0); - - /* - * @brief Open a message catalog. - * - * This function opens and returns a handle to a message catalog by - * returning do_open(s, loc). - * - * @param s The catalog to open. - * @param loc Locale to use for character set conversions. - * @return Handle to the catalog or value < 0 if open fails. - */ - catalog - open(const basic_string<char>& __s, const locale& __loc) const - { return this->do_open(__s, __loc); } - - // Non-standard and unorthodox, yet effective. - /* - * @brief Open a message catalog. - * - * This non-standard function opens and returns a handle to a message - * catalog by returning do_open(s, loc). The third argument provides a - * message catalog root directory for gnu gettext and is ignored - * otherwise. - * - * @param s The catalog to open. - * @param loc Locale to use for character set conversions. - * @param dir Message catalog root directory. - * @return Handle to the catalog or value < 0 if open fails. - */ - catalog - open(const basic_string<char>&, const locale&, const char*) const; - - /* - * @brief Look up a string in a message catalog. - * - * This function retrieves and returns a message from a catalog by - * returning do_get(c, set, msgid, s). - * - * For gnu, @a set and @a msgid are ignored. Returns gettext(s). - * For default, returns s. For ieee, returns catgets(c,set,msgid,s). - * - * @param c The catalog to access. - * @param set Implementation-defined. - * @param msgid Implementation-defined. - * @param s Default return value if retrieval fails. - * @return Retrieved message or @a s if get fails. - */ - string_type - get(catalog __c, int __set, int __msgid, const string_type& __s) const - { return this->do_get(__c, __set, __msgid, __s); } - - /* - * @brief Close a message catalog. - * - * Closes catalog @a c by calling do_close(c). - * - * @param c The catalog to close. - */ - void - close(catalog __c) const - { return this->do_close(__c); } - - protected: - /// Destructor. - virtual - ~messages(); - - /* - * @brief Open a message catalog. - * - * This function opens and returns a handle to a message catalog in an - * implementation-defined manner. This function is a hook for derived - * classes to change the value returned. - * - * @param s The catalog to open. - * @param loc Locale to use for character set conversions. - * @return Handle to the opened catalog, value < 0 if open failed. - */ - virtual catalog - do_open(const basic_string<char>&, const locale&) const; - - /* - * @brief Look up a string in a message catalog. - * - * This function retrieves and returns a message from a catalog in an - * implementation-defined manner. This function is a hook for derived - * classes to change the value returned. - * - * For gnu, @a set and @a msgid are ignored. Returns gettext(s). - * For default, returns s. For ieee, returns catgets(c,set,msgid,s). - * - * @param c The catalog to access. - * @param set Implementation-defined. - * @param msgid Implementation-defined. - * @param s Default return value if retrieval fails. - * @return Retrieved message or @a s if get fails. - */ - virtual string_type - do_get(catalog, int, int, const string_type& __dfault) const; - - /* - * @brief Close a message catalog. - * - * @param c The catalog to close. - */ - virtual void - do_close(catalog) const; - - // Returns a locale and codeset-converted string, given a char* message. - char* - _M_convert_to_char(const string_type& __msg) const - { - // XXX - return reinterpret_cast<char*>(const_cast<_CharT*>(__msg.c_str())); - } - - // Returns a locale and codeset-converted string, given a char* message. - string_type - _M_convert_from_char(char*) const - { -#if 0 - // Length of message string without terminating null. - size_t __len = char_traits<char>::length(__msg) - 1; - - // "everybody can easily convert the string using - // mbsrtowcs/wcsrtombs or with iconv()" - - // Convert char* to _CharT in locale used to open catalog. - // XXX need additional template parameter on messages class for this.. - // typedef typename codecvt<char, _CharT, _StateT> __codecvt_type; - typedef typename codecvt<char, _CharT, mbstate_t> __codecvt_type; - - __codecvt_type::state_type __state; - // XXX may need to initialize state. - //initialize_state(__state._M_init()); - - char* __from_next; - // XXX what size for this string? - _CharT* __to = static_cast<_CharT*>(__builtin_alloca(__len + 1)); - const __codecvt_type& __cvt = use_facet<__codecvt_type>(_M_locale_conv); - __cvt.out(__state, __msg, __msg + __len, __from_next, - __to, __to + __len + 1, __to_next); - return string_type(__to); -#endif -#if 0 - typedef ctype<_CharT> __ctype_type; - // const __ctype_type& __cvt = use_facet<__ctype_type>(_M_locale_msg); - const __ctype_type& __cvt = use_facet<__ctype_type>(locale()); - // XXX Again, proper length of converted string an issue here. - // For now, assume the converted length is not larger. - _CharT* __dest = static_cast<_CharT*>(__builtin_alloca(__len + 1)); - __cvt.widen(__msg, __msg + __len, __dest); - return basic_string<_CharT>(__dest); -#endif - return string_type(); - } - }; - - template<typename _CharT> - locale::id messages<_CharT>::id; - - // Specializations for required instantiations. - template<> - string - messages<char>::do_get(catalog, int, int, const string&) const; - -#ifdef _GLIBCXX_USE_WCHAR_T - template<> - wstring - messages<wchar_t>::do_get(catalog, int, int, const wstring&) const; -#endif - - template<typename _CharT> - class messages_byname : public messages<_CharT> - { - public: - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; - - explicit - messages_byname(const char* __s, size_t __refs = 0); - - protected: - virtual - ~messages_byname() - { } - }; - - // Include host and configuration specific messages functions. - #include <bits/messages_members.h> - - - // Subclause convenience interfaces, inlines. - // NB: These are inline because, when used in a loop, some compilers - // can hoist the body out of the loop; then it's just as fast as the - // C is*() function. - //@{ - /// Convenience interface to ctype.is(). - template<typename _CharT> - inline bool - isspace(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); } - - template<typename _CharT> - inline bool - isprint(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); } - - template<typename _CharT> - inline bool - iscntrl(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); } - - template<typename _CharT> - inline bool - isupper(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); } - - template<typename _CharT> - inline bool islower(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); } - - template<typename _CharT> - inline bool - isalpha(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); } - - template<typename _CharT> - inline bool - isdigit(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); } - - template<typename _CharT> - inline bool - ispunct(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); } - - template<typename _CharT> - inline bool - isxdigit(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); } - - template<typename _CharT> - inline bool - isalnum(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); } - - template<typename _CharT> - inline bool - isgraph(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); } - - template<typename _CharT> - inline _CharT - toupper(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).toupper(__c); } - - template<typename _CharT> - inline _CharT - tolower(_CharT __c, const locale& __loc) - { return use_facet<ctype<_CharT> >(__loc).tolower(__c); } - //@} -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_facets.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_facets.tcc deleted file mode 100644 index 916e1088123..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_facets.tcc +++ /dev/null @@ -1,2797 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Warning: this file is not meant for user inclusion. Use <locale>. - -#ifndef _LOCALE_FACETS_TCC -#define _LOCALE_FACETS_TCC 1 - -#pragma GCC system_header - -#include <limits> // For numeric_limits -#include <typeinfo> // For bad_cast. -#include <bits/streambuf_iterator.h> - -namespace std -{ - template<typename _Facet> - locale - locale::combine(const locale& __other) const - { - _Impl* __tmp = new _Impl(*_M_impl, 1); - try - { - __tmp->_M_replace_facet(__other._M_impl, &_Facet::id); - } - catch(...) - { - __tmp->_M_remove_reference(); - __throw_exception_again; - } - return locale(__tmp); - } - - template<typename _CharT, typename _Traits, typename _Alloc> - bool - locale::operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1, - const basic_string<_CharT, _Traits, _Alloc>& __s2) const - { - typedef std::collate<_CharT> __collate_type; - const __collate_type& __collate = use_facet<__collate_type>(*this); - return (__collate.compare(__s1.data(), __s1.data() + __s1.length(), - __s2.data(), __s2.data() + __s2.length()) < 0); - } - - /** - * @brief Test for the presence of a facet. - * - * has_facet tests the locale argument for the presence of the facet type - * provided as the template parameter. Facets derived from the facet - * parameter will also return true. - * - * @param Facet The facet type to test the presence of. - * @param locale The locale to test. - * @return true if locale contains a facet of type Facet, else false. - */ - template<typename _Facet> - inline bool - has_facet(const locale& __loc) throw() - { - const size_t __i = _Facet::id._M_id(); - const locale::facet** __facets = __loc._M_impl->_M_facets; - return (__i < __loc._M_impl->_M_facets_size && __facets[__i]); - } - - /** - * @brief Return a facet. - * - * use_facet looks for and returns a reference to a facet of type Facet - * where Facet is the template parameter. If has_facet(locale) is true, - * there is a suitable facet to return. It throws std::bad_cast if the - * locale doesn't contain a facet of type Facet. - * - * @param Facet The facet type to access. - * @param locale The locale to use. - * @return Reference to facet of type Facet. - * @throw std::bad_cast if locale doesn't contain a facet of type Facet. - */ - template<typename _Facet> - inline const _Facet& - use_facet(const locale& __loc) - { - const size_t __i = _Facet::id._M_id(); - const locale::facet** __facets = __loc._M_impl->_M_facets; - if (!(__i < __loc._M_impl->_M_facets_size && __facets[__i])) - __throw_bad_cast(); - return static_cast<const _Facet&>(*__facets[__i]); - } - - // Routine to access a cache for the facet. If the cache didn't - // exist before, it gets constructed on the fly. - template<typename _Facet> - struct __use_cache - { - const _Facet* - operator() (const locale& __loc) const; - }; - - // Specializations. - template<typename _CharT> - struct __use_cache<__numpunct_cache<_CharT> > - { - const __numpunct_cache<_CharT>* - operator() (const locale& __loc) const - { - const size_t __i = numpunct<_CharT>::id._M_id(); - const locale::facet** __caches = __loc._M_impl->_M_caches; - if (!__caches[__i]) - { - __numpunct_cache<_CharT>* __tmp = NULL; - try - { - __tmp = new __numpunct_cache<_CharT>; - __tmp->_M_cache(__loc); - } - catch(...) - { - delete __tmp; - __throw_exception_again; - } - __loc._M_impl->_M_install_cache(__tmp, __i); - } - return static_cast<const __numpunct_cache<_CharT>*>(__caches[__i]); - } - }; - - template<typename _CharT, bool _Intl> - struct __use_cache<__moneypunct_cache<_CharT, _Intl> > - { - const __moneypunct_cache<_CharT, _Intl>* - operator() (const locale& __loc) const - { - const size_t __i = moneypunct<_CharT, _Intl>::id._M_id(); - const locale::facet** __caches = __loc._M_impl->_M_caches; - if (!__caches[__i]) - { - __moneypunct_cache<_CharT, _Intl>* __tmp = NULL; - try - { - __tmp = new __moneypunct_cache<_CharT, _Intl>; - __tmp->_M_cache(__loc); - } - catch(...) - { - delete __tmp; - __throw_exception_again; - } - __loc._M_impl->_M_install_cache(__tmp, __i); - } - return static_cast< - const __moneypunct_cache<_CharT, _Intl>*>(__caches[__i]); - } - }; - - template<typename _CharT> - void - __numpunct_cache<_CharT>::_M_cache(const locale& __loc) - { - _M_allocated = true; - - const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc); - - _M_grouping_size = __np.grouping().size(); - char* __grouping = new char[_M_grouping_size]; - __np.grouping().copy(__grouping, _M_grouping_size); - _M_grouping = __grouping; - _M_use_grouping = _M_grouping_size && __np.grouping()[0] != 0; - - _M_truename_size = __np.truename().size(); - _CharT* __truename = new _CharT[_M_truename_size]; - __np.truename().copy(__truename, _M_truename_size); - _M_truename = __truename; - - _M_falsename_size = __np.falsename().size(); - _CharT* __falsename = new _CharT[_M_falsename_size]; - __np.falsename().copy(__falsename, _M_falsename_size); - _M_falsename = __falsename; - - _M_decimal_point = __np.decimal_point(); - _M_thousands_sep = __np.thousands_sep(); - - const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc); - __ct.widen(__num_base::_S_atoms_out, - __num_base::_S_atoms_out + __num_base::_S_oend, _M_atoms_out); - __ct.widen(__num_base::_S_atoms_in, - __num_base::_S_atoms_in + __num_base::_S_iend, _M_atoms_in); - } - - template<typename _CharT, bool _Intl> - void - __moneypunct_cache<_CharT, _Intl>::_M_cache(const locale& __loc) - { - _M_allocated = true; - - const moneypunct<_CharT, _Intl>& __mp = - use_facet<moneypunct<_CharT, _Intl> >(__loc); - - _M_grouping_size = __mp.grouping().size(); - char* __grouping = new char[_M_grouping_size]; - __mp.grouping().copy(__grouping, _M_grouping_size); - _M_grouping = __grouping; - _M_use_grouping = _M_grouping_size && __mp.grouping()[0] != 0; - - _M_decimal_point = __mp.decimal_point(); - _M_thousands_sep = __mp.thousands_sep(); - _M_frac_digits = __mp.frac_digits(); - - _M_curr_symbol_size = __mp.curr_symbol().size(); - _CharT* __curr_symbol = new _CharT[_M_curr_symbol_size]; - __mp.curr_symbol().copy(__curr_symbol, _M_curr_symbol_size); - _M_curr_symbol = __curr_symbol; - - _M_positive_sign_size = __mp.positive_sign().size(); - _CharT* __positive_sign = new _CharT[_M_positive_sign_size]; - __mp.positive_sign().copy(__positive_sign, _M_positive_sign_size); - _M_positive_sign = __positive_sign; - - _M_negative_sign_size = __mp.negative_sign().size(); - _CharT* __negative_sign = new _CharT[_M_negative_sign_size]; - __mp.negative_sign().copy(__negative_sign, _M_negative_sign_size); - _M_negative_sign = __negative_sign; - - _M_pos_format = __mp.pos_format(); - _M_neg_format = __mp.neg_format(); - - const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc); - __ct.widen(money_base::_S_atoms, - money_base::_S_atoms + money_base::_S_end, _M_atoms); - } - - - // Used by both numeric and monetary facets. - // Check to make sure that the __grouping_tmp string constructed in - // money_get or num_get matches the canonical grouping for a given - // locale. - // __grouping_tmp is parsed L to R - // 1,222,444 == __grouping_tmp of "\1\3\3" - // __grouping is parsed R to L - // 1,222,444 == __grouping of "\3" == "\3\3\3" - static bool - __verify_grouping(const char* __grouping, size_t __grouping_size, - const string& __grouping_tmp); - - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io, - ios_base::iostate& __err, string& __xtrc) const - { - typedef char_traits<_CharT> __traits_type; - typedef typename numpunct<_CharT>::__cache_type __cache_type; - __use_cache<__cache_type> __uc; - const locale& __loc = __io._M_getloc(); - const __cache_type* __lc = __uc(__loc); - const _CharT* __lit = __lc->_M_atoms_in; - - // True if a mantissa is found. - bool __found_mantissa = false; - - // First check for sign. - if (__beg != __end) - { - const char_type __c = *__beg; - const bool __plus = __c == __lit[__num_base::_S_iplus]; - if ((__plus || __c == __lit[__num_base::_S_iminus]) - && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) - && !(__c == __lc->_M_decimal_point)) - { - __xtrc += __plus ? '+' : '-'; - ++__beg; - } - } - - // Next, look for leading zeros. - while (__beg != __end) - { - const char_type __c = *__beg; - if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep - || __c == __lc->_M_decimal_point) - break; - else if (__c == __lit[__num_base::_S_izero]) - { - if (!__found_mantissa) - { - __xtrc += '0'; - __found_mantissa = true; - } - ++__beg; - } - else - break; - } - - // Only need acceptable digits for floating point numbers. - bool __found_dec = false; - bool __found_sci = false; - string __found_grouping; - if (__lc->_M_use_grouping) - __found_grouping.reserve(32); - int __sep_pos = 0; - const char_type* __lit_zero = __lit + __num_base::_S_izero; - while (__beg != __end) - { - // According to 22.2.2.1.2, p8-9, first look for thousands_sep - // and decimal_point. - const char_type __c = *__beg; - const char_type* __q = __traits_type::find(__lit_zero, 10, __c); - if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) - { - if (!__found_dec && !__found_sci) - { - // NB: Thousands separator at the beginning of a string - // is a no-no, as is two consecutive thousands separators. - if (__sep_pos) - { - __found_grouping += static_cast<char>(__sep_pos); - __sep_pos = 0; - ++__beg; - } - else - { - __err |= ios_base::failbit; - break; - } - } - else - break; - } - else if (__c == __lc->_M_decimal_point) - { - if (!__found_dec && !__found_sci) - { - // If no grouping chars are seen, no grouping check - // is applied. Therefore __found_grouping is adjusted - // only if decimal_point comes after some thousands_sep. - if (__found_grouping.size()) - __found_grouping += static_cast<char>(__sep_pos); - __xtrc += '.'; - __found_dec = true; - ++__beg; - } - else - break; - } - else if (__q != 0) - { - __xtrc += __num_base::_S_atoms_in[__q - __lit]; - __found_mantissa = true; - ++__sep_pos; - ++__beg; - } - else if ((__c == __lit[__num_base::_S_ie] - || __c == __lit[__num_base::_S_iE]) - && __found_mantissa && !__found_sci) - { - // Scientific notation. - if (__found_grouping.size() && !__found_dec) - __found_grouping += static_cast<char>(__sep_pos); - __xtrc += 'e'; - __found_sci = true; - - // Remove optional plus or minus sign, if they exist. - if (++__beg != __end) - { - const bool __plus = *__beg == __lit[__num_base::_S_iplus]; - if ((__plus || *__beg == __lit[__num_base::_S_iminus]) - && !(__lc->_M_use_grouping - && *__beg == __lc->_M_thousands_sep) - && !(*__beg == __lc->_M_decimal_point)) - { - __xtrc += __plus ? '+' : '-'; - ++__beg; - } - } - } - else - // Not a valid input item. - break; - } - - // Digit grouping is checked. If grouping and found_grouping don't - // match, then get very very upset, and set failbit. - if (__lc->_M_use_grouping && __found_grouping.size()) - { - // Add the ending grouping if a decimal or 'e'/'E' wasn't found. - if (!__found_dec && !__found_sci) - __found_grouping += static_cast<char>(__sep_pos); - - if (!std::__verify_grouping(__lc->_M_grouping, - __lc->_M_grouping_size, - __found_grouping)) - __err |= ios_base::failbit; - } - - // Finish up. - if (__beg == __end) - __err |= ios_base::eofbit; - return __beg; - } - - template<typename _CharT, typename _InIter> - template<typename _ValueT> - _InIter - num_get<_CharT, _InIter>:: - _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io, - ios_base::iostate& __err, _ValueT& __v) const - { - typedef char_traits<_CharT> __traits_type; - typedef typename numpunct<_CharT>::__cache_type __cache_type; - __use_cache<__cache_type> __uc; - const locale& __loc = __io._M_getloc(); - const __cache_type* __lc = __uc(__loc); - const _CharT* __lit = __lc->_M_atoms_in; - - // NB: Iff __basefield == 0, __base can change based on contents. - const ios_base::fmtflags __basefield = __io.flags() - & ios_base::basefield; - const bool __oct = __basefield == ios_base::oct; - int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10); - - // True if numeric digits are found. - bool __found_num = false; - - // First check for sign. - bool __negative = false; - if (__beg != __end) - { - const char_type __c = *__beg; - if (numeric_limits<_ValueT>::is_signed) - __negative = __c == __lit[__num_base::_S_iminus]; - if ((__negative || __c == __lit[__num_base::_S_iplus]) - && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) - && !(__c == __lc->_M_decimal_point)) - ++__beg; - } - - // Next, look for leading zeros and check required digits - // for base formats. - while (__beg != __end) - { - const char_type __c = *__beg; - if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep - || __c == __lc->_M_decimal_point) - break; - else if (__c == __lit[__num_base::_S_izero] - && (!__found_num || __base == 10)) - { - __found_num = true; - ++__beg; - } - else if (__found_num) - { - if (__c == __lit[__num_base::_S_ix] - || __c == __lit[__num_base::_S_iX]) - { - if (__basefield == 0) - __base = 16; - if (__base == 16) - { - __found_num = false; - ++__beg; - } - } - else if (__basefield == 0) - __base = 8; - break; - } - else - break; - } - - // At this point, base is determined. If not hex, only allow - // base digits as valid input. - const size_t __len = __base == 16 ? (__num_base::_S_iend - - __num_base::_S_izero) - : __base; - - // Extract. - string __found_grouping; - if (__lc->_M_use_grouping) - __found_grouping.reserve(32); - int __sep_pos = 0; - bool __overflow = false; - _ValueT __result = 0; - const char_type* __lit_zero = __lit + __num_base::_S_izero; - if (__negative) - { - const _ValueT __min = numeric_limits<_ValueT>::min() / __base; - for (; __beg != __end; ++__beg) - { - // According to 22.2.2.1.2, p8-9, first look for thousands_sep - // and decimal_point. - const char_type __c = *__beg; - const char_type* __q = __traits_type::find(__lit_zero, - __len, __c); - if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) - { - // NB: Thousands separator at the beginning of a string - // is a no-no, as is two consecutive thousands separators. - if (__sep_pos) - { - __found_grouping += static_cast<char>(__sep_pos); - __sep_pos = 0; - } - else - { - __err |= ios_base::failbit; - break; - } - } - else if (__c == __lc->_M_decimal_point) - break; - else if (__q != 0) - { - int __digit = __q - __lit_zero; - if (__digit > 15) - __digit -= 6; - if (__result < __min) - __overflow = true; - else - { - const _ValueT __new_result = __result * __base - - __digit; - __overflow |= __new_result > __result; - __result = __new_result; - ++__sep_pos; - __found_num = true; - } - } - else - // Not a valid input item. - break; - } - } - else - { - const _ValueT __max = numeric_limits<_ValueT>::max() / __base; - for (; __beg != __end; ++__beg) - { - const char_type __c = *__beg; - const char_type* __q = __traits_type::find(__lit_zero, - __len, __c); - if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) - { - if (__sep_pos) - { - __found_grouping += static_cast<char>(__sep_pos); - __sep_pos = 0; - } - else - { - __err |= ios_base::failbit; - break; - } - } - else if (__c == __lc->_M_decimal_point) - break; - else if (__q != 0) - { - int __digit = __q - __lit_zero; - if (__digit > 15) - __digit -= 6; - if (__result > __max) - __overflow = true; - else - { - const _ValueT __new_result = __result * __base - + __digit; - __overflow |= __new_result < __result; - __result = __new_result; - ++__sep_pos; - __found_num = true; - } - } - else - break; - } - } - - // Digit grouping is checked. If grouping and found_grouping don't - // match, then get very very upset, and set failbit. - if (__lc->_M_use_grouping && __found_grouping.size()) - { - // Add the ending grouping. - __found_grouping += static_cast<char>(__sep_pos); - - if (!std::__verify_grouping(__lc->_M_grouping, - __lc->_M_grouping_size, - __found_grouping)) - __err |= ios_base::failbit; - } - - if (!(__err & ios_base::failbit) && !__overflow - && __found_num) - __v = __result; - else - __err |= ios_base::failbit; - - if (__beg == __end) - __err |= ios_base::eofbit; - return __beg; - } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 17. Bad bool parsing - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, bool& __v) const - { - if (!(__io.flags() & ios_base::boolalpha)) - { - // Parse bool values as long. - // NB: We can't just call do_get(long) here, as it might - // refer to a derived class. - long __l = -1; - __beg = _M_extract_int(__beg, __end, __io, __err, __l); - if (__l == 0 || __l == 1) - __v = __l; - else - __err |= ios_base::failbit; - } - else - { - // Parse bool values as alphanumeric. - typedef char_traits<_CharT> __traits_type; - typedef typename numpunct<_CharT>::__cache_type __cache_type; - __use_cache<__cache_type> __uc; - const locale& __loc = __io._M_getloc(); - const __cache_type* __lc = __uc(__loc); - - bool __testf = true; - bool __testt = true; - size_t __n; - for (__n = 0; __beg != __end; ++__n, ++__beg) - { - if (__testf) - if (__n < __lc->_M_falsename_size) - __testf = *__beg == __lc->_M_falsename[__n]; - else - break; - - if (__testt) - if (__n < __lc->_M_truename_size) - __testt = *__beg == __lc->_M_truename[__n]; - else - break; - - if (!__testf && !__testt) - break; - } - if (__testf && __n == __lc->_M_falsename_size) - __v = 0; - else if (__testt && __n == __lc->_M_truename_size) - __v = 1; - else - __err |= ios_base::failbit; - - if (__beg == __end) - __err |= ios_base::eofbit; - } - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, long& __v) const - { return _M_extract_int(__beg, __end, __io, __err, __v); } - - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, unsigned short& __v) const - { return _M_extract_int(__beg, __end, __io, __err, __v); } - - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, unsigned int& __v) const - { return _M_extract_int(__beg, __end, __io, __err, __v); } - - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, unsigned long& __v) const - { return _M_extract_int(__beg, __end, __io, __err, __v); } - -#ifdef _GLIBCXX_USE_LONG_LONG - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, long long& __v) const - { return _M_extract_int(__beg, __end, __io, __err, __v); } - - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, unsigned long long& __v) const - { return _M_extract_int(__beg, __end, __io, __err, __v); } -#endif - - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, float& __v) const - { - string __xtrc; - __xtrc.reserve(32); - __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc); - std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale()); - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, double& __v) const - { - string __xtrc; - __xtrc.reserve(32); - __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc); - std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale()); - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, long double& __v) const - { - string __xtrc; - __xtrc.reserve(32); - __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc); -#if defined (GLIBCXX_NO_LONG_DOUBLE_IO) && !defined(_GLIBCXX_USE_C99) - double __vd; - std::__convert_to_v(__xtrc.c_str(), __vd, __err, _S_get_c_locale()); - __v = static_cast<long double>(__vd); -#else - std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale()); -#endif - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, void*& __v) const - { - // Prepare for hex formatted input. - typedef ios_base::fmtflags fmtflags; - const fmtflags __fmt = __io.flags(); - __io.flags(__fmt & ~ios_base::basefield | ios_base::hex); - - unsigned long __ul; - __beg = _M_extract_int(__beg, __end, __io, __err, __ul); - - // Reset from hex formatted input. - __io.flags(__fmt); - - if (!(__err & ios_base::failbit)) - __v = reinterpret_cast<void*>(__ul); - else - __err |= ios_base::failbit; - return __beg; - } - - // For use by integer and floating-point types after they have been - // converted into a char_type string. - template<typename _CharT, typename _OutIter> - void - num_put<_CharT, _OutIter>:: - _M_pad(_CharT __fill, streamsize __w, ios_base& __io, - _CharT* __new, const _CharT* __cs, int& __len) const - { - // [22.2.2.2.2] Stage 3. - // If necessary, pad. - __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new, __cs, - __w, __len, true); - __len = static_cast<int>(__w); - } - - // Forwarding functions to peel signed from unsigned integer types. - template<typename _CharT> - inline int - __int_to_char(_CharT* __bufend, long __v, const _CharT* __lit, - ios_base::fmtflags __flags) - { - unsigned long __ul = static_cast<unsigned long>(__v); - bool __neg = false; - if (__v < 0) - { - __ul = -__ul; - __neg = true; - } - return __int_to_char(__bufend, __ul, __lit, __flags, __neg); - } - - template<typename _CharT> - inline int - __int_to_char(_CharT* __bufend, unsigned long __v, const _CharT* __lit, - ios_base::fmtflags __flags) - { - // About showpos, see Table 60 and C99 7.19.6.1, p6 (+). - return __int_to_char(__bufend, __v, __lit, - __flags & ~ios_base::showpos, false); - } - -#ifdef _GLIBCXX_USE_LONG_LONG - template<typename _CharT> - inline int - __int_to_char(_CharT* __bufend, long long __v, const _CharT* __lit, - ios_base::fmtflags __flags) - { - unsigned long long __ull = static_cast<unsigned long long>(__v); - bool __neg = false; - if (__v < 0) - { - __ull = -__ull; - __neg = true; - } - return __int_to_char(__bufend, __ull, __lit, __flags, __neg); - } - - template<typename _CharT> - inline int - __int_to_char(_CharT* __bufend, unsigned long long __v, - const _CharT* __lit, ios_base::fmtflags __flags) - { return __int_to_char(__bufend, __v, __lit, - __flags & ~ios_base::showpos, false); } -#endif - - template<typename _CharT, typename _ValueT> - int - __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit, - ios_base::fmtflags __flags, bool __neg) - { - // Don't write base if already 0. - const bool __showbase = (__flags & ios_base::showbase) && __v; - const ios_base::fmtflags __basefield = __flags & ios_base::basefield; - _CharT* __buf = __bufend - 1; - - if (__builtin_expect(__basefield != ios_base::oct && - __basefield != ios_base::hex, true)) - { - // Decimal. - do - { - *__buf-- = __lit[(__v % 10) + __num_base::_S_odigits]; - __v /= 10; - } - while (__v != 0); - if (__neg) - *__buf-- = __lit[__num_base::_S_ominus]; - else if (__flags & ios_base::showpos) - *__buf-- = __lit[__num_base::_S_oplus]; - } - else if (__basefield == ios_base::oct) - { - // Octal. - do - { - *__buf-- = __lit[(__v & 0x7) + __num_base::_S_odigits]; - __v >>= 3; - } - while (__v != 0); - if (__showbase) - *__buf-- = __lit[__num_base::_S_odigits]; - } - else - { - // Hex. - const bool __uppercase = __flags & ios_base::uppercase; - const int __case_offset = __uppercase ? __num_base::_S_oudigits - : __num_base::_S_odigits; - do - { - *__buf-- = __lit[(__v & 0xf) + __case_offset]; - __v >>= 4; - } - while (__v != 0); - if (__showbase) - { - // 'x' or 'X' - *__buf-- = __lit[__num_base::_S_ox + __uppercase]; - // '0' - *__buf-- = __lit[__num_base::_S_odigits]; - } - } - return __bufend - __buf - 1; - } - - template<typename _CharT, typename _OutIter> - void - num_put<_CharT, _OutIter>:: - _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep, - ios_base& __io, _CharT* __new, _CharT* __cs, int& __len) const - { - // By itself __add_grouping cannot deal correctly with __cs when - // ios::showbase is set and ios_base::oct || ios_base::hex. - // Therefore we take care "by hand" of the initial 0, 0x or 0X. - // However, remember that the latter do not occur if the number - // printed is '0' (__len == 1). - streamsize __off = 0; - const ios_base::fmtflags __basefield = __io.flags() - & ios_base::basefield; - if ((__io.flags() & ios_base::showbase) && __len > 1) - if (__basefield == ios_base::oct) - { - __off = 1; - __new[0] = __cs[0]; - } - else if (__basefield == ios_base::hex) - { - __off = 2; - __new[0] = __cs[0]; - __new[1] = __cs[1]; - } - _CharT* __p; - __p = std::__add_grouping(__new + __off, __sep, __grouping, - __grouping_size, __cs + __off, - __cs + __len); - __len = __p - __new; - } - - template<typename _CharT, typename _OutIter> - template<typename _ValueT> - _OutIter - num_put<_CharT, _OutIter>:: - _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill, - _ValueT __v) const - { - typedef typename numpunct<_CharT>::__cache_type __cache_type; - __use_cache<__cache_type> __uc; - const locale& __loc = __io._M_getloc(); - const __cache_type* __lc = __uc(__loc); - const _CharT* __lit = __lc->_M_atoms_out; - - // Long enough to hold hex, dec, and octal representations. - const int __ilen = 4 * sizeof(_ValueT); - _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __ilen)); - - // [22.2.2.2.2] Stage 1, numeric conversion to character. - // Result is returned right-justified in the buffer. - int __len; - __len = __int_to_char(__cs + __ilen, __v, __lit, __io.flags()); - __cs += __ilen - __len; - - // Add grouping, if necessary. - if (__lc->_M_use_grouping) - { - // Grouping can add (almost) as many separators as the - // number of digits, but no more. - _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __len * 2)); - _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size, - __lc->_M_thousands_sep, __io, __cs2, __cs, __len); - __cs = __cs2; - } - - // Pad. - const streamsize __w = __io.width(); - if (__w > static_cast<streamsize>(__len)) - { - _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __w)); - _M_pad(__fill, __w, __io, __cs3, __cs, __len); - __cs = __cs3; - } - __io.width(0); - - // [22.2.2.2.2] Stage 4. - // Write resulting, fully-formatted string to output iterator. - return std::__write(__s, __cs, __len); - } - - template<typename _CharT, typename _OutIter> - void - num_put<_CharT, _OutIter>:: - _M_group_float(const char* __grouping, size_t __grouping_size, - _CharT __sep, const _CharT* __p, _CharT* __new, - _CharT* __cs, int& __len) const - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 282. What types does numpunct grouping refer to? - // Add grouping, if necessary. - _CharT* __p2; - const int __declen = __p ? __p - __cs : __len; - __p2 = std::__add_grouping(__new, __sep, __grouping, __grouping_size, - __cs, __cs + __declen); - - // Tack on decimal part. - int __newlen = __p2 - __new; - if (__p) - { - char_traits<_CharT>::copy(__p2, __p, __len - __declen); - __newlen += __len - __declen; - } - __len = __newlen; - } - - // The following code uses snprintf (or sprintf(), when - // _GLIBCXX_USE_C99 is not defined) to convert floating point values - // for insertion into a stream. An optimization would be to replace - // them with code that works directly on a wide buffer and then use - // __pad to do the padding. It would be good to replace them anyway - // to gain back the efficiency that C++ provides by knowing up front - // the type of the values to insert. Also, sprintf is dangerous - // since may lead to accidental buffer overruns. This - // implementation follows the C++ standard fairly directly as - // outlined in 22.2.2.2 [lib.locale.num.put] - template<typename _CharT, typename _OutIter> - template<typename _ValueT> - _OutIter - num_put<_CharT, _OutIter>:: - _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod, - _ValueT __v) const - { - typedef typename numpunct<_CharT>::__cache_type __cache_type; - __use_cache<__cache_type> __uc; - const locale& __loc = __io._M_getloc(); - const __cache_type* __lc = __uc(__loc); - - // Use default precision if out of range. - streamsize __prec = __io.precision(); - if (__prec < static_cast<streamsize>(0)) - __prec = static_cast<streamsize>(6); - - const int __max_digits = numeric_limits<_ValueT>::digits10; - - // [22.2.2.2.2] Stage 1, numeric conversion to character. - int __len; - // Long enough for the max format spec. - char __fbuf[16]; - -#ifdef _GLIBCXX_USE_C99 - // First try a buffer perhaps big enough (most probably sufficient - // for non-ios_base::fixed outputs) - int __cs_size = __max_digits * 3; - char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); - - __num_base::_S_format_float(__io, __fbuf, __mod); - __len = std::__convert_from_v(__cs, __cs_size, __fbuf, __v, - _S_get_c_locale(), __prec); - - // If the buffer was not large enough, try again with the correct size. - if (__len >= __cs_size) - { - __cs_size = __len + 1; - __cs = static_cast<char*>(__builtin_alloca(__cs_size)); - __len = std::__convert_from_v(__cs, __cs_size, __fbuf, __v, - _S_get_c_locale(), __prec); - } -#else - // Consider the possibility of long ios_base::fixed outputs - const bool __fixed = __io.flags() & ios_base::fixed; - const int __max_exp = numeric_limits<_ValueT>::max_exponent10; - - // The size of the output string is computed as follows. - // ios_base::fixed outputs may need up to __max_exp + 1 chars - // for the integer part + __prec chars for the fractional part - // + 3 chars for sign, decimal point, '\0'. On the other hand, - // for non-fixed outputs __max_digits * 2 + __prec chars are - // largely sufficient. - const int __cs_size = __fixed ? __max_exp + __prec + 4 - : __max_digits * 2 + __prec; - char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); - - __num_base::_S_format_float(__io, __fbuf, __mod); - __len = std::__convert_from_v(__cs, 0, __fbuf, __v, - _S_get_c_locale(), __prec); -#endif - - // [22.2.2.2.2] Stage 2, convert to char_type, using correct - // numpunct.decimal_point() values for '.' and adding grouping. - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - - _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __len)); - __ctype.widen(__cs, __cs + __len, __ws); - - // Replace decimal point. - const _CharT __cdec = __ctype.widen('.'); - const _CharT __dec = __lc->_M_decimal_point; - const _CharT* __p = char_traits<_CharT>::find(__ws, __len, __cdec); - if (__p) - __ws[__p - __ws] = __dec; - - // Add grouping, if necessary. - if (__lc->_M_use_grouping) - { - // Grouping can add (almost) as many separators as the - // number of digits, but no more. - _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __len * 2)); - _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size, - __lc->_M_thousands_sep, __p, __ws2, __ws, __len); - __ws = __ws2; - } - - // Pad. - const streamsize __w = __io.width(); - if (__w > static_cast<streamsize>(__len)) - { - _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __w)); - _M_pad(__fill, __w, __io, __ws3, __ws, __len); - __ws = __ws3; - } - __io.width(0); - - // [22.2.2.2.2] Stage 4. - // Write resulting, fully-formatted string to output iterator. - return std::__write(__s, __ws, __len); - } - - template<typename _CharT, typename _OutIter> - _OutIter - num_put<_CharT, _OutIter>:: - do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const - { - const ios_base::fmtflags __flags = __io.flags(); - if ((__flags & ios_base::boolalpha) == 0) - { - const long __l = __v; - __s = _M_insert_int(__s, __io, __fill, __l); - } - else - { - typedef typename numpunct<_CharT>::__cache_type __cache_type; - __use_cache<__cache_type> __uc; - const locale& __loc = __io._M_getloc(); - const __cache_type* __lc = __uc(__loc); - - const _CharT* __name = __v ? __lc->_M_truename - : __lc->_M_falsename; - int __len = __v ? __lc->_M_truename_size - : __lc->_M_falsename_size; - - const streamsize __w = __io.width(); - if (__w > static_cast<streamsize>(__len)) - { - _CharT* __cs - = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __w)); - _M_pad(__fill, __w, __io, __cs, __name, __len); - __name = __cs; - } - __io.width(0); - __s = std::__write(__s, __name, __len); - } - return __s; - } - - template<typename _CharT, typename _OutIter> - _OutIter - num_put<_CharT, _OutIter>:: - do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const - { return _M_insert_int(__s, __io, __fill, __v); } - - template<typename _CharT, typename _OutIter> - _OutIter - num_put<_CharT, _OutIter>:: - do_put(iter_type __s, ios_base& __io, char_type __fill, - unsigned long __v) const - { return _M_insert_int(__s, __io, __fill, __v); } - -#ifdef _GLIBCXX_USE_LONG_LONG - template<typename _CharT, typename _OutIter> - _OutIter - num_put<_CharT, _OutIter>:: - do_put(iter_type __s, ios_base& __b, char_type __fill, long long __v) const - { return _M_insert_int(__s, __b, __fill, __v); } - - template<typename _CharT, typename _OutIter> - _OutIter - num_put<_CharT, _OutIter>:: - do_put(iter_type __s, ios_base& __io, char_type __fill, - unsigned long long __v) const - { return _M_insert_int(__s, __io, __fill, __v); } -#endif - - template<typename _CharT, typename _OutIter> - _OutIter - num_put<_CharT, _OutIter>:: - do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const - { return _M_insert_float(__s, __io, __fill, char(), __v); } - - template<typename _CharT, typename _OutIter> - _OutIter - num_put<_CharT, _OutIter>:: - do_put(iter_type __s, ios_base& __io, char_type __fill, - long double __v) const - { -#ifdef _GLIBCXX_NO_LONG_DOUBLE_IO - return _M_insert_float(__s, __io, __fill, char_type(), - static_cast<double>(__v)); -#else - return _M_insert_float(__s, __io, __fill, 'L', __v); -#endif - } - - template<typename _CharT, typename _OutIter> - _OutIter - num_put<_CharT, _OutIter>:: - do_put(iter_type __s, ios_base& __io, char_type __fill, - const void* __v) const - { - const ios_base::fmtflags __flags = __io.flags(); - const ios_base::fmtflags __fmt = ~(ios_base::basefield - | ios_base::uppercase - | ios_base::internal); - __io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase)); - - __s = _M_insert_int(__s, __io, __fill, - reinterpret_cast<unsigned long>(__v)); - __io.flags(__flags); - return __s; - } - - template<typename _CharT, typename _InIter> - template<bool _Intl> - _InIter - money_get<_CharT, _InIter>:: - _M_extract(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, string& __units) const - { - typedef char_traits<_CharT> __traits_type; - typedef typename string_type::size_type size_type; - typedef money_base::part part; - typedef moneypunct<_CharT, _Intl> __moneypunct_type; - typedef typename __moneypunct_type::__cache_type __cache_type; - - const locale& __loc = __io._M_getloc(); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - - __use_cache<__cache_type> __uc; - const __cache_type* __lc = __uc(__loc); - const char_type* __lit = __lc->_M_atoms; - - // Deduced sign. - bool __negative = false; - // Sign size. - size_type __sign_size = 0; - // True if sign is mandatory. - const bool __mandatory_sign = (__lc->_M_positive_sign_size - && __lc->_M_negative_sign_size); - // String of grouping info from thousands_sep plucked from __units. - string __grouping_tmp; - if (__lc->_M_use_grouping) - __grouping_tmp.reserve(32); - // Last position before the decimal point. - int __last_pos = 0; - // Separator positions, then, possibly, fractional digits. - int __n = 0; - // If input iterator is in a valid state. - bool __testvalid = true; - // Flag marking when a decimal point is found. - bool __testdecfound = false; - - // The tentative returned string is stored here. - string __res; - __res.reserve(32); - - const char_type* __lit_zero = __lit + money_base::_S_zero; - const money_base::pattern __p = __lc->_M_neg_format; - for (int __i = 0; __i < 4 && __testvalid; ++__i) - { - const part __which = static_cast<part>(__p.field[__i]); - switch (__which) - { - case money_base::symbol: - // According to 22.2.6.1.2, p2, symbol is required - // if (__io.flags() & ios_base::showbase), otherwise - // is optional and consumed only if other characters - // are needed to complete the format. - if (__io.flags() & ios_base::showbase || __sign_size > 1 - || __i == 0 - || (__i == 1 && (__mandatory_sign - || (static_cast<part>(__p.field[0]) - == money_base::sign) - || (static_cast<part>(__p.field[2]) - == money_base::space))) - || (__i == 2 && ((static_cast<part>(__p.field[3]) - == money_base::value) - || __mandatory_sign - && (static_cast<part>(__p.field[3]) - == money_base::sign)))) - { - const size_type __len = __lc->_M_curr_symbol_size; - size_type __j = 0; - for (; __beg != __end && __j < __len - && *__beg == __lc->_M_curr_symbol[__j]; - ++__beg, ++__j); - if (__j != __len - && (__j || __io.flags() & ios_base::showbase)) - __testvalid = false; - } - break; - case money_base::sign: - // Sign might not exist, or be more than one character long. - if (__lc->_M_positive_sign_size && __beg != __end - && *__beg == __lc->_M_positive_sign[0]) - { - __sign_size = __lc->_M_positive_sign_size; - ++__beg; - } - else if (__lc->_M_negative_sign_size && __beg != __end - && *__beg == __lc->_M_negative_sign[0]) - { - __negative = true; - __sign_size = __lc->_M_negative_sign_size; - ++__beg; - } - else if (__lc->_M_positive_sign_size - && !__lc->_M_negative_sign_size) - // "... if no sign is detected, the result is given the sign - // that corresponds to the source of the empty string" - __negative = true; - else if (__mandatory_sign) - __testvalid = false; - break; - case money_base::value: - // Extract digits, remove and stash away the - // grouping of found thousands separators. - for (; __beg != __end; ++__beg) - { - const char_type* __q = __traits_type::find(__lit_zero, - 10, *__beg); - if (__q != 0) - { - __res += money_base::_S_atoms[__q - __lit]; - ++__n; - } - else if (*__beg == __lc->_M_decimal_point - && !__testdecfound) - { - __last_pos = __n; - __n = 0; - __testdecfound = true; - } - else if (__lc->_M_use_grouping - && *__beg == __lc->_M_thousands_sep - && !__testdecfound) - { - if (__n) - { - // Mark position for later analysis. - __grouping_tmp += static_cast<char>(__n); - __n = 0; - } - else - { - __testvalid = false; - break; - } - } - else - break; - } - if (__res.empty()) - __testvalid = false; - break; - case money_base::space: - // At least one space is required. - if (__beg != __end && __ctype.is(ctype_base::space, *__beg)) - ++__beg; - else - __testvalid = false; - case money_base::none: - // Only if not at the end of the pattern. - if (__i != 3) - for (; __beg != __end - && __ctype.is(ctype_base::space, *__beg); ++__beg); - break; - } - } - - // Need to get the rest of the sign characters, if they exist. - if (__sign_size > 1 && __testvalid) - { - const char_type* __sign = __negative ? __lc->_M_negative_sign - : __lc->_M_positive_sign; - size_type __i = 1; - for (; __beg != __end && __i < __sign_size - && *__beg == __sign[__i]; ++__beg, ++__i); - - if (__i != __sign_size) - __testvalid = false; - } - - if (__testvalid) - { - // Strip leading zeros. - if (__res.size() > 1) - { - const size_type __first = __res.find_first_not_of('0'); - const bool __only_zeros = __first == string::npos; - if (__first) - __res.erase(0, __only_zeros ? __res.size() - 1 : __first); - } - - // 22.2.6.1.2, p4 - if (__negative && __res[0] != '0') - __res.insert(__res.begin(), '-'); - - // Test for grouping fidelity. - if (__grouping_tmp.size()) - { - // Add the ending grouping. - __grouping_tmp += static_cast<char>(__testdecfound ? __last_pos - : __n); - if (!std::__verify_grouping(__lc->_M_grouping, - __lc->_M_grouping_size, - __grouping_tmp)) - __testvalid = false; - } - - // Iff not enough digits were supplied after the decimal-point. - if (__testdecfound && __lc->_M_frac_digits > 0 - && __n != __lc->_M_frac_digits) - __testvalid = false; - } - - // Iff no more characters are available. - if (__beg == __end) - __err |= ios_base::eofbit; - - // Iff valid sequence is not recognized. - if (!__testvalid) - __err |= ios_base::failbit; - else - __units.swap(__res); - - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - money_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io, - ios_base::iostate& __err, long double& __units) const - { - string __str; - if (__intl) - __beg = _M_extract<true>(__beg, __end, __io, __err, __str); - else - __beg = _M_extract<false>(__beg, __end, __io, __err, __str); -#if defined _GLIBCXX_NO_LONG_DOUBLE_IO && !defined (_GLIBCXX_USE_C99) - double __dunits; - std::__convert_to_v(__str.c_str(), __dunits, __err, _S_get_c_locale()); - __units = static_cast<long double>(__dunits); -#else // _GLIBCXX_NO_LONG_DOUBLE_IO && !defined (_GLIBCXX_USE_C99) - std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale()); -#endif // _GLIBCXX_NO_LONG_DOUBLE_IO - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - money_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io, - ios_base::iostate& __err, string_type& __units) const - { - typedef typename string::size_type size_type; - - const locale& __loc = __io._M_getloc(); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - - string __str; - const iter_type __ret = __intl ? _M_extract<true>(__beg, __end, __io, - __err, __str) - : _M_extract<false>(__beg, __end, __io, - __err, __str); - const size_type __len = __str.size(); - if (__len) - { - _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __len)); - __ctype.widen(__str.data(), __str.data() + __len, __ws); - __units.assign(__ws, __len); - } - - return __ret; - } - - template<typename _CharT, typename _OutIter> - template<bool _Intl> - _OutIter - money_put<_CharT, _OutIter>:: - _M_insert(iter_type __s, ios_base& __io, char_type __fill, - const string_type& __digits) const - { - typedef typename string_type::size_type size_type; - typedef money_base::part part; - typedef moneypunct<_CharT, _Intl> __moneypunct_type; - typedef typename __moneypunct_type::__cache_type __cache_type; - - const locale& __loc = __io._M_getloc(); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - - __use_cache<__cache_type> __uc; - const __cache_type* __lc = __uc(__loc); - const char_type* __lit = __lc->_M_atoms; - - // Determine if negative or positive formats are to be used, and - // discard leading negative_sign if it is present. - const char_type* __beg = __digits.data(); - - money_base::pattern __p; - const char_type* __sign; - size_type __sign_size; - if (*__beg != __lit[money_base::_S_minus]) - { - __p = __lc->_M_pos_format; - __sign = __lc->_M_positive_sign; - __sign_size = __lc->_M_positive_sign_size; - } - else - { - __p = __lc->_M_neg_format; - __sign = __lc->_M_negative_sign; - __sign_size = __lc->_M_negative_sign_size; - if (__digits.size()) - ++__beg; - } - - // Look for valid numbers in the ctype facet within input digits. - size_type __len = __ctype.scan_not(ctype_base::digit, __beg, - __beg + __digits.size()) - __beg; - if (__len) - { - // Assume valid input, and attempt to format. - // Break down input numbers into base components, as follows: - // final_value = grouped units + (decimal point) + (digits) - string_type __value; - __value.reserve(2 * __len); - - // Add thousands separators to non-decimal digits, per - // grouping rules. - int __paddec = __len - __lc->_M_frac_digits; - if (__paddec > 0) - { - if (__lc->_M_frac_digits < 0) - __paddec = __len; - if (__lc->_M_grouping_size) - { - _CharT* __ws = - static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * 2 * __len)); - _CharT* __ws_end = - std::__add_grouping(__ws, __lc->_M_thousands_sep, - __lc->_M_grouping, - __lc->_M_grouping_size, - __beg, __beg + __paddec); - __value.assign(__ws, __ws_end - __ws); - } - else - __value.assign(__beg, __paddec); - } - - // Deal with decimal point, decimal digits. - if (__lc->_M_frac_digits > 0) - { - __value += __lc->_M_decimal_point; - if (__paddec >= 0) - __value.append(__beg + __paddec, __lc->_M_frac_digits); - else - { - // Have to pad zeros in the decimal position. - __value.append(-__paddec, __lit[money_base::_S_zero]); - __value.append(__beg, __len); - } - } - - // Calculate length of resulting string. - const ios_base::fmtflags __f = __io.flags() - & ios_base::adjustfield; - __len = __value.size() + __sign_size; - __len += ((__io.flags() & ios_base::showbase) - ? __lc->_M_curr_symbol_size : 0); - - string_type __res; - __res.reserve(2 * __len); - - const size_type __width = static_cast<size_type>(__io.width()); - const bool __testipad = (__f == ios_base::internal - && __len < __width); - // Fit formatted digits into the required pattern. - for (int __i = 0; __i < 4; ++__i) - { - const part __which = static_cast<part>(__p.field[__i]); - switch (__which) - { - case money_base::symbol: - if (__io.flags() & ios_base::showbase) - __res.append(__lc->_M_curr_symbol, - __lc->_M_curr_symbol_size); - break; - case money_base::sign: - // Sign might not exist, or be more than one - // charater long. In that case, add in the rest - // below. - if (__sign_size) - __res += __sign[0]; - break; - case money_base::value: - __res += __value; - break; - case money_base::space: - // At least one space is required, but if internal - // formatting is required, an arbitrary number of - // fill spaces will be necessary. - if (__testipad) - __res.append(__width - __len, __fill); - else - __res += __fill; - break; - case money_base::none: - if (__testipad) - __res.append(__width - __len, __fill); - break; - } - } - - // Special case of multi-part sign parts. - if (__sign_size > 1) - __res.append(__sign + 1, __sign_size - 1); - - // Pad, if still necessary. - __len = __res.size(); - if (__width > __len) - { - if (__f == ios_base::left) - // After. - __res.append(__width - __len, __fill); - else - // Before. - __res.insert(0, __width - __len, __fill); - __len = __width; - } - - // Write resulting, fully-formatted string to output iterator. - __s = std::__write(__s, __res.data(), __len); - } - __io.width(0); - return __s; - } - - template<typename _CharT, typename _OutIter> - _OutIter - money_put<_CharT, _OutIter>:: - do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, - long double __units) const - { - const locale __loc = __io.getloc(); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); -#ifdef _GLIBCXX_NO_LONG_DOUBLE_IO - double __dunits = static_cast<double>(__units); -#ifdef _GLIBCXX_USE_C99 - // First try a buffer perhaps big enough. - int __cs_size = 64; - char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 328. Bad sprintf format modifier in money_put<>::do_put() - int __len = std::__convert_from_v(__cs, __cs_size, "%.0f", __dunits, - _S_get_c_locale(), 0); - // If the buffer was not large enough, try again with the correct size. - if (__len >= __cs_size) - { - __cs_size = __len + 1; - __cs = static_cast<char*>(__builtin_alloca(__cs_size)); - __len = std::__convert_from_v(__cs, __cs_size, "%.*f", __dunits, - _S_get_c_locale(), 0); - } -#else - // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'. - const int __cs_size = numeric_limits<long double>::max_exponent10 + 3; - char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); - int __len = std::__convert_from_v(__cs, 0, "%.*f", __dunits, - _S_get_c_locale(), 0); -#endif -#else // _GLIBCXX_NO_LONG_DOUBLE_IO -#ifdef _GLIBCXX_USE_C99 - // First try a buffer perhaps big enough. - int __cs_size = 64; - char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 328. Bad sprintf format modifier in money_put<>::do_put() - int __len = std::__convert_from_v(__cs, __cs_size, "%.*Lf", __units, - _S_get_c_locale(), 0); - // If the buffer was not large enough, try again with the correct size. - if (__len >= __cs_size) - { - __cs_size = __len + 1; - __cs = static_cast<char*>(__builtin_alloca(__cs_size)); - __len = std::__convert_from_v(__cs, __cs_size, "%.*Lf", __units, - _S_get_c_locale(), 0); - } -#else - // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'. - const int __cs_size = numeric_limits<long double>::max_exponent10 + 3; - char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); - int __len = std::__convert_from_v(__cs, 0, "%.*Lf", __units, - _S_get_c_locale(), 0); -#endif -#endif // _GLIBCXX_NO_LONG_DOUBLE_IO - _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __cs_size)); - __ctype.widen(__cs, __cs + __len, __ws); - const string_type __digits(__ws, __len); - return __intl ? _M_insert<true>(__s, __io, __fill, __digits) - : _M_insert<false>(__s, __io, __fill, __digits); - } - - template<typename _CharT, typename _OutIter> - _OutIter - money_put<_CharT, _OutIter>:: - do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, - const string_type& __digits) const - { return __intl ? _M_insert<true>(__s, __io, __fill, __digits) - : _M_insert<false>(__s, __io, __fill, __digits); } - - - // NB: Not especially useful. Without an ios_base object or some - // kind of locale reference, we are left clawing at the air where - // the side of the mountain used to be... - template<typename _CharT, typename _InIter> - time_base::dateorder - time_get<_CharT, _InIter>::do_date_order() const - { return time_base::no_order; } - - // Expand a strftime format string and parse it. E.g., do_get_date() may - // pass %m/%d/%Y => extracted characters. - template<typename _CharT, typename _InIter> - _InIter - time_get<_CharT, _InIter>:: - _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm, - const _CharT* __format) const - { - const locale& __loc = __io._M_getloc(); - const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - const size_t __len = char_traits<_CharT>::length(__format); - - for (size_t __i = 0; __beg != __end && __i < __len && !__err; ++__i) - { - if (__ctype.narrow(__format[__i], 0) == '%') - { - // Verify valid formatting code, attempt to extract. - char __c = __ctype.narrow(__format[++__i], 0); - int __mem = 0; - if (__c == 'E' || __c == 'O') - __c = __ctype.narrow(__format[++__i], 0); - switch (__c) - { - const char* __cs; - _CharT __wcs[10]; - case 'a': - // Abbreviated weekday name [tm_wday] - const char_type* __days1[7]; - __tp._M_days_abbreviated(__days1); - __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days1, - 7, __io, __err); - break; - case 'A': - // Weekday name [tm_wday]. - const char_type* __days2[7]; - __tp._M_days(__days2); - __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days2, - 7, __io, __err); - break; - case 'h': - case 'b': - // Abbreviated month name [tm_mon] - const char_type* __months1[12]; - __tp._M_months_abbreviated(__months1); - __beg = _M_extract_name(__beg, __end, __tm->tm_mon, - __months1, 12, __io, __err); - break; - case 'B': - // Month name [tm_mon]. - const char_type* __months2[12]; - __tp._M_months(__months2); - __beg = _M_extract_name(__beg, __end, __tm->tm_mon, - __months2, 12, __io, __err); - break; - case 'c': - // Default time and date representation. - const char_type* __dt[2]; - __tp._M_date_time_formats(__dt); - __beg = _M_extract_via_format(__beg, __end, __io, __err, - __tm, __dt[0]); - break; - case 'd': - // Day [01, 31]. [tm_mday] - __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 1, 31, 2, - __io, __err); - break; - case 'e': - // Day [1, 31], with single digits preceded by - // space. [tm_mday] - if (__ctype.is(ctype_base::space, *__beg)) - __beg = _M_extract_num(++__beg, __end, __tm->tm_mday, 1, 9, - 1, __io, __err); - else - __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 10, 31, - 2, __io, __err); - break; - case 'D': - // Equivalent to %m/%d/%y.[tm_mon, tm_mday, tm_year] - __cs = "%m/%d/%y"; - __ctype.widen(__cs, __cs + 9, __wcs); - __beg = _M_extract_via_format(__beg, __end, __io, __err, - __tm, __wcs); - break; - case 'H': - // Hour [00, 23]. [tm_hour] - __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 0, 23, 2, - __io, __err); - break; - case 'I': - // Hour [01, 12]. [tm_hour] - __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 1, 12, 2, - __io, __err); - break; - case 'm': - // Month [01, 12]. [tm_mon] - __beg = _M_extract_num(__beg, __end, __mem, 1, 12, 2, - __io, __err); - if (!__err) - __tm->tm_mon = __mem - 1; - break; - case 'M': - // Minute [00, 59]. [tm_min] - __beg = _M_extract_num(__beg, __end, __tm->tm_min, 0, 59, 2, - __io, __err); - break; - case 'n': - if (__ctype.narrow(*__beg, 0) == '\n') - ++__beg; - else - __err |= ios_base::failbit; - break; - case 'R': - // Equivalent to (%H:%M). - __cs = "%H:%M"; - __ctype.widen(__cs, __cs + 6, __wcs); - __beg = _M_extract_via_format(__beg, __end, __io, __err, - __tm, __wcs); - break; - case 'S': - // Seconds. [tm_sec] - // [00, 60] in C99 (one leap-second), [00, 61] in C89. -#ifdef _GLIBCXX_USE_C99 - __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 60, 2, -#else - __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 61, 2, -#endif - __io, __err); - break; - case 't': - if (__ctype.narrow(*__beg, 0) == '\t') - ++__beg; - else - __err |= ios_base::failbit; - break; - case 'T': - // Equivalent to (%H:%M:%S). - __cs = "%H:%M:%S"; - __ctype.widen(__cs, __cs + 9, __wcs); - __beg = _M_extract_via_format(__beg, __end, __io, __err, - __tm, __wcs); - break; - case 'x': - // Locale's date. - const char_type* __dates[2]; - __tp._M_date_formats(__dates); - __beg = _M_extract_via_format(__beg, __end, __io, __err, - __tm, __dates[0]); - break; - case 'X': - // Locale's time. - const char_type* __times[2]; - __tp._M_time_formats(__times); - __beg = _M_extract_via_format(__beg, __end, __io, __err, - __tm, __times[0]); - break; - case 'y': - case 'C': // C99 - // Two digit year. [tm_year] - __beg = _M_extract_num(__beg, __end, __tm->tm_year, 0, 99, 2, - __io, __err); - break; - case 'Y': - // Year [1900). [tm_year] - __beg = _M_extract_num(__beg, __end, __mem, 0, 9999, 4, - __io, __err); - if (!__err) - __tm->tm_year = __mem - 1900; - break; - case 'Z': - // Timezone info. - if (__ctype.is(ctype_base::upper, *__beg)) - { - int __tmp; - __beg = _M_extract_name(__beg, __end, __tmp, - __timepunct_cache<_CharT>::_S_timezones, - 14, __io, __err); - - // GMT requires special effort. - if (__beg != __end && !__err && __tmp == 0 - && (*__beg == __ctype.widen('-') - || *__beg == __ctype.widen('+'))) - { - __beg = _M_extract_num(__beg, __end, __tmp, 0, 23, 2, - __io, __err); - __beg = _M_extract_num(__beg, __end, __tmp, 0, 59, 2, - __io, __err); - } - } - else - __err |= ios_base::failbit; - break; - default: - // Not recognized. - __err |= ios_base::failbit; - } - } - else - { - // Verify format and input match, extract and discard. - if (__format[__i] == *__beg) - ++__beg; - else - __err |= ios_base::failbit; - } - } - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - time_get<_CharT, _InIter>:: - _M_extract_num(iter_type __beg, iter_type __end, int& __member, - int __min, int __max, size_t __len, - ios_base& __io, ios_base::iostate& __err) const - { - const locale& __loc = __io._M_getloc(); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - - // As-is works for __len = 1, 2, 4, the values actually used. - int __mult = __len == 2 ? 10 : (__len == 4 ? 1000 : 1); - - ++__min; - size_t __i = 0; - int __value = 0; - for (; __beg != __end && __i < __len; ++__beg, ++__i) - { - const char __c = __ctype.narrow(*__beg, '*'); - if (__c >= '0' && __c <= '9') - { - __value = __value * 10 + (__c - '0'); - const int __valuec = __value * __mult; - if (__valuec > __max || __valuec + __mult < __min) - break; - __mult /= 10; - } - else - break; - } - if (__i == __len) - __member = __value; - else - __err |= ios_base::failbit; - return __beg; - } - - // Assumptions: - // All elements in __names are unique. - template<typename _CharT, typename _InIter> - _InIter - time_get<_CharT, _InIter>:: - _M_extract_name(iter_type __beg, iter_type __end, int& __member, - const _CharT** __names, size_t __indexlen, - ios_base& __io, ios_base::iostate& __err) const - { - typedef char_traits<_CharT> __traits_type; - const locale& __loc = __io._M_getloc(); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - - int* __matches = static_cast<int*>(__builtin_alloca(sizeof(int) - * __indexlen)); - size_t __nmatches = 0; - size_t __pos = 0; - bool __testvalid = true; - const char_type* __name; - - // Look for initial matches. - // NB: Some of the locale data is in the form of all lowercase - // names, and some is in the form of initially-capitalized - // names. Look for both. - if (__beg != __end) - { - const char_type __c = *__beg; - for (size_t __i1 = 0; __i1 < __indexlen; ++__i1) - if (__c == __names[__i1][0] - || __c == __ctype.toupper(__names[__i1][0])) - __matches[__nmatches++] = __i1; - } - - while (__nmatches > 1) - { - // Find smallest matching string. - size_t __minlen = __traits_type::length(__names[__matches[0]]); - for (size_t __i2 = 1; __i2 < __nmatches; ++__i2) - __minlen = std::min(__minlen, - __traits_type::length(__names[__matches[__i2]])); - ++__beg, ++__pos; - if (__pos < __minlen && __beg != __end) - for (size_t __i3 = 0; __i3 < __nmatches;) - { - __name = __names[__matches[__i3]]; - if (__name[__pos] != *__beg) - __matches[__i3] = __matches[--__nmatches]; - else - ++__i3; - } - else - break; - } - - if (__nmatches == 1) - { - // Make sure found name is completely extracted. - ++__beg, ++__pos; - __name = __names[__matches[0]]; - const size_t __len = __traits_type::length(__name); - while (__pos < __len && __beg != __end && __name[__pos] == *__beg) - ++__beg, ++__pos; - - if (__len == __pos) - __member = __matches[0]; - else - __testvalid = false; - } - else - __testvalid = false; - if (!__testvalid) - __err |= ios_base::failbit; - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - time_get<_CharT, _InIter>:: - do_get_time(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const - { - const locale& __loc = __io._M_getloc(); - const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); - const char_type* __times[2]; - __tp._M_time_formats(__times); - __beg = _M_extract_via_format(__beg, __end, __io, __err, - __tm, __times[0]); - if (__beg == __end) - __err |= ios_base::eofbit; - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - time_get<_CharT, _InIter>:: - do_get_date(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const - { - const locale& __loc = __io._M_getloc(); - const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); - const char_type* __dates[2]; - __tp._M_date_formats(__dates); - __beg = _M_extract_via_format(__beg, __end, __io, __err, - __tm, __dates[0]); - if (__beg == __end) - __err |= ios_base::eofbit; - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - time_get<_CharT, _InIter>:: - do_get_weekday(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const - { - typedef char_traits<_CharT> __traits_type; - const locale& __loc = __io._M_getloc(); - const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - const char_type* __days[7]; - __tp._M_days_abbreviated(__days); - int __tmpwday; - __beg = _M_extract_name(__beg, __end, __tmpwday, __days, 7, __io, __err); - - // Check to see if non-abbreviated name exists, and extract. - // NB: Assumes both _M_days and _M_days_abbreviated organized in - // exact same order, first to last, such that the resulting - // __days array with the same index points to a day, and that - // day's abbreviated form. - // NB: Also assumes that an abbreviated name is a subset of the name. - if (!__err && __beg != __end) - { - size_t __pos = __traits_type::length(__days[__tmpwday]); - __tp._M_days(__days); - const char_type* __name = __days[__tmpwday]; - if (__name[__pos] == *__beg) - { - // Extract the rest of it. - const size_t __len = __traits_type::length(__name); - while (__pos < __len && __beg != __end - && __name[__pos] == *__beg) - ++__beg, ++__pos; - if (__len != __pos) - __err |= ios_base::failbit; - } - } - if (!__err) - __tm->tm_wday = __tmpwday; - - if (__beg == __end) - __err |= ios_base::eofbit; - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - time_get<_CharT, _InIter>:: - do_get_monthname(iter_type __beg, iter_type __end, - ios_base& __io, ios_base::iostate& __err, tm* __tm) const - { - typedef char_traits<_CharT> __traits_type; - const locale& __loc = __io._M_getloc(); - const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - const char_type* __months[12]; - __tp._M_months_abbreviated(__months); - int __tmpmon; - __beg = _M_extract_name(__beg, __end, __tmpmon, __months, 12, - __io, __err); - - // Check to see if non-abbreviated name exists, and extract. - // NB: Assumes both _M_months and _M_months_abbreviated organized in - // exact same order, first to last, such that the resulting - // __months array with the same index points to a month, and that - // month's abbreviated form. - // NB: Also assumes that an abbreviated name is a subset of the name. - if (!__err && __beg != __end) - { - size_t __pos = __traits_type::length(__months[__tmpmon]); - __tp._M_months(__months); - const char_type* __name = __months[__tmpmon]; - if (__name[__pos] == *__beg) - { - // Extract the rest of it. - const size_t __len = __traits_type::length(__name); - while (__pos < __len && __beg != __end - && __name[__pos] == *__beg) - ++__beg, ++__pos; - if (__len != __pos) - __err |= ios_base::failbit; - } - } - if (!__err) - __tm->tm_mon = __tmpmon; - - if (__beg == __end) - __err |= ios_base::eofbit; - return __beg; - } - - template<typename _CharT, typename _InIter> - _InIter - time_get<_CharT, _InIter>:: - do_get_year(iter_type __beg, iter_type __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm) const - { - const locale& __loc = __io._M_getloc(); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - - size_t __i = 0; - int __value = 0; - for (; __beg != __end && __i < 4; ++__beg, ++__i) - { - const char __c = __ctype.narrow(*__beg, '*'); - if (__c >= '0' && __c <= '9') - __value = __value * 10 + (__c - '0'); - else - break; - } - if (__i == 2 || __i == 4) - __tm->tm_year = __i == 2 ? __value : __value - 1900; - else - __err |= ios_base::failbit; - if (__beg == __end) - __err |= ios_base::eofbit; - return __beg; - } - - template<typename _CharT, typename _OutIter> - _OutIter - time_put<_CharT, _OutIter>:: - put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, - const _CharT* __beg, const _CharT* __end) const - { - const locale& __loc = __io._M_getloc(); - ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc); - for (; __beg != __end; ++__beg) - if (__ctype.narrow(*__beg, 0) != '%') - { - *__s = *__beg; - ++__s; - } - else if (++__beg != __end) - { - char __format; - char __mod = 0; - const char __c = __ctype.narrow(*__beg, 0); - if (__c != 'E' && __c != 'O') - __format = __c; - else if (++__beg != __end) - { - __mod = __c; - __format = __ctype.narrow(*__beg, 0); - } - else - break; - __s = this->do_put(__s, __io, __fill, __tm, __format, __mod); - } - else - break; - return __s; - } - - template<typename _CharT, typename _OutIter> - _OutIter - time_put<_CharT, _OutIter>:: - do_put(iter_type __s, ios_base& __io, char_type, const tm* __tm, - char __format, char __mod) const - { - const locale& __loc = __io._M_getloc(); - ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc); - __timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc); - - // NB: This size is arbitrary. Should this be a data member, - // initialized at construction? - const size_t __maxlen = 128; - char_type* __res = - static_cast<char_type*>(__builtin_alloca(sizeof(char_type) * __maxlen)); - - // NB: In IEE 1003.1-200x, and perhaps other locale models, it - // is possible that the format character will be longer than one - // character. Possibilities include 'E' or 'O' followed by a - // format character: if __mod is not the default argument, assume - // it's a valid modifier. - char_type __fmt[4]; - __fmt[0] = __ctype.widen('%'); - if (!__mod) - { - __fmt[1] = __format; - __fmt[2] = char_type(); - } - else - { - __fmt[1] = __mod; - __fmt[2] = __format; - __fmt[3] = char_type(); - } - - __tp._M_put(__res, __maxlen, __fmt, __tm); - - // Write resulting, fully-formatted string to output iterator. - return std::__write(__s, __res, char_traits<char_type>::length(__res)); - } - - - // Generic version does nothing. - template<typename _CharT> - int - collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const - { return 0; } - - // Generic version does nothing. - template<typename _CharT> - size_t - collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const - { return 0; } - - template<typename _CharT> - int - collate<_CharT>:: - do_compare(const _CharT* __lo1, const _CharT* __hi1, - const _CharT* __lo2, const _CharT* __hi2) const - { - // strcoll assumes zero-terminated strings so we make a copy - // and then put a zero at the end. - const string_type __one(__lo1, __hi1); - const string_type __two(__lo2, __hi2); - - const _CharT* __p = __one.c_str(); - const _CharT* __pend = __one.data() + __one.length(); - const _CharT* __q = __two.c_str(); - const _CharT* __qend = __two.data() + __two.length(); - - // strcoll stops when it sees a nul character so we break - // the strings into zero-terminated substrings and pass those - // to strcoll. - for (;;) - { - const int __res = _M_compare(__p, __q); - if (__res) - return __res; - - __p += char_traits<_CharT>::length(__p); - __q += char_traits<_CharT>::length(__q); - if (__p == __pend && __q == __qend) - return 0; - else if (__p == __pend) - return -1; - else if (__q == __qend) - return 1; - - __p++; - __q++; - } - } - - template<typename _CharT> - typename collate<_CharT>::string_type - collate<_CharT>:: - do_transform(const _CharT* __lo, const _CharT* __hi) const - { - // strxfrm assumes zero-terminated strings so we make a copy - string_type __str(__lo, __hi); - - const _CharT* __p = __str.c_str(); - const _CharT* __pend = __str.data() + __str.length(); - - size_t __len = (__hi - __lo) * 2; - - string_type __ret; - - // strxfrm stops when it sees a nul character so we break - // the string into zero-terminated substrings and pass those - // to strxfrm. - for (;;) - { - // First try a buffer perhaps big enough. - _CharT* __c = - static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __len)); - size_t __res = _M_transform(__c, __p, __len); - // If the buffer was not large enough, try again with the - // correct size. - if (__res >= __len) - { - __len = __res + 1; - __c = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __len)); - __res = _M_transform(__c, __p, __res + 1); - } - - __ret.append(__c, __res); - __p += char_traits<_CharT>::length(__p); - if (__p == __pend) - return __ret; - - __p++; - __ret.push_back(_CharT()); - } - } - - template<typename _CharT> - long - collate<_CharT>:: - do_hash(const _CharT* __lo, const _CharT* __hi) const - { - unsigned long __val = 0; - for (; __lo < __hi; ++__lo) - __val = *__lo + ((__val << 7) | - (__val >> (numeric_limits<unsigned long>::digits - 7))); - return static_cast<long>(__val); - } - - // Construct correctly padded string, as per 22.2.2.2.2 - // Assumes - // __newlen > __oldlen - // __news is allocated for __newlen size - // Used by both num_put and ostream inserters: if __num, - // internal-adjusted objects are padded according to the rules below - // concerning 0[xX] and +-, otherwise, exactly as right-adjusted - // ones are. - - // NB: Of the two parameters, _CharT can be deduced from the - // function arguments. The other (_Traits) has to be explicitly specified. - template<typename _CharT, typename _Traits> - void - __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill, - _CharT* __news, const _CharT* __olds, - const streamsize __newlen, - const streamsize __oldlen, const bool __num) - { - const size_t __plen = static_cast<size_t>(__newlen - __oldlen); - const ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield; - - // Padding last. - if (__adjust == ios_base::left) - { - _Traits::copy(__news, const_cast<_CharT*>(__olds), __oldlen); - _Traits::assign(__news + __oldlen, __plen, __fill); - return; - } - - size_t __mod = 0; - if (__adjust == ios_base::internal && __num) - { - // Pad after the sign, if there is one. - // Pad after 0[xX], if there is one. - // Who came up with these rules, anyway? Jeeze. - const locale& __loc = __io._M_getloc(); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - - const bool __testsign = (__ctype.widen('-') == __olds[0] - || __ctype.widen('+') == __olds[0]); - const bool __testhex = (__ctype.widen('0') == __olds[0] - && __oldlen > 1 - && (__ctype.widen('x') == __olds[1] - || __ctype.widen('X') == __olds[1])); - if (__testhex) - { - __news[0] = __olds[0]; - __news[1] = __olds[1]; - __mod = 2; - __news += 2; - } - else if (__testsign) - { - __news[0] = __olds[0]; - __mod = 1; - ++__news; - } - // else Padding first. - } - _Traits::assign(__news, __plen, __fill); - _Traits::copy(__news + __plen, const_cast<_CharT*>(__olds + __mod), - __oldlen - __mod); - } - - bool - __verify_grouping(const char* __grouping, size_t __grouping_size, - const string& __grouping_tmp) - { - const size_t __n = __grouping_tmp.size() - 1; - const size_t __min = std::min(__n, __grouping_size - 1); - size_t __i = __n; - bool __test = true; - - // Parsed number groupings have to match the - // numpunct::grouping string exactly, starting at the - // right-most point of the parsed sequence of elements ... - for (size_t __j = 0; __j < __min && __test; --__i, ++__j) - __test = __grouping_tmp[__i] == __grouping[__j]; - for (; __i && __test; --__i) - __test = __grouping_tmp[__i] == __grouping[__min]; - // ... but the last parsed grouping can be <= numpunct - // grouping. - __test &= __grouping_tmp[0] <= __grouping[__min]; - return __test; - } - - template<typename _CharT> - _CharT* - __add_grouping(_CharT* __s, _CharT __sep, - const char* __gbeg, size_t __gsize, - const _CharT* __first, const _CharT* __last) - { - if (__last - __first > *__gbeg) - { - const bool __bump = __gsize != 1; - __s = std::__add_grouping(__s, __sep, __gbeg + __bump, - __gsize - __bump, __first, - __last - *__gbeg); - __first = __last - *__gbeg; - *__s++ = __sep; - } - do - *__s++ = *__first++; - while (__first != __last); - return __s; - } - - // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. -#if _GLIBCXX_EXTERN_TEMPLATE - extern template class moneypunct<char, false>; - extern template class moneypunct<char, true>; - extern template class moneypunct_byname<char, false>; - extern template class moneypunct_byname<char, true>; - extern template class money_get<char>; - extern template class money_put<char>; - extern template class numpunct<char>; - extern template class numpunct_byname<char>; - extern template class num_get<char>; - extern template class num_put<char>; - extern template class __timepunct<char>; - extern template class time_put<char>; - extern template class time_put_byname<char>; - extern template class time_get<char>; - extern template class time_get_byname<char>; - extern template class messages<char>; - extern template class messages_byname<char>; - extern template class ctype_byname<char>; - extern template class codecvt_byname<char, char, mbstate_t>; - extern template class collate<char>; - extern template class collate_byname<char>; - - extern template - const codecvt<char, char, mbstate_t>& - use_facet<codecvt<char, char, mbstate_t> >(const locale&); - - extern template - const collate<char>& - use_facet<collate<char> >(const locale&); - - extern template - const numpunct<char>& - use_facet<numpunct<char> >(const locale&); - - extern template - const num_put<char>& - use_facet<num_put<char> >(const locale&); - - extern template - const num_get<char>& - use_facet<num_get<char> >(const locale&); - - extern template - const moneypunct<char, true>& - use_facet<moneypunct<char, true> >(const locale&); - - extern template - const moneypunct<char, false>& - use_facet<moneypunct<char, false> >(const locale&); - - extern template - const money_put<char>& - use_facet<money_put<char> >(const locale&); - - extern template - const money_get<char>& - use_facet<money_get<char> >(const locale&); - - extern template - const __timepunct<char>& - use_facet<__timepunct<char> >(const locale&); - - extern template - const time_put<char>& - use_facet<time_put<char> >(const locale&); - - extern template - const time_get<char>& - use_facet<time_get<char> >(const locale&); - - extern template - const messages<char>& - use_facet<messages<char> >(const locale&); - - extern template - bool - has_facet<ctype<char> >(const locale&); - - extern template - bool - has_facet<codecvt<char, char, mbstate_t> >(const locale&); - - extern template - bool - has_facet<collate<char> >(const locale&); - - extern template - bool - has_facet<numpunct<char> >(const locale&); - - extern template - bool - has_facet<num_put<char> >(const locale&); - - extern template - bool - has_facet<num_get<char> >(const locale&); - - extern template - bool - has_facet<moneypunct<char> >(const locale&); - - extern template - bool - has_facet<money_put<char> >(const locale&); - - extern template - bool - has_facet<money_get<char> >(const locale&); - - extern template - bool - has_facet<__timepunct<char> >(const locale&); - - extern template - bool - has_facet<time_put<char> >(const locale&); - - extern template - bool - has_facet<time_get<char> >(const locale&); - - extern template - bool - has_facet<messages<char> >(const locale&); - -#ifdef _GLIBCXX_USE_WCHAR_T - extern template class moneypunct<wchar_t, false>; - extern template class moneypunct<wchar_t, true>; - extern template class moneypunct_byname<wchar_t, false>; - extern template class moneypunct_byname<wchar_t, true>; - extern template class money_get<wchar_t>; - extern template class money_put<wchar_t>; - extern template class numpunct<wchar_t>; - extern template class numpunct_byname<wchar_t>; - extern template class num_get<wchar_t>; - extern template class num_put<wchar_t>; - extern template class __timepunct<wchar_t>; - extern template class time_put<wchar_t>; - extern template class time_put_byname<wchar_t>; - extern template class time_get<wchar_t>; - extern template class time_get_byname<wchar_t>; - extern template class messages<wchar_t>; - extern template class messages_byname<wchar_t>; - extern template class ctype_byname<wchar_t>; - extern template class codecvt_byname<wchar_t, char, mbstate_t>; - extern template class collate<wchar_t>; - extern template class collate_byname<wchar_t>; - - extern template - const codecvt<wchar_t, char, mbstate_t>& - use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&); - - extern template - const collate<wchar_t>& - use_facet<collate<wchar_t> >(const locale&); - - extern template - const numpunct<wchar_t>& - use_facet<numpunct<wchar_t> >(const locale&); - - extern template - const num_put<wchar_t>& - use_facet<num_put<wchar_t> >(const locale&); - - extern template - const num_get<wchar_t>& - use_facet<num_get<wchar_t> >(const locale&); - - extern template - const moneypunct<wchar_t, true>& - use_facet<moneypunct<wchar_t, true> >(const locale&); - - extern template - const moneypunct<wchar_t, false>& - use_facet<moneypunct<wchar_t, false> >(const locale&); - - extern template - const money_put<wchar_t>& - use_facet<money_put<wchar_t> >(const locale&); - - extern template - const money_get<wchar_t>& - use_facet<money_get<wchar_t> >(const locale&); - - extern template - const __timepunct<wchar_t>& - use_facet<__timepunct<wchar_t> >(const locale&); - - extern template - const time_put<wchar_t>& - use_facet<time_put<wchar_t> >(const locale&); - - extern template - const time_get<wchar_t>& - use_facet<time_get<wchar_t> >(const locale&); - - extern template - const messages<wchar_t>& - use_facet<messages<wchar_t> >(const locale&); - - extern template - bool - has_facet<ctype<wchar_t> >(const locale&); - - extern template - bool - has_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&); - - extern template - bool - has_facet<collate<wchar_t> >(const locale&); - - extern template - bool - has_facet<numpunct<wchar_t> >(const locale&); - - extern template - bool - has_facet<num_put<wchar_t> >(const locale&); - - extern template - bool - has_facet<num_get<wchar_t> >(const locale&); - - extern template - bool - has_facet<moneypunct<wchar_t> >(const locale&); - - extern template - bool - has_facet<money_put<wchar_t> >(const locale&); - - extern template - bool - has_facet<money_get<wchar_t> >(const locale&); - - extern template - bool - has_facet<__timepunct<wchar_t> >(const locale&); - - extern template - bool - has_facet<time_put<wchar_t> >(const locale&); - - extern template - bool - has_facet<time_get<wchar_t> >(const locale&); - - extern template - bool - has_facet<messages<wchar_t> >(const locale&); -#endif -#endif -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/localefwd.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/localefwd.h deleted file mode 100644 index 247158df374..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/localefwd.h +++ /dev/null @@ -1,192 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.1 Locales -// - -/** @file localefwd.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _LOCALE_FWD_H -#define _LOCALE_FWD_H 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/c++locale.h> // Defines __c_locale, config-specific includes -#include <iosfwd> // For ostreambuf_iterator, istreambuf_iterator -#include <bits/functexcept.h> - -namespace std -{ - // 22.1.1 Locale - class locale; - - // 22.1.3 Convenience interfaces - template<typename _CharT> - inline bool - isspace(_CharT, const locale&); - - template<typename _CharT> - inline bool - isprint(_CharT, const locale&); - - template<typename _CharT> - inline bool - iscntrl(_CharT, const locale&); - - template<typename _CharT> - inline bool - isupper(_CharT, const locale&); - - template<typename _CharT> - inline bool - islower(_CharT, const locale&); - - template<typename _CharT> - inline bool - isalpha(_CharT, const locale&); - - template<typename _CharT> - inline bool - isdigit(_CharT, const locale&); - - template<typename _CharT> - inline bool - ispunct(_CharT, const locale&); - - template<typename _CharT> - inline bool - isxdigit(_CharT, const locale&); - - template<typename _CharT> - inline bool - isalnum(_CharT, const locale&); - - template<typename _CharT> - inline bool - isgraph(_CharT, const locale&); - - template<typename _CharT> - inline _CharT - toupper(_CharT, const locale&); - - template<typename _CharT> - inline _CharT - tolower(_CharT, const locale&); - - // 22.2.1 and 22.2.1.3 ctype - class ctype_base; - template<typename _CharT> - class ctype; - template<> class ctype<char>; -#ifdef _GLIBCXX_USE_WCHAR_T - template<> class ctype<wchar_t>; -#endif - template<typename _CharT> - class ctype_byname; - // NB: Specialized for char and wchar_t in locale_facets.h. - - class codecvt_base; - class __enc_traits; - template<typename _InternT, typename _ExternT, typename _StateT> - class codecvt; - template<> class codecvt<char, char, mbstate_t>; -#ifdef _GLIBCXX_USE_WCHAR_T - template<> class codecvt<wchar_t, char, mbstate_t>; -#endif - template<typename _InternT, typename _ExternT, typename _StateT> - class codecvt_byname; - - // 22.2.2 and 22.2.3 numeric - template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> > - class num_get; - template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> > - class num_put; - template<typename _CharT> class numpunct; - template<typename _CharT> class numpunct_byname; - - // 22.2.4 collation - template<typename _CharT> - class collate; - template<typename _CharT> class - collate_byname; - - // 22.2.5 date and time - class time_base; - template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> > - class time_get; - template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> > - class time_get_byname; - template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> > - class time_put; - template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> > - class time_put_byname; - - // 22.2.6 money - class money_base; - template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> > - class money_get; - template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> > - class money_put; - template<typename _CharT, bool _Intl = false> - class moneypunct; - template<typename _CharT, bool _Intl = false> - class moneypunct_byname; - - // 22.2.7 message retrieval - class messages_base; - template<typename _CharT> - class messages; - template<typename _CharT> - class messages_byname; - - template<typename _Facet> - bool - has_facet(const locale& __loc) throw(); - - template<typename _Facet> - const _Facet& - use_facet(const locale& __loc); - - template<typename _Facet> - inline const _Facet& - __check_facet(const _Facet* __f) - { - if (!__f) - __throw_bad_cast(); - return *__f; - } -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/mask_array.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/mask_array.h deleted file mode 100644 index 1a694f3c61f..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/mask_array.h +++ /dev/null @@ -1,209 +0,0 @@ -// The template and inlines for the -*- C++ -*- mask_array class. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr> - -/** @file mask_array.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _MASK_ARRAY_H -#define _MASK_ARRAY_H 1 - -#pragma GCC system_header - -namespace std { - - /** - * @brief Reference to selected subset of an array. - * - * A mask_array is a reference to the actual elements of an array specified - * by a bitmask in the form of an array of bool. The way to get a - * mask_array is to call operator[](valarray<bool>) on a valarray. The - * returned mask_array then permits carrying operations out on the - * referenced subset of elements in the original valarray. - * - * For example, if a mask_array is obtained using the array (false, true, - * false, true) as an argument, the mask array has two elements referring - * to array[1] and array[3] in the underlying array. - * - * @param Tp Element type. - */ - template <class _Tp> - class mask_array - { - public: - typedef _Tp value_type; - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 253. valarray helper functions are almost entirely useless - - /// Copy constructor. Both slices refer to the same underlying array. - mask_array (const mask_array&); - - /// Assignment operator. Assigns elements to corresponding elements - /// of @a a. - mask_array& operator=(const mask_array&); - - void operator=(const valarray<_Tp>&) const; - /// Multiply slice elements by corresponding elements of @a v. - void operator*=(const valarray<_Tp>&) const; - /// Divide slice elements by corresponding elements of @a v. - void operator/=(const valarray<_Tp>&) const; - /// Modulo slice elements by corresponding elements of @a v. - void operator%=(const valarray<_Tp>&) const; - /// Add corresponding elements of @a v to slice elements. - void operator+=(const valarray<_Tp>&) const; - /// Subtract corresponding elements of @a v from slice elements. - void operator-=(const valarray<_Tp>&) const; - /// Logical xor slice elements with corresponding elements of @a v. - void operator^=(const valarray<_Tp>&) const; - /// Logical and slice elements with corresponding elements of @a v. - void operator&=(const valarray<_Tp>&) const; - /// Logical or slice elements with corresponding elements of @a v. - void operator|=(const valarray<_Tp>&) const; - /// Left shift slice elements by corresponding elements of @a v. - void operator<<=(const valarray<_Tp>&) const; - /// Right shift slice elements by corresponding elements of @a v. - void operator>>=(const valarray<_Tp>&) const; - /// Assign all slice elements to @a t. - void operator=(const _Tp&) const; - - // ~mask_array (); - - template<class _Dom> - void operator=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator*=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator/=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator%=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator+=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator-=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator^=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator&=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator|=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator<<=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator>>=(const _Expr<_Dom,_Tp>&) const; - - private: - mask_array(_Array<_Tp>, size_t, _Array<bool>); - friend class valarray<_Tp>; - - const size_t _M_sz; - const _Array<bool> _M_mask; - const _Array<_Tp> _M_array; - - // not implemented - mask_array(); - }; - - - template<typename _Tp> - inline mask_array<_Tp>::mask_array(const mask_array<_Tp>& a) - : _M_sz(a._M_sz), _M_mask(a._M_mask), _M_array(a._M_array) {} - - template<typename _Tp> - inline - mask_array<_Tp>::mask_array(_Array<_Tp> __a, size_t __s, _Array<bool> __m) - : _M_sz(__s), _M_mask(__m), _M_array(__a) {} - - template<typename _Tp> - inline mask_array<_Tp>& - mask_array<_Tp>::operator=(const mask_array<_Tp>& __a) - { - std::__valarray_copy(__a._M_array, __a._M_mask, - _M_sz, _M_array, _M_mask); - return *this; - } - - template<typename _Tp> - inline void - mask_array<_Tp>::operator=(const _Tp& __t) const - { std::__valarray_fill(_M_array, _M_sz, _M_mask, __t); } - - template<typename _Tp> - inline void - mask_array<_Tp>::operator=(const valarray<_Tp>& __v) const - { std::__valarray_copy(_Array<_Tp>(__v), __v.size(), _M_array, _M_mask); } - - template<typename _Tp> - template<class _Ex> - inline void - mask_array<_Tp>::operator=(const _Expr<_Ex, _Tp>& __e) const - { std::__valarray_copy(__e, __e.size(), _M_array, _M_mask); } - -#undef _DEFINE_VALARRAY_OPERATOR -#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name) \ - template<typename _Tp> \ - inline void \ - mask_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const \ - { \ - _Array_augmented_##_Name(_M_array, _M_mask, \ - _Array<_Tp>(__v), __v.size()); \ - } \ - \ - template<typename _Tp> \ - template<class _Dom> \ - inline void \ - mask_array<_Tp>::operator _Op##=(const _Expr<_Dom, _Tp>& __e) const\ - { \ - _Array_augmented_##_Name(_M_array, _M_mask, __e, __e.size()); \ - } - -_DEFINE_VALARRAY_OPERATOR(*, __multiplies) -_DEFINE_VALARRAY_OPERATOR(/, __divides) -_DEFINE_VALARRAY_OPERATOR(%, __modulus) -_DEFINE_VALARRAY_OPERATOR(+, __plus) -_DEFINE_VALARRAY_OPERATOR(-, __minus) -_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor) -_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and) -_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or) -_DEFINE_VALARRAY_OPERATOR(<<, __shift_left) -_DEFINE_VALARRAY_OPERATOR(>>, __shift_right) - -#undef _DEFINE_VALARRAY_OPERATOR - -} // std:: - -#endif /* _MASK_ARRAY_H */ - -// Local Variables: -// mode:c++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc deleted file mode 100644 index 2d1b5b419cf..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc +++ /dev/null @@ -1,699 +0,0 @@ -// ostream classes -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.6.2 Output streams -// - -#ifndef _OSTREAM_TCC -#define _OSTREAM_TCC 1 - -#pragma GCC system_header - -#include <locale> - -namespace std -{ - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>::sentry:: - sentry(basic_ostream<_CharT, _Traits>& __os) - : _M_ok(false), _M_os(__os) - { - // XXX MT - if (__os.tie() && __os.good()) - __os.tie()->flush(); - - if (__os.good()) - _M_ok = true; - else - __os.setstate(ios_base::failbit); - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(__ostream_type& (*__pf)(__ostream_type&)) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR 60. What is a formatted input function? - // The inserters for manipulators are *not* formatted output functions. - return __pf(*this); - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(__ios_type& (*__pf)(__ios_type&)) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR 60. What is a formatted input function? - // The inserters for manipulators are *not* formatted output functions. - __pf(*this); - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(ios_base& (*__pf)(ios_base&)) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR 60. What is a formatted input function? - // The inserters for manipulators are *not* formatted output functions. - __pf(*this); - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(bool __n) - { - sentry __cerb(*this); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_put_type& __np = __check_facet(this->_M_num_put); - if (__np.put(*this, *this, this->fill(), __n).failed()) - __err |= ios_base::badbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(long __n) - { - sentry __cerb(*this); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - bool __b = false; - const char_type __c = this->fill(); - const ios_base::fmtflags __fmt = (this->flags() - & ios_base::basefield); - const __num_put_type& __np = __check_facet(this->_M_num_put); - if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex)) - { - const unsigned long __l = static_cast<unsigned long>(__n); - __b = __np.put(*this, *this, __c, __l).failed(); - } - else - __b = __np.put(*this, *this, __c, __n).failed(); - if (__b) - __err |= ios_base::badbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(unsigned long __n) - { - sentry __cerb(*this); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_put_type& __np = __check_facet(this->_M_num_put); - if (__np.put(*this, *this, this->fill(), __n).failed()) - __err |= ios_base::badbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - -#ifdef _GLIBCXX_USE_LONG_LONG - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(long long __n) - { - sentry __cerb(*this); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - bool __b = false; - const char_type __c = this->fill(); - const ios_base::fmtflags __fmt = (this->flags() - & ios_base::basefield); - const __num_put_type& __np = __check_facet(this->_M_num_put); - if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex)) - { - const unsigned long long __l = (static_cast< - unsigned long long>(__n)); - __b = __np.put(*this, *this, __c, __l).failed(); - } - else - __b = __np.put(*this, *this, __c, __n).failed(); - if (__b) - __err |= ios_base::badbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(unsigned long long __n) - { - sentry __cerb(*this); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_put_type& __np = __check_facet(this->_M_num_put); - if (__np.put(*this, *this, this->fill(), __n).failed()) - __err |= ios_base::badbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } -#endif - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(double __n) - { - sentry __cerb(*this); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_put_type& __np = __check_facet(this->_M_num_put); - if (__np.put(*this, *this, this->fill(), __n).failed()) - __err |= ios_base::badbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(long double __n) - { - sentry __cerb(*this); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_put_type& __np = __check_facet(this->_M_num_put); - if (__np.put(*this, *this, this->fill(), __n).failed()) - __err |= ios_base::badbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(const void* __n) - { - sentry __cerb(*this); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const __num_put_type& __np = __check_facet(this->_M_num_put); - if (__np.put(*this, *this, this->fill(), __n).failed()) - __err |= ios_base::badbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - operator<<(__streambuf_type* __sbin) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - sentry __cerb(*this); - if (__cerb && __sbin) - { - try - { - if (!__copy_streambufs(__sbin, this->rdbuf())) - __err |= ios_base::failbit; - } - catch(...) - { this->_M_setstate(ios_base::failbit); } - } - else if (!__sbin) - __err |= ios_base::badbit; - if (__err) - this->setstate(__err); - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - put(char_type __c) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR 60. What is a formatted input function? - // basic_ostream::put(char_type) is an unformatted output function. - // DR 63. Exception-handling policy for unformatted output. - // Unformatted output functions should catch exceptions thrown - // from streambuf members. - sentry __cerb(*this); - if (__cerb) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - const int_type __put = this->rdbuf()->sputc(__c); - if (traits_type::eq_int_type(__put, traits_type::eof())) - __err |= ios_base::badbit; - } - catch (...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - write(const _CharT* __s, streamsize __n) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR 60. What is a formatted input function? - // basic_ostream::write(const char_type*, streamsize) is an - // unformatted output function. - // DR 63. Exception-handling policy for unformatted output. - // Unformatted output functions should catch exceptions thrown - // from streambuf members. - sentry __cerb(*this); - if (__cerb) - { - try - { _M_write(__s, __n); } - catch (...) - { this->_M_setstate(ios_base::badbit); } - } - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - flush() - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR 60. What is a formatted input function? - // basic_ostream::flush() is *not* an unformatted output function. - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - if (this->rdbuf() && this->rdbuf()->pubsync() == -1) - __err |= ios_base::badbit; - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - return *this; - } - - template<typename _CharT, typename _Traits> - typename basic_ostream<_CharT, _Traits>::pos_type - basic_ostream<_CharT, _Traits>:: - tellp() - { - pos_type __ret = pos_type(-1); - try - { - if (!this->fail()) - __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out); - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - return __ret; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - seekp(pos_type __pos) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - if (!this->fail()) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 136. seekp, seekg setting wrong streams? - const pos_type __p = this->rdbuf()->pubseekpos(__pos, - ios_base::out); - - // 129. Need error indication from seekp() and seekg() - if (__p == pos_type(off_type(-1))) - __err |= ios_base::failbit; - } - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - return *this; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - basic_ostream<_CharT, _Traits>:: - seekp(off_type __off, ios_base::seekdir __dir) - { - ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try - { - if (!this->fail()) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 136. seekp, seekg setting wrong streams? - const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir, - ios_base::out); - - // 129. Need error indication from seekp() and seekg() - if (__p == pos_type(off_type(-1))) - __err |= ios_base::failbit; - } - } - catch(...) - { this->_M_setstate(ios_base::badbit); } - if (__err) - this->setstate(__err); - return *this; - } - - // 27.6.2.5.4 Character inserters. - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) - { - typedef basic_ostream<_CharT, _Traits> __ostream_type; - typename __ostream_type::sentry __cerb(__out); - if (__cerb) - { - try - { - const streamsize __w = __out.width(); - streamsize __len = 1; - _CharT* __cs = &__c; - if (__w > __len) - { - __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __w)); - __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, - &__c, __w, __len, false); - __len = __w; - } - __out._M_write(__cs, __len); - __out.width(0); - } - catch(...) - { __out._M_setstate(ios_base::badbit); } - } - return __out; - } - - // Specializations. - template <class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, char __c) - { - typedef basic_ostream<char, _Traits> __ostream_type; - typename __ostream_type::sentry __cerb(__out); - if (__cerb) - { - try - { - const streamsize __w = __out.width(); - streamsize __len = 1; - char* __cs = &__c; - if (__w > __len) - { - __cs = static_cast<char*>(__builtin_alloca(__w)); - __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs, - &__c, __w, __len, false); - __len = __w; - } - __out._M_write(__cs, __len); - __out.width(0); - } - catch(...) - { __out._M_setstate(ios_base::badbit); } - } - return __out; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) - { - typedef basic_ostream<_CharT, _Traits> __ostream_type; - typename __ostream_type::sentry __cerb(__out); - if (__cerb && __s) - { - try - { - const streamsize __w = __out.width(); - streamsize __len = static_cast<streamsize>(_Traits::length(__s)); - if (__w > __len) - { - _CharT* __cs = (static_cast< - _CharT*>(__builtin_alloca(sizeof(_CharT) - * __w))); - __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, - __s, __w, __len, false); - __s = __cs; - __len = __w; - } - __out._M_write(__s, __len); - __out.width(0); - } - catch(...) - { __out._M_setstate(ios_base::badbit); } - } - else if (!__s) - __out.setstate(ios_base::badbit); - return __out; - } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) - { - typedef basic_ostream<_CharT, _Traits> __ostream_type; - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 167. Improper use of traits_type::length() - // Note that this is only in 'Review' status. - typedef char_traits<char> __traits_type; - typename __ostream_type::sentry __cerb(__out); - if (__cerb && __s) - { - size_t __clen = __traits_type::length(__s); - _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __clen)); - for (size_t __i = 0; __i < __clen; ++__i) - __ws[__i] = __out.widen(__s[__i]); - _CharT* __str = __ws; - - try - { - const streamsize __w = __out.width(); - streamsize __len = static_cast<streamsize>(__clen); - if (__w > __len) - { - _CharT* __cs = (static_cast< - _CharT*>(__builtin_alloca(sizeof(_CharT) - * __w))); - __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, - __ws, __w, __len, false); - __str = __cs; - __len = __w; - } - __out._M_write(__str, __len); - __out.width(0); - } - catch(...) - { __out._M_setstate(ios_base::badbit); } - } - else if (!__s) - __out.setstate(ios_base::badbit); - return __out; - } - - // Partial specializations. - template<class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, const char* __s) - { - typedef basic_ostream<char, _Traits> __ostream_type; - typename __ostream_type::sentry __cerb(__out); - if (__cerb && __s) - { - try - { - const streamsize __w = __out.width(); - streamsize __len = static_cast<streamsize>(_Traits::length(__s)); - if (__w > __len) - { - char* __cs = static_cast<char*>(__builtin_alloca(__w)); - __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs, - __s, __w, __len, false); - __s = __cs; - __len = __w; - } - __out._M_write(__s, __len); - __out.width(0); - } - catch(...) - { __out._M_setstate(ios_base::badbit); } - } - else if (!__s) - __out.setstate(ios_base::badbit); - return __out; - } - - // 21.3.7.9 basic_string::operator<< - template<typename _CharT, typename _Traits, typename _Alloc> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, - const basic_string<_CharT, _Traits, _Alloc>& __str) - { - typedef basic_ostream<_CharT, _Traits> __ostream_type; - typename __ostream_type::sentry __cerb(__out); - if (__cerb) - { - const streamsize __w = __out.width(); - streamsize __len = static_cast<streamsize>(__str.size()); - const _CharT* __s = __str.data(); - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 25. String operator<< uses width() value wrong - if (__w > __len) - { - _CharT* __cs = (static_cast< - _CharT*>(__builtin_alloca(sizeof(_CharT) * __w))); - __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, __s, - __w, __len, false); - __s = __cs; - __len = __w; - } - __out._M_write(__s, __len); - __out.width(0); - } - return __out; - } - - // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. -#if _GLIBCXX_EXTERN_TEMPLATE - extern template class basic_ostream<char>; - extern template ostream& endl(ostream&); - extern template ostream& ends(ostream&); - extern template ostream& flush(ostream&); - extern template ostream& operator<<(ostream&, char); - extern template ostream& operator<<(ostream&, unsigned char); - extern template ostream& operator<<(ostream&, signed char); - extern template ostream& operator<<(ostream&, const char*); - extern template ostream& operator<<(ostream&, const unsigned char*); - extern template ostream& operator<<(ostream&, const signed char*); - -#ifdef _GLIBCXX_USE_WCHAR_T - extern template class basic_ostream<wchar_t>; - extern template wostream& endl(wostream&); - extern template wostream& ends(wostream&); - extern template wostream& flush(wostream&); - extern template wostream& operator<<(wostream&, wchar_t); - extern template wostream& operator<<(wostream&, char); - extern template wostream& operator<<(wostream&, const wchar_t*); - extern template wostream& operator<<(wostream&, const char*); -#endif -#endif -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/postypes.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/postypes.h deleted file mode 100644 index 0cfb61b2df2..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/postypes.h +++ /dev/null @@ -1,215 +0,0 @@ -// Position types -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.4.1 - Types -// ISO C++ 14882: 27.4.3 - Template class fpos -// - -/** @file postypes.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _GLIBCXX_POSTYPES_H -#define _GLIBCXX_POSTYPES_H 1 - -#pragma GCC system_header - -#include <cwchar> // For mbstate_t - -#ifdef _GLIBCXX_HAVE_STDINT_H -#include <stdint.h> // For int64_t -#endif - -namespace std -{ - // The types streamoff, streampos and wstreampos and the class - // template fpos<> are described in clauses 21.1.2, 21.1.3, 27.1.2, - // 27.2, 27.4.1, 27.4.3 and D.6. Despite all this verbage, the - // behaviour of these types is mostly implementation defined or - // unspecified. The behaviour in this implementation is as noted - // below. - - /** - * @brief Type used by fpos, char_traits<char>, and char_traits<wchar_t>. - * - * @if maint - * In clauses 21.1.3.1 and 27.4.1 streamoff is described as an - * implementation defined type. - * Note: In versions of GCC up to and including GCC 3.3, streamoff - * was typedef long. - * @endif - */ -#ifdef _GLIBCXX_HAVE_INT64_T - typedef int64_t streamoff; -#else - typedef long long streamoff; -#endif - - /// Integral type for I/O operation counts and buffer sizes. - typedef ptrdiff_t streamsize; // Signed integral type - - template<typename _StateT> - class fpos; - - /** - * @brief Class representing stream positions. - * - * The standard places no requirements upon the template parameter StateT. - * In this implementation StateT must be DefaultConstructible, - * CopyConstructible and Assignable. The standard only requires that fpos - * should contain a member of type StateT. In this implementation it also - * contains an offset stored as a signed integer. - * - * @param StateT Type passed to and returned from state(). - */ - template<typename _StateT> - class fpos - { - private: - streamoff _M_off; - _StateT _M_state; - - public: - // The standard doesn't require that fpos objects can be default - // constructed. This implementation provides a default - // constructor that initializes the offset to 0 and default - // constructs the state. - fpos() - : _M_off(0), _M_state() { } - - // The standard requires that fpos objects can be constructed - // from streamoff objects using the constructor syntax, and - // fails to give any meaningful semantics. In this - // implementation implicit conversion is also allowed, and this - // constructor stores the streamoff as the offset and default - // constructs the state. - /// Construct position from offset. - fpos(streamoff __off) - : _M_off(__off), _M_state() { } - - /// Convert to streamoff. - operator streamoff() const { return _M_off; } - - /// Remember the value of @a st. - void - state(_StateT __st) - { _M_state = __st; } - - /// Return the last set value of @a st. - _StateT - state() const - { return _M_state; } - - // The standard only requires that operator== must be an - // equivalence relation. In this implementation two fpos<StateT> - // objects belong to the same equivalence class if the contained - // offsets compare equal. - /// Test if equivalent to another position. - bool - operator==(const fpos& __other) const - { return _M_off == __other._M_off; } - - /// Test if not equivalent to another position. - bool - operator!=(const fpos& __other) const - { return _M_off != __other._M_off; } - - // The standard requires that this operator must be defined, but - // gives no semantics. In this implemenation it just adds it's - // argument to the stored offset and returns *this. - /// Add offset to this position. - fpos& - operator+=(streamoff __off) - { - _M_off += __off; - return *this; - } - - // The standard requires that this operator must be defined, but - // gives no semantics. In this implemenation it just subtracts - // it's argument from the stored offset and returns *this. - /// Subtract offset from this position. - fpos& - operator-=(streamoff __off) - { - _M_off -= __off; - return *this; - } - - // The standard requires that this operator must be defined, but - // defines it's semantics only in terms of operator-. In this - // implementation it constructs a copy of *this, adds the - // argument to that copy using operator+= and then returns the - // copy. - /// Add position and offset. - fpos - operator+(streamoff __off) const - { - fpos __pos(*this); - __pos += __off; - return __pos; - } - - // The standard requires that this operator must be defined, but - // defines it's semantics only in terms of operator+. In this - // implementation it constructs a copy of *this, subtracts the - // argument from that copy using operator-= and then returns the - // copy. - /// Subtract offset from position. - fpos - operator-(streamoff __off) const - { - fpos __pos(*this); - __pos -= __off; - return __pos; - } - - // The standard requires that this operator must be defined, but - // defines it's semantics only in terms of operator+. In this - // implementation it returns the difference between the offset - // stored in *this and in the argument. - /// Subtract position to return offset. - streamoff - operator-(const fpos& __other) const - { return _M_off - __other._M_off; } - }; - - // Clauses 21.1.3.1 and 21.1.3.2 describe streampos and wstreampos - // as implementation defined types, but clause 27.2 requires that - // they must both be typedefs for fpos<mbstate_t> - /// File position for char streams. - typedef fpos<mbstate_t> streampos; - /// File position for wchar_t streams. - typedef fpos<mbstate_t> wstreampos; -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/slice_array.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/slice_array.h deleted file mode 100644 index 31c89bcdb61..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/slice_array.h +++ /dev/null @@ -1,273 +0,0 @@ -// The template and inlines for the -*- C++ -*- slice_array class. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr> - -/** @file slice_array.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _SLICE_ARRAY_H -#define _SLICE_ARRAY_H 1 - -#pragma GCC system_header - -namespace std -{ - /** - * @brief Class defining one-dimensional subset of an array. - * - * The slice class represents a one-dimensional subset of an array, - * specified by three parameters: start offset, size, and stride. The - * start offset is the index of the first element of the array that is part - * of the subset. The size is the total number of elements in the subset. - * Stride is the distance between each successive array element to include - * in the subset. - * - * For example, with an array of size 10, and a slice with offset 1, size 3 - * and stride 2, the subset consists of array elements 1, 3, and 5. - */ - class slice - { - public: - /// Construct an empty slice. - slice(); - - /** - * @brief Construct a slice. - * - * @param o Offset in array of first element. - * @param d Number of elements in slice. - * @param s Stride between array elements. - */ - slice(size_t, size_t, size_t); - - /// Return array offset of first slice element. - size_t start() const; - /// Return size of slice. - size_t size() const; - /// Return array stride of slice. - size_t stride() const; - - private: - size_t _M_off; // offset - size_t _M_sz; // size - size_t _M_st; // stride unit - }; - - // The default constructor constructor is not required to initialize - // data members with any meaningful values, so we choose to do nothing. - inline - slice::slice() {} - - inline - slice::slice(size_t __o, size_t __d, size_t __s) - : _M_off(__o), _M_sz(__d), _M_st(__s) {} - - inline size_t - slice::start() const - { return _M_off; } - - inline size_t - slice::size() const - { return _M_sz; } - - inline size_t - slice::stride() const - { return _M_st; } - - /** - * @brief Reference to one-dimensional subset of an array. - * - * A slice_array is a reference to the actual elements of an array - * specified by a slice. The way to get a slice_array is to call - * operator[](slice) on a valarray. The returned slice_array then permits - * carrying operations out on the referenced subset of elements in the - * original valarray. For example, operator+=(valarray) will add values - * to the subset of elements in the underlying valarray this slice_array - * refers to. - * - * @param Tp Element type. - */ - template<typename _Tp> - class slice_array - { - public: - typedef _Tp value_type; - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 253. valarray helper functions are almost entirely useless - - /// Copy constructor. Both slices refer to the same underlying array. - slice_array(const slice_array&); - - /// Assignment operator. Assigns slice elements to corresponding - /// elements of @a a. - slice_array& operator=(const slice_array&); - - /// Assign slice elements to corresponding elements of @a v. - void operator=(const valarray<_Tp>&) const; - /// Multiply slice elements by corresponding elements of @a v. - void operator*=(const valarray<_Tp>&) const; - /// Divide slice elements by corresponding elements of @a v. - void operator/=(const valarray<_Tp>&) const; - /// Modulo slice elements by corresponding elements of @a v. - void operator%=(const valarray<_Tp>&) const; - /// Add corresponding elements of @a v to slice elements. - void operator+=(const valarray<_Tp>&) const; - /// Subtract corresponding elements of @a v from slice elements. - void operator-=(const valarray<_Tp>&) const; - /// Logical xor slice elements with corresponding elements of @a v. - void operator^=(const valarray<_Tp>&) const; - /// Logical and slice elements with corresponding elements of @a v. - void operator&=(const valarray<_Tp>&) const; - /// Logical or slice elements with corresponding elements of @a v. - void operator|=(const valarray<_Tp>&) const; - /// Left shift slice elements by corresponding elements of @a v. - void operator<<=(const valarray<_Tp>&) const; - /// Right shift slice elements by corresponding elements of @a v. - void operator>>=(const valarray<_Tp>&) const; - /// Assign all slice elements to @a t. - void operator=(const _Tp &) const; - // ~slice_array (); - - template<class _Dom> - void operator=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator*=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator/=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator%=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator+=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator-=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator^=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator&=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator|=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator<<=(const _Expr<_Dom,_Tp>&) const; - template<class _Dom> - void operator>>=(const _Expr<_Dom,_Tp>&) const; - - private: - friend class valarray<_Tp>; - slice_array(_Array<_Tp>, const slice&); - - const size_t _M_sz; - const size_t _M_stride; - const _Array<_Tp> _M_array; - - // not implemented - slice_array(); - }; - - template<typename _Tp> - inline - slice_array<_Tp>::slice_array(_Array<_Tp> __a, const slice& __s) - : _M_sz(__s.size()), _M_stride(__s.stride()), - _M_array(__a.begin() + __s.start()) {} - - template<typename _Tp> - inline - slice_array<_Tp>::slice_array(const slice_array<_Tp>& a) - : _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {} - - // template<typename _Tp> - // inline slice_array<_Tp>::~slice_array () {} - - template<typename _Tp> - inline slice_array<_Tp>& - slice_array<_Tp>::operator=(const slice_array<_Tp>& __a) - { - std::__valarray_copy(__a._M_array, __a._M_sz, __a._M_stride, - _M_array, _M_stride); - return *this; - } - - template<typename _Tp> - inline void - slice_array<_Tp>::operator=(const _Tp& __t) const - { std::__valarray_fill(_M_array, _M_sz, _M_stride, __t); } - - template<typename _Tp> - inline void - slice_array<_Tp>::operator=(const valarray<_Tp>& __v) const - { std::__valarray_copy(_Array<_Tp>(__v), _M_array, _M_sz, _M_stride); } - - template<typename _Tp> - template<class _Dom> - inline void - slice_array<_Tp>::operator=(const _Expr<_Dom,_Tp>& __e) const - { std::__valarray_copy(__e, _M_sz, _M_array, _M_stride); } - -#undef _DEFINE_VALARRAY_OPERATOR -#define _DEFINE_VALARRAY_OPERATOR(_Op,_Name) \ - template<typename _Tp> \ - inline void \ - slice_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const \ - { \ - _Array_augmented_##_Name(_M_array, _M_sz, _M_stride, _Array<_Tp>(__v));\ - } \ - \ - template<typename _Tp> \ - template<class _Dom> \ - inline void \ - slice_array<_Tp>::operator _Op##=(const _Expr<_Dom,_Tp>& __e) const\ - { \ - _Array_augmented_##_Name(_M_array, _M_stride, __e, _M_sz); \ - } - - -_DEFINE_VALARRAY_OPERATOR(*, __multiplies) -_DEFINE_VALARRAY_OPERATOR(/, __divides) -_DEFINE_VALARRAY_OPERATOR(%, __modulus) -_DEFINE_VALARRAY_OPERATOR(+, __plus) -_DEFINE_VALARRAY_OPERATOR(-, __minus) -_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor) -_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and) -_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or) -_DEFINE_VALARRAY_OPERATOR(<<, __shift_left) -_DEFINE_VALARRAY_OPERATOR(>>, __shift_right) - -#undef _DEFINE_VALARRAY_OPERATOR - -} // std:: - -#endif /* _SLICE_ARRAY_H */ - -// Local Variables: -// mode:c++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc deleted file mode 100644 index 03f49fb0fd5..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc +++ /dev/null @@ -1,227 +0,0 @@ -// String based streams -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.7 String-based streams -// - -#ifndef _SSTREAM_TCC -#define _SSTREAM_TCC 1 - -#pragma GCC system_header - -#include <sstream> - -namespace std -{ - template <class _CharT, class _Traits, class _Alloc> - typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type - basic_stringbuf<_CharT, _Traits, _Alloc>:: - pbackfail(int_type __c) - { - int_type __ret = traits_type::eof(); - const bool __testeof = traits_type::eq_int_type(__c, __ret); - - if (this->eback() < this->gptr()) - { - const bool __testeq = traits_type::eq(traits_type::to_char_type(__c), - this->gptr()[-1]); - this->gbump(-1); - - // Try to put back __c into input sequence in one of three ways. - // Order these tests done in is unspecified by the standard. - if (!__testeof && __testeq) - __ret = __c; - else if (__testeof) - __ret = traits_type::not_eof(__c); - else - { - *this->gptr() = traits_type::to_char_type(__c); - __ret = __c; - } - } - return __ret; - } - - template <class _CharT, class _Traits, class _Alloc> - typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type - basic_stringbuf<_CharT, _Traits, _Alloc>:: - overflow(int_type __c) - { - const bool __testout = this->_M_mode & ios_base::out; - if (__builtin_expect(!__testout, false)) - return traits_type::eof(); - - const bool __testeof = traits_type::eq_int_type(__c, traits_type::eof()); - if (__builtin_expect(__testeof, false)) - return traits_type::not_eof(__c); - - const __size_type __capacity = _M_string.capacity(); - const __size_type __max_size = _M_string.max_size(); - const bool __testput = this->pptr() < this->epptr(); - if (__builtin_expect(!__testput && __capacity == __max_size, false)) - return traits_type::eof(); - - // Try to append __c into output sequence in one of two ways. - // Order these tests done in is unspecified by the standard. - if (!__testput) - { - // NB: Start ostringstream buffers at 512 chars. This is an - // experimental value (pronounced "arbitrary" in some of the - // hipper english-speaking countries), and can be changed to - // suit particular needs. - // Then, in virtue of DR 169 (TC) we are allowed to grow more - // than one char. - const __size_type __opt_len = std::max(__size_type(2 * __capacity), - __size_type(512)); - const __size_type __len = std::min(__opt_len, __max_size); - __string_type __tmp; - __tmp.reserve(__len); - __tmp.assign(_M_string.data(), this->epptr() - this->pbase()); - _M_string.swap(__tmp); - _M_sync(const_cast<char_type*>(_M_string.data()), - this->gptr() - this->eback(), this->pptr() - this->pbase()); - } - return this->sputc(traits_type::to_char_type(__c)); - } - - template <class _CharT, class _Traits, class _Alloc> - typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type - basic_stringbuf<_CharT, _Traits, _Alloc>:: - underflow() - { - int_type __ret = traits_type::eof(); - const bool __testin = this->_M_mode & ios_base::in; - if (__testin) - { - // Update egptr() to match the actual string end. - _M_update_egptr(); - - if (this->gptr() < this->egptr()) - __ret = traits_type::to_int_type(*this->gptr()); - } - return __ret; - } - - template <class _CharT, class _Traits, class _Alloc> - typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type - basic_stringbuf<_CharT, _Traits, _Alloc>:: - seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode) - { - pos_type __ret = pos_type(off_type(-1)); - bool __testin = (ios_base::in & this->_M_mode & __mode) != 0; - bool __testout = (ios_base::out & this->_M_mode & __mode) != 0; - const bool __testboth = __testin && __testout && __way != ios_base::cur; - __testin &= !(__mode & ios_base::out); - __testout &= !(__mode & ios_base::in); - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 453. basic_stringbuf::seekoff need not always fail for an empty stream. - const char_type* __beg = __testin ? this->eback() : this->pbase(); - if ((__beg || !__off) && (__testin || __testout || __testboth)) - { - _M_update_egptr(); - - off_type __newoffi = 0; - off_type __newoffo = 0; - if (__way == ios_base::cur) - { - __newoffi = this->gptr() - __beg; - __newoffo = this->pptr() - __beg; - } - else if (__way == ios_base::end) - __newoffo = __newoffi = this->egptr() - __beg; - - if ((__testin || __testboth) - && __newoffi + __off >= 0 - && this->egptr() - __beg >= __newoffi + __off) - { - this->gbump((__beg + __newoffi + __off) - this->gptr()); - __ret = pos_type(__newoffi); - } - if ((__testout || __testboth) - && __newoffo + __off >= 0 - && this->egptr() - __beg >= __newoffo + __off) - { - this->pbump((__beg + __newoffo + __off) - this->pptr()); - __ret = pos_type(__newoffo); - } - } - return __ret; - } - - template <class _CharT, class _Traits, class _Alloc> - typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type - basic_stringbuf<_CharT, _Traits, _Alloc>:: - seekpos(pos_type __sp, ios_base::openmode __mode) - { - pos_type __ret = pos_type(off_type(-1)); - const bool __testin = (ios_base::in & this->_M_mode & __mode) != 0; - const bool __testout = (ios_base::out & this->_M_mode & __mode) != 0; - - const char_type* __beg = __testin ? this->eback() : this->pbase(); - if (__beg) - { - _M_update_egptr(); - - off_type __pos(__sp); - const bool __testpos = 0 <= __pos - && __pos <= this->egptr() - __beg; - if ((__testin || __testout) && __testpos) - { - if (__testin) - this->gbump((__beg + __pos) - this->gptr()); - if (__testout) - this->pbump((__beg + __pos) - this->pptr()); - __ret = __sp; - } - } - return __ret; - } - - // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. -#if _GLIBCXX_EXTERN_TEMPLATE - extern template class basic_stringbuf<char>; - extern template class basic_istringstream<char>; - extern template class basic_ostringstream<char>; - extern template class basic_stringstream<char>; - -#ifdef _GLIBCXX_USE_WCHAR_T - extern template class basic_stringbuf<wchar_t>; - extern template class basic_istringstream<wchar_t>; - extern template class basic_ostringstream<wchar_t>; - extern template class basic_stringstream<wchar_t>; -#endif -#endif -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h deleted file mode 100644 index 74956d75b4d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h +++ /dev/null @@ -1,5148 +0,0 @@ -// Algorithm implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_algo.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _ALGO_H -#define _ALGO_H 1 - -#include <bits/stl_heap.h> -#include <bits/stl_tempbuf.h> // for _Temporary_buffer -#include <debug/debug.h> - -// See concept_check.h for the __glibcxx_*_requires macros. - -namespace std -{ - /** - * @brief Find the median of three values. - * @param a A value. - * @param b A value. - * @param c A value. - * @return One of @p a, @p b or @p c. - * - * If @c {l,m,n} is some convolution of @p {a,b,c} such that @c l<=m<=n - * then the value returned will be @c m. - * This is an SGI extension. - * @ingroup SGIextensions - */ - template<typename _Tp> - inline const _Tp& - __median(const _Tp& __a, const _Tp& __b, const _Tp& __c) - { - // concept requirements - __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) - if (__a < __b) - if (__b < __c) - return __b; - else if (__a < __c) - return __c; - else - return __a; - else if (__a < __c) - return __a; - else if (__b < __c) - return __c; - else - return __b; - } - - /** - * @brief Find the median of three values using a predicate for comparison. - * @param a A value. - * @param b A value. - * @param c A value. - * @param comp A binary predicate. - * @return One of @p a, @p b or @p c. - * - * If @c {l,m,n} is some convolution of @p {a,b,c} such that @p comp(l,m) - * and @p comp(m,n) are both true then the value returned will be @c m. - * This is an SGI extension. - * @ingroup SGIextensions - */ - template<typename _Tp, typename _Compare> - inline const _Tp& - __median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_BinaryFunctionConcept<_Compare,bool,_Tp,_Tp>) - if (__comp(__a, __b)) - if (__comp(__b, __c)) - return __b; - else if (__comp(__a, __c)) - return __c; - else - return __a; - else if (__comp(__a, __c)) - return __a; - else if (__comp(__b, __c)) - return __c; - else - return __b; - } - - /** - * @brief Apply a function to every element of a sequence. - * @param first An input iterator. - * @param last An input iterator. - * @param f A unary function object. - * @return @p f. - * - * Applies the function object @p f to each element in the range - * @p [first,last). @p f must not modify the order of the sequence. - * If @p f has a return value it is ignored. - */ - template<typename _InputIterator, typename _Function> - _Function - for_each(_InputIterator __first, _InputIterator __last, _Function __f) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_requires_valid_range(__first, __last); - for ( ; __first != __last; ++__first) - __f(*__first); - return __f; - } - - /** - * @if maint - * This is an overload used by find() for the Input Iterator case. - * @endif - */ - template<typename _InputIterator, typename _Tp> - inline _InputIterator - find(_InputIterator __first, _InputIterator __last, - const _Tp& __val, input_iterator_tag) - { - while (__first != __last && !(*__first == __val)) - ++__first; - return __first; - } - - /** - * @if maint - * This is an overload used by find_if() for the Input Iterator case. - * @endif - */ - template<typename _InputIterator, typename _Predicate> - inline _InputIterator - find_if(_InputIterator __first, _InputIterator __last, - _Predicate __pred, input_iterator_tag) - { - while (__first != __last && !__pred(*__first)) - ++__first; - return __first; - } - - /** - * @if maint - * This is an overload used by find() for the RAI case. - * @endif - */ - template<typename _RandomAccessIterator, typename _Tp> - _RandomAccessIterator - find(_RandomAccessIterator __first, _RandomAccessIterator __last, - const _Tp& __val, random_access_iterator_tag) - { - typename iterator_traits<_RandomAccessIterator>::difference_type - __trip_count = (__last - __first) >> 2; - - for ( ; __trip_count > 0 ; --__trip_count) - { - if (*__first == __val) - return __first; - ++__first; - - if (*__first == __val) - return __first; - ++__first; - - if (*__first == __val) - return __first; - ++__first; - - if (*__first == __val) - return __first; - ++__first; - } - - switch (__last - __first) - { - case 3: - if (*__first == __val) - return __first; - ++__first; - case 2: - if (*__first == __val) - return __first; - ++__first; - case 1: - if (*__first == __val) - return __first; - ++__first; - case 0: - default: - return __last; - } - } - - /** - * @if maint - * This is an overload used by find_if() for the RAI case. - * @endif - */ - template<typename _RandomAccessIterator, typename _Predicate> - _RandomAccessIterator - find_if(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Predicate __pred, random_access_iterator_tag) - { - typename iterator_traits<_RandomAccessIterator>::difference_type - __trip_count = (__last - __first) >> 2; - - for ( ; __trip_count > 0 ; --__trip_count) - { - if (__pred(*__first)) - return __first; - ++__first; - - if (__pred(*__first)) - return __first; - ++__first; - - if (__pred(*__first)) - return __first; - ++__first; - - if (__pred(*__first)) - return __first; - ++__first; - } - - switch (__last - __first) - { - case 3: - if (__pred(*__first)) - return __first; - ++__first; - case 2: - if (__pred(*__first)) - return __first; - ++__first; - case 1: - if (__pred(*__first)) - return __first; - ++__first; - case 0: - default: - return __last; - } - } - - /** - * @brief Find the first occurrence of a value in a sequence. - * @param first An input iterator. - * @param last An input iterator. - * @param val The value to find. - * @return The first iterator @c i in the range @p [first,last) - * such that @c *i == @p val, or @p last if no such iterator exists. - */ - template<typename _InputIterator, typename _Tp> - inline _InputIterator - find(_InputIterator __first, _InputIterator __last, - const _Tp& __val) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIterator>::value_type, _Tp>) - __glibcxx_requires_valid_range(__first, __last); - return std::find(__first, __last, __val, - std::__iterator_category(__first)); - } - - /** - * @brief Find the first element in a sequence for which a predicate is true. - * @param first An input iterator. - * @param last An input iterator. - * @param pred A predicate. - * @return The first iterator @c i in the range @p [first,last) - * such that @p pred(*i) is true, or @p last if no such iterator exists. - */ - template<typename _InputIterator, typename _Predicate> - inline _InputIterator - find_if(_InputIterator __first, _InputIterator __last, - _Predicate __pred) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - return std::find_if(__first, __last, __pred, - std::__iterator_category(__first)); - } - - /** - * @brief Find two adjacent values in a sequence that are equal. - * @param first A forward iterator. - * @param last A forward iterator. - * @return The first iterator @c i such that @c i and @c i+1 are both - * valid iterators in @p [first,last) and such that @c *i == @c *(i+1), - * or @p last if no such iterator exists. - */ - template<typename _ForwardIterator> - _ForwardIterator - adjacent_find(_ForwardIterator __first, _ForwardIterator __last) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_EqualityComparableConcept< - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - if (__first == __last) - return __last; - _ForwardIterator __next = __first; - while(++__next != __last) - { - if (*__first == *__next) - return __first; - __first = __next; - } - return __last; - } - - /** - * @brief Find two adjacent values in a sequence using a predicate. - * @param first A forward iterator. - * @param last A forward iterator. - * @param binary_pred A binary predicate. - * @return The first iterator @c i such that @c i and @c i+1 are both - * valid iterators in @p [first,last) and such that - * @p binary_pred(*i,*(i+1)) is true, or @p last if no such iterator - * exists. - */ - template<typename _ForwardIterator, typename _BinaryPredicate> - _ForwardIterator - adjacent_find(_ForwardIterator __first, _ForwardIterator __last, - _BinaryPredicate __binary_pred) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_ForwardIterator>::value_type, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - if (__first == __last) - return __last; - _ForwardIterator __next = __first; - while(++__next != __last) - { - if (__binary_pred(*__first, *__next)) - return __first; - __first = __next; - } - return __last; - } - - /** - * @brief Count the number of copies of a value in a sequence. - * @param first An input iterator. - * @param last An input iterator. - * @param value The value to be counted. - * @return The number of iterators @c i in the range @p [first,last) - * for which @c *i == @p value - */ - template<typename _InputIterator, typename _Tp> - typename iterator_traits<_InputIterator>::difference_type - count(_InputIterator __first, _InputIterator __last, const _Tp& __value) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_EqualityComparableConcept< - typename iterator_traits<_InputIterator>::value_type >) - __glibcxx_function_requires(_EqualityComparableConcept<_Tp>) - __glibcxx_requires_valid_range(__first, __last); - typename iterator_traits<_InputIterator>::difference_type __n = 0; - for ( ; __first != __last; ++__first) - if (*__first == __value) - ++__n; - return __n; - } - - /** - * @brief Count the elements of a sequence for which a predicate is true. - * @param first An input iterator. - * @param last An input iterator. - * @param pred A predicate. - * @return The number of iterators @c i in the range @p [first,last) - * for which @p pred(*i) is true. - */ - template<typename _InputIterator, typename _Predicate> - typename iterator_traits<_InputIterator>::difference_type - count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - typename iterator_traits<_InputIterator>::difference_type __n = 0; - for ( ; __first != __last; ++__first) - if (__pred(*__first)) - ++__n; - return __n; - } - - /** - * @brief Search a sequence for a matching sub-sequence. - * @param first1 A forward iterator. - * @param last1 A forward iterator. - * @param first2 A forward iterator. - * @param last2 A forward iterator. - * @return The first iterator @c i in the range - * @p [first1,last1-(last2-first2)) such that @c *(i+N) == @p *(first2+N) - * for each @c N in the range @p [0,last2-first2), or @p last1 if no - * such iterator exists. - * - * Searches the range @p [first1,last1) for a sub-sequence that compares - * equal value-by-value with the sequence given by @p [first2,last2) and - * returns an iterator to the first element of the sub-sequence, or - * @p last1 if the sub-sequence is not found. - * - * Because the sub-sequence must lie completely within the range - * @p [first1,last1) it must start at a position less than - * @p last1-(last2-first2) where @p last2-first2 is the length of the - * sub-sequence. - * This means that the returned iterator @c i will be in the range - * @p [first1,last1-(last2-first2)) - */ - template<typename _ForwardIterator1, typename _ForwardIterator2> - _ForwardIterator1 - search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>) - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>) - __glibcxx_function_requires(_EqualOpConcept< - typename iterator_traits<_ForwardIterator1>::value_type, - typename iterator_traits<_ForwardIterator2>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - __glibcxx_requires_valid_range(__first2, __last2); - // Test for empty ranges - if (__first1 == __last1 || __first2 == __last2) - return __first1; - - // Test for a pattern of length 1. - _ForwardIterator2 __tmp(__first2); - ++__tmp; - if (__tmp == __last2) - return std::find(__first1, __last1, *__first2); - - // General case. - _ForwardIterator2 __p1, __p; - __p1 = __first2; ++__p1; - _ForwardIterator1 __current = __first1; - - while (__first1 != __last1) - { - __first1 = std::find(__first1, __last1, *__first2); - if (__first1 == __last1) - return __last1; - - __p = __p1; - __current = __first1; - if (++__current == __last1) - return __last1; - - while (*__current == *__p) - { - if (++__p == __last2) - return __first1; - if (++__current == __last1) - return __last1; - } - ++__first1; - } - return __first1; - } - - /** - * @brief Search a sequence for a matching sub-sequence using a predicate. - * @param first1 A forward iterator. - * @param last1 A forward iterator. - * @param first2 A forward iterator. - * @param last2 A forward iterator. - * @param predicate A binary predicate. - * @return The first iterator @c i in the range - * @p [first1,last1-(last2-first2)) such that - * @p predicate(*(i+N),*(first2+N)) is true for each @c N in the range - * @p [0,last2-first2), or @p last1 if no such iterator exists. - * - * Searches the range @p [first1,last1) for a sub-sequence that compares - * equal value-by-value with the sequence given by @p [first2,last2), - * using @p predicate to determine equality, and returns an iterator - * to the first element of the sub-sequence, or @p last1 if no such - * iterator exists. - * - * @see search(_ForwardIter1, _ForwardIter1, _ForwardIter2, _ForwardIter2) - */ - template<typename _ForwardIterator1, typename _ForwardIterator2, - typename _BinaryPredicate> - _ForwardIterator1 - search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, - _BinaryPredicate __predicate) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>) - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>) - __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_ForwardIterator1>::value_type, - typename iterator_traits<_ForwardIterator2>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - __glibcxx_requires_valid_range(__first2, __last2); - - // Test for empty ranges - if (__first1 == __last1 || __first2 == __last2) - return __first1; - - // Test for a pattern of length 1. - _ForwardIterator2 __tmp(__first2); - ++__tmp; - if (__tmp == __last2) - { - while (__first1 != __last1 && !__predicate(*__first1, *__first2)) - ++__first1; - return __first1; - } - - // General case. - _ForwardIterator2 __p1, __p; - __p1 = __first2; ++__p1; - _ForwardIterator1 __current = __first1; - - while (__first1 != __last1) - { - while (__first1 != __last1) - { - if (__predicate(*__first1, *__first2)) - break; - ++__first1; - } - while (__first1 != __last1 && !__predicate(*__first1, *__first2)) - ++__first1; - if (__first1 == __last1) - return __last1; - - __p = __p1; - __current = __first1; - if (++__current == __last1) - return __last1; - - while (__predicate(*__current, *__p)) - { - if (++__p == __last2) - return __first1; - if (++__current == __last1) - return __last1; - } - ++__first1; - } - return __first1; - } - - /** - * @brief Search a sequence for a number of consecutive values. - * @param first A forward iterator. - * @param last A forward iterator. - * @param count The number of consecutive values. - * @param val The value to find. - * @return The first iterator @c i in the range @p [first,last-count) - * such that @c *(i+N) == @p val for each @c N in the range @p [0,count), - * or @p last if no such iterator exists. - * - * Searches the range @p [first,last) for @p count consecutive elements - * equal to @p val. - */ - template<typename _ForwardIterator, typename _Integer, typename _Tp> - _ForwardIterator - search_n(_ForwardIterator __first, _ForwardIterator __last, - _Integer __count, const _Tp& __val) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_EqualityComparableConcept< - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_function_requires(_EqualityComparableConcept<_Tp>) - __glibcxx_requires_valid_range(__first, __last); - - if (__count <= 0) - return __first; - else - { - __first = std::find(__first, __last, __val); - while (__first != __last) - { - typename iterator_traits<_ForwardIterator>::difference_type - __n = __count; - _ForwardIterator __i = __first; - ++__i; - while (__i != __last && __n != 1 && *__i == __val) - { - ++__i; - --__n; - } - if (__n == 1) - return __first; - else - __first = std::find(__i, __last, __val); - } - return __last; - } - } - - /** - * @brief Search a sequence for a number of consecutive values using a - * predicate. - * @param first A forward iterator. - * @param last A forward iterator. - * @param count The number of consecutive values. - * @param val The value to find. - * @param binary_pred A binary predicate. - * @return The first iterator @c i in the range @p [first,last-count) - * such that @p binary_pred(*(i+N),val) is true for each @c N in the - * range @p [0,count), or @p last if no such iterator exists. - * - * Searches the range @p [first,last) for @p count consecutive elements - * for which the predicate returns true. - */ - template<typename _ForwardIterator, typename _Integer, typename _Tp, - typename _BinaryPredicate> - _ForwardIterator - search_n(_ForwardIterator __first, _ForwardIterator __last, - _Integer __count, const _Tp& __val, - _BinaryPredicate __binary_pred) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_ForwardIterator>::value_type, _Tp>) - __glibcxx_requires_valid_range(__first, __last); - - if (__count <= 0) - return __first; - else - { - while (__first != __last) - { - if (__binary_pred(*__first, __val)) - break; - ++__first; - } - while (__first != __last) - { - typename iterator_traits<_ForwardIterator>::difference_type - __n = __count; - _ForwardIterator __i = __first; - ++__i; - while (__i != __last && __n != 1 && __binary_pred(*__i, __val)) - { - ++__i; - --__n; - } - if (__n == 1) - return __first; - else - { - while (__i != __last) - { - if (__binary_pred(*__i, __val)) - break; - ++__i; - } - __first = __i; - } - } - return __last; - } - } - - /** - * @brief Swap the elements of two sequences. - * @param first1 A forward iterator. - * @param last1 A forward iterator. - * @param first2 A forward iterator. - * @return An iterator equal to @p first2+(last1-first1). - * - * Swaps each element in the range @p [first1,last1) with the - * corresponding element in the range @p [first2,(last1-first1)). - * The ranges must not overlap. - */ - template<typename _ForwardIterator1, typename _ForwardIterator2> - _ForwardIterator2 - swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator1>) - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator2>) - __glibcxx_function_requires(_ConvertibleConcept< - typename iterator_traits<_ForwardIterator1>::value_type, - typename iterator_traits<_ForwardIterator2>::value_type>) - __glibcxx_function_requires(_ConvertibleConcept< - typename iterator_traits<_ForwardIterator2>::value_type, - typename iterator_traits<_ForwardIterator1>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - - for ( ; __first1 != __last1; ++__first1, ++__first2) - std::iter_swap(__first1, __first2); - return __first2; - } - - /** - * @brief Perform an operation on a sequence. - * @param first An input iterator. - * @param last An input iterator. - * @param result An output iterator. - * @param unary_op A unary operator. - * @return An output iterator equal to @p result+(last-first). - * - * Applies the operator to each element in the input range and assigns - * the results to successive elements of the output sequence. - * Evaluates @p *(result+N)=unary_op(*(first+N)) for each @c N in the - * range @p [0,last-first). - * - * @p unary_op must not alter its argument. - */ - template<typename _InputIterator, typename _OutputIterator, - typename _UnaryOperation> - _OutputIterator - transform(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, _UnaryOperation __unary_op) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - // "the type returned by a _UnaryOperation" - __typeof__(__unary_op(*__first))>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first, ++__result) - *__result = __unary_op(*__first); - return __result; - } - - /** - * @brief Perform an operation on corresponding elements of two sequences. - * @param first1 An input iterator. - * @param last1 An input iterator. - * @param first2 An input iterator. - * @param result An output iterator. - * @param binary_op A binary operator. - * @return An output iterator equal to @p result+(last-first). - * - * Applies the operator to the corresponding elements in the two - * input ranges and assigns the results to successive elements of the - * output sequence. - * Evaluates @p *(result+N)=binary_op(*(first1+N),*(first2+N)) for each - * @c N in the range @p [0,last1-first1). - * - * @p binary_op must not alter either of its arguments. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _OutputIterator, typename _BinaryOperation> - _OutputIterator - transform(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _OutputIterator __result, - _BinaryOperation __binary_op) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - // "the type returned by a _BinaryOperation" - __typeof__(__binary_op(*__first1,*__first2))>) - __glibcxx_requires_valid_range(__first1, __last1); - - for ( ; __first1 != __last1; ++__first1, ++__first2, ++__result) - *__result = __binary_op(*__first1, *__first2); - return __result; - } - - /** - * @brief Replace each occurrence of one value in a sequence with another - * value. - * @param first A forward iterator. - * @param last A forward iterator. - * @param old_value The value to be replaced. - * @param new_value The replacement value. - * @return replace() returns no value. - * - * For each iterator @c i in the range @p [first,last) if @c *i == - * @p old_value then the assignment @c *i = @p new_value is performed. - */ - template<typename _ForwardIterator, typename _Tp> - void - replace(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __old_value, const _Tp& __new_value) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator>) - __glibcxx_function_requires(_EqualOpConcept< - typename iterator_traits<_ForwardIterator>::value_type, _Tp>) - __glibcxx_function_requires(_ConvertibleConcept<_Tp, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first) - if (*__first == __old_value) - *__first = __new_value; - } - - /** - * @brief Replace each value in a sequence for which a predicate returns - * true with another value. - * @param first A forward iterator. - * @param last A forward iterator. - * @param pred A predicate. - * @param new_value The replacement value. - * @return replace_if() returns no value. - * - * For each iterator @c i in the range @p [first,last) if @p pred(*i) - * is true then the assignment @c *i = @p new_value is performed. - */ - template<typename _ForwardIterator, typename _Predicate, typename _Tp> - void - replace_if(_ForwardIterator __first, _ForwardIterator __last, - _Predicate __pred, const _Tp& __new_value) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator>) - __glibcxx_function_requires(_ConvertibleConcept<_Tp, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first) - if (__pred(*__first)) - *__first = __new_value; - } - - /** - * @brief Copy a sequence, replacing each element of one value with another - * value. - * @param first An input iterator. - * @param last An input iterator. - * @param result An output iterator. - * @param old_value The value to be replaced. - * @param new_value The replacement value. - * @return The end of the output sequence, @p result+(last-first). - * - * Copies each element in the input range @p [first,last) to the - * output range @p [result,result+(last-first)) replacing elements - * equal to @p old_value with @p new_value. - */ - template<typename _InputIterator, typename _OutputIterator, typename _Tp> - _OutputIterator - replace_copy(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, - const _Tp& __old_value, const _Tp& __new_value) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIterator>::value_type, _Tp>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first, ++__result) - *__result = *__first == __old_value ? __new_value : *__first; - return __result; - } - - /** - * @brief Copy a sequence, replacing each value for which a predicate - * returns true with another value. - * @param first An input iterator. - * @param last An input iterator. - * @param result An output iterator. - * @param pred A predicate. - * @param new_value The replacement value. - * @return The end of the output sequence, @p result+(last-first). - * - * Copies each element in the range @p [first,last) to the range - * @p [result,result+(last-first)) replacing elements for which - * @p pred returns true with @p new_value. - */ - template<typename _InputIterator, typename _OutputIterator, - typename _Predicate, typename _Tp> - _OutputIterator - replace_copy_if(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, - _Predicate __pred, const _Tp& __new_value) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first, ++__result) - *__result = __pred(*__first) ? __new_value : *__first; - return __result; - } - - /** - * @brief Assign the result of a function object to each value in a - * sequence. - * @param first A forward iterator. - * @param last A forward iterator. - * @param gen A function object taking no arguments. - * @return generate() returns no value. - * - * Performs the assignment @c *i = @p gen() for each @c i in the range - * @p [first,last). - */ - template<typename _ForwardIterator, typename _Generator> - void - generate(_ForwardIterator __first, _ForwardIterator __last, - _Generator __gen) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_GeneratorConcept<_Generator, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first) - *__first = __gen(); - } - - /** - * @brief Assign the result of a function object to each value in a - * sequence. - * @param first A forward iterator. - * @param n The length of the sequence. - * @param gen A function object taking no arguments. - * @return The end of the sequence, @p first+n - * - * Performs the assignment @c *i = @p gen() for each @c i in the range - * @p [first,first+n). - */ - template<typename _OutputIterator, typename _Size, typename _Generator> - _OutputIterator - generate_n(_OutputIterator __first, _Size __n, _Generator __gen) - { - // concept requirements - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - // "the type returned by a _Generator" - __typeof__(__gen())>) - - for ( ; __n > 0; --__n, ++__first) - *__first = __gen(); - return __first; - } - - /** - * @brief Copy a sequence, removing elements of a given value. - * @param first An input iterator. - * @param last An input iterator. - * @param result An output iterator. - * @param value The value to be removed. - * @return An iterator designating the end of the resulting sequence. - * - * Copies each element in the range @p [first,last) not equal to @p value - * to the range beginning at @p result. - * remove_copy() is stable, so the relative order of elements that are - * copied is unchanged. - */ - template<typename _InputIterator, typename _OutputIterator, typename _Tp> - _OutputIterator - remove_copy(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, const _Tp& __value) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIterator>::value_type, _Tp>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first) - if (!(*__first == __value)) - { - *__result = *__first; - ++__result; - } - return __result; - } - - /** - * @brief Copy a sequence, removing elements for which a predicate is true. - * @param first An input iterator. - * @param last An input iterator. - * @param result An output iterator. - * @param pred A predicate. - * @return An iterator designating the end of the resulting sequence. - * - * Copies each element in the range @p [first,last) for which - * @p pred returns true to the range beginning at @p result. - * - * remove_copy_if() is stable, so the relative order of elements that are - * copied is unchanged. - */ - template<typename _InputIterator, typename _OutputIterator, - typename _Predicate> - _OutputIterator - remove_copy_if(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, _Predicate __pred) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first) - if (!__pred(*__first)) - { - *__result = *__first; - ++__result; - } - return __result; - } - - /** - * @brief Remove elements from a sequence. - * @param first An input iterator. - * @param last An input iterator. - * @param value The value to be removed. - * @return An iterator designating the end of the resulting sequence. - * - * All elements equal to @p value are removed from the range - * @p [first,last). - * - * remove() is stable, so the relative order of elements that are - * not removed is unchanged. - * - * Elements between the end of the resulting sequence and @p last - * are still present, but their value is unspecified. - */ - template<typename _ForwardIterator, typename _Tp> - _ForwardIterator - remove(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __value) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator>) - __glibcxx_function_requires(_EqualOpConcept< - typename iterator_traits<_ForwardIterator>::value_type, _Tp>) - __glibcxx_requires_valid_range(__first, __last); - - __first = std::find(__first, __last, __value); - _ForwardIterator __i = __first; - return __first == __last ? __first - : std::remove_copy(++__i, __last, - __first, __value); - } - - /** - * @brief Remove elements from a sequence using a predicate. - * @param first A forward iterator. - * @param last A forward iterator. - * @param pred A predicate. - * @return An iterator designating the end of the resulting sequence. - * - * All elements for which @p pred returns true are removed from the range - * @p [first,last). - * - * remove_if() is stable, so the relative order of elements that are - * not removed is unchanged. - * - * Elements between the end of the resulting sequence and @p last - * are still present, but their value is unspecified. - */ - template<typename _ForwardIterator, typename _Predicate> - _ForwardIterator - remove_if(_ForwardIterator __first, _ForwardIterator __last, - _Predicate __pred) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator>) - __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - __first = std::find_if(__first, __last, __pred); - _ForwardIterator __i = __first; - return __first == __last ? __first - : std::remove_copy_if(++__i, __last, - __first, __pred); - } - - /** - * @if maint - * This is an uglified unique_copy(_InputIterator, _InputIterator, - * _OutputIterator) - * overloaded for output iterators. - * @endif - */ - template<typename _InputIterator, typename _OutputIterator> - _OutputIterator - __unique_copy(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, - output_iterator_tag) - { - // concept requirements -- taken care of in dispatching function - typename iterator_traits<_InputIterator>::value_type __value = *__first; - *__result = __value; - while (++__first != __last) - if (!(__value == *__first)) - { - __value = *__first; - *++__result = __value; - } - return ++__result; - } - - /** - * @if maint - * This is an uglified unique_copy(_InputIterator, _InputIterator, - * _OutputIterator) - * overloaded for forward iterators. - * @endif - */ - template<typename _InputIterator, typename _ForwardIterator> - _ForwardIterator - __unique_copy(_InputIterator __first, _InputIterator __last, - _ForwardIterator __result, - forward_iterator_tag) - { - // concept requirements -- taken care of in dispatching function - *__result = *__first; - while (++__first != __last) - if (!(*__result == *__first)) - *++__result = *__first; - return ++__result; - } - - /** - * @if maint - * This is an uglified - * unique_copy(_InputIterator, _InputIterator, _OutputIterator, - * _BinaryPredicate) - * overloaded for output iterators. - * @endif - */ - template<typename _InputIterator, typename _OutputIterator, - typename _BinaryPredicate> - _OutputIterator - __unique_copy(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, - _BinaryPredicate __binary_pred, - output_iterator_tag) - { - // concept requirements -- iterators already checked - __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_InputIterator>::value_type, - typename iterator_traits<_InputIterator>::value_type>) - - typename iterator_traits<_InputIterator>::value_type __value = *__first; - *__result = __value; - while (++__first != __last) - if (!__binary_pred(__value, *__first)) - { - __value = *__first; - *++__result = __value; - } - return ++__result; - } - - /** - * @if maint - * This is an uglified - * unique_copy(_InputIterator, _InputIterator, _OutputIterator, - * _BinaryPredicate) - * overloaded for forward iterators. - * @endif - */ - template<typename _InputIterator, typename _ForwardIterator, - typename _BinaryPredicate> - _ForwardIterator - __unique_copy(_InputIterator __first, _InputIterator __last, - _ForwardIterator __result, - _BinaryPredicate __binary_pred, - forward_iterator_tag) - { - // concept requirements -- iterators already checked - __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_ForwardIterator>::value_type, - typename iterator_traits<_InputIterator>::value_type>) - - *__result = *__first; - while (++__first != __last) - if (!__binary_pred(*__result, *__first)) *++__result = *__first; - return ++__result; - } - - /** - * @brief Copy a sequence, removing consecutive duplicate values. - * @param first An input iterator. - * @param last An input iterator. - * @param result An output iterator. - * @return An iterator designating the end of the resulting sequence. - * - * Copies each element in the range @p [first,last) to the range - * beginning at @p result, except that only the first element is copied - * from groups of consecutive elements that compare equal. - * unique_copy() is stable, so the relative order of elements that are - * copied is unchanged. - */ - template<typename _InputIterator, typename _OutputIterator> - inline _OutputIterator - unique_copy(_InputIterator __first, _InputIterator __last, - _OutputIterator __result) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_function_requires(_EqualityComparableConcept< - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - typedef typename iterator_traits<_OutputIterator>::iterator_category - _IterType; - - if (__first == __last) return __result; - return std::__unique_copy(__first, __last, __result, _IterType()); - } - - /** - * @brief Copy a sequence, removing consecutive values using a predicate. - * @param first An input iterator. - * @param last An input iterator. - * @param result An output iterator. - * @param binary_pred A binary predicate. - * @return An iterator designating the end of the resulting sequence. - * - * Copies each element in the range @p [first,last) to the range - * beginning at @p result, except that only the first element is copied - * from groups of consecutive elements for which @p binary_pred returns - * true. - * unique_copy() is stable, so the relative order of elements that are - * copied is unchanged. - */ - template<typename _InputIterator, typename _OutputIterator, - typename _BinaryPredicate> - inline _OutputIterator - unique_copy(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, - _BinaryPredicate __binary_pred) - { - // concept requirements -- predicates checked later - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - typedef typename iterator_traits<_OutputIterator>::iterator_category - _IterType; - - if (__first == __last) return __result; - return std::__unique_copy(__first, __last, __result, - __binary_pred, _IterType()); - } - - /** - * @brief Remove consecutive duplicate values from a sequence. - * @param first A forward iterator. - * @param last A forward iterator. - * @return An iterator designating the end of the resulting sequence. - * - * Removes all but the first element from each group of consecutive - * values that compare equal. - * unique() is stable, so the relative order of elements that are - * not removed is unchanged. - * Elements between the end of the resulting sequence and @p last - * are still present, but their value is unspecified. - */ - template<typename _ForwardIterator> - _ForwardIterator - unique(_ForwardIterator __first, _ForwardIterator __last) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator>) - __glibcxx_function_requires(_EqualityComparableConcept< - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - // Skip the beginning, if already unique. - __first = std::adjacent_find(__first, __last); - if (__first == __last) - return __last; - - // Do the real copy work. - _ForwardIterator __dest = __first; - ++__first; - while (++__first != __last) - if (!(*__dest == *__first)) - *++__dest = *__first; - return ++__dest; - } - - /** - * @brief Remove consecutive values from a sequence using a predicate. - * @param first A forward iterator. - * @param last A forward iterator. - * @param binary_pred A binary predicate. - * @return An iterator designating the end of the resulting sequence. - * - * Removes all but the first element from each group of consecutive - * values for which @p binary_pred returns true. - * unique() is stable, so the relative order of elements that are - * not removed is unchanged. - * Elements between the end of the resulting sequence and @p last - * are still present, but their value is unspecified. - */ - template<typename _ForwardIterator, typename _BinaryPredicate> - _ForwardIterator - unique(_ForwardIterator __first, _ForwardIterator __last, - _BinaryPredicate __binary_pred) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_ForwardIterator>::value_type, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - // Skip the beginning, if already unique. - __first = std::adjacent_find(__first, __last, __binary_pred); - if (__first == __last) - return __last; - - // Do the real copy work. - _ForwardIterator __dest = __first; - ++__first; - while (++__first != __last) - if (!__binary_pred(*__dest, *__first)) - *++__dest = *__first; - return ++__dest; - } - - /** - * @if maint - * This is an uglified reverse(_BidirectionalIterator, - * _BidirectionalIterator) - * overloaded for bidirectional iterators. - * @endif - */ - template<typename _BidirectionalIterator> - void - __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, - bidirectional_iterator_tag) - { - while (true) - if (__first == __last || __first == --__last) - return; - else - std::iter_swap(__first++, __last); - } - - /** - * @if maint - * This is an uglified reverse(_BidirectionalIterator, - * _BidirectionalIterator) - * overloaded for bidirectional iterators. - * @endif - */ - template<typename _RandomAccessIterator> - void - __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, - random_access_iterator_tag) - { - while (__first < __last) - std::iter_swap(__first++, --__last); - } - - /** - * @brief Reverse a sequence. - * @param first A bidirectional iterator. - * @param last A bidirectional iterator. - * @return reverse() returns no value. - * - * Reverses the order of the elements in the range @p [first,last), - * so that the first element becomes the last etc. - * For every @c i such that @p 0<=i<=(last-first)/2), @p reverse() - * swaps @p *(first+i) and @p *(last-(i+1)) - */ - template<typename _BidirectionalIterator> - inline void - reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) - { - // concept requirements - __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept< - _BidirectionalIterator>) - __glibcxx_requires_valid_range(__first, __last); - std::__reverse(__first, __last, std::__iterator_category(__first)); - } - - /** - * @brief Copy a sequence, reversing its elements. - * @param first A bidirectional iterator. - * @param last A bidirectional iterator. - * @param result An output iterator. - * @return An iterator designating the end of the resulting sequence. - * - * Copies the elements in the range @p [first,last) to the range - * @p [result,result+(last-first)) such that the order of the - * elements is reversed. - * For every @c i such that @p 0<=i<=(last-first), @p reverse_copy() - * performs the assignment @p *(result+(last-first)-i) = *(first+i). - * The ranges @p [first,last) and @p [result,result+(last-first)) - * must not overlap. - */ - template<typename _BidirectionalIterator, typename _OutputIterator> - _OutputIterator - reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, - _OutputIterator __result) - { - // concept requirements - __glibcxx_function_requires(_BidirectionalIteratorConcept< - _BidirectionalIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_BidirectionalIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - while (__first != __last) - { - --__last; - *__result = *__last; - ++__result; - } - return __result; - } - - - /** - * @if maint - * This is a helper function for the rotate algorithm specialized on RAIs. - * It returns the greatest common divisor of two integer values. - * @endif - */ - template<typename _EuclideanRingElement> - _EuclideanRingElement - __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n) - { - while (__n != 0) - { - _EuclideanRingElement __t = __m % __n; - __m = __n; - __n = __t; - } - return __m; - } - - /** - * @if maint - * This is a helper function for the rotate algorithm. - * @endif - */ - template<typename _ForwardIterator> - void - __rotate(_ForwardIterator __first, - _ForwardIterator __middle, - _ForwardIterator __last, - forward_iterator_tag) - { - if ((__first == __middle) || (__last == __middle)) - return; - - _ForwardIterator __first2 = __middle; - do - { - swap(*__first++, *__first2++); - if (__first == __middle) - __middle = __first2; - } - while (__first2 != __last); - - __first2 = __middle; - - while (__first2 != __last) - { - swap(*__first++, *__first2++); - if (__first == __middle) - __middle = __first2; - else if (__first2 == __last) - __first2 = __middle; - } - } - - /** - * @if maint - * This is a helper function for the rotate algorithm. - * @endif - */ - template<typename _BidirectionalIterator> - void - __rotate(_BidirectionalIterator __first, - _BidirectionalIterator __middle, - _BidirectionalIterator __last, - bidirectional_iterator_tag) - { - // concept requirements - __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept< - _BidirectionalIterator>) - - if ((__first == __middle) || (__last == __middle)) - return; - - std::__reverse(__first, __middle, bidirectional_iterator_tag()); - std::__reverse(__middle, __last, bidirectional_iterator_tag()); - - while (__first != __middle && __middle != __last) - swap(*__first++, *--__last); - - if (__first == __middle) - std::__reverse(__middle, __last, bidirectional_iterator_tag()); - else - std::__reverse(__first, __middle, bidirectional_iterator_tag()); - } - - /** - * @if maint - * This is a helper function for the rotate algorithm. - * @endif - */ - template<typename _RandomAccessIterator> - void - __rotate(_RandomAccessIterator __first, - _RandomAccessIterator __middle, - _RandomAccessIterator __last, - random_access_iterator_tag) - { - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - - if ((__first == __middle) || (__last == __middle)) - return; - - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _Distance; - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - const _Distance __n = __last - __first; - const _Distance __k = __middle - __first; - const _Distance __l = __n - __k; - - if (__k == __l) - { - std::swap_ranges(__first, __middle, __middle); - return; - } - - const _Distance __d = __gcd(__n, __k); - - for (_Distance __i = 0; __i < __d; __i++) - { - const _ValueType __tmp = *__first; - _RandomAccessIterator __p = __first; - - if (__k < __l) - { - for (_Distance __j = 0; __j < __l / __d; __j++) - { - if (__p > __first + __l) - { - *__p = *(__p - __l); - __p -= __l; - } - - *__p = *(__p + __k); - __p += __k; - } - } - else - { - for (_Distance __j = 0; __j < __k / __d - 1; __j ++) - { - if (__p < __last - __k) - { - *__p = *(__p + __k); - __p += __k; - } - *__p = * (__p - __l); - __p -= __l; - } - } - - *__p = __tmp; - ++__first; - } - } - - /** - * @brief Rotate the elements of a sequence. - * @param first A forward iterator. - * @param middle A forward iterator. - * @param last A forward iterator. - * @return Nothing. - * - * Rotates the elements of the range @p [first,last) by @p (middle-first) - * positions so that the element at @p middle is moved to @p first, the - * element at @p middle+1 is moved to @first+1 and so on for each element - * in the range @p [first,last). - * - * This effectively swaps the ranges @p [first,middle) and - * @p [middle,last). - * - * Performs @p *(first+(n+(last-middle))%(last-first))=*(first+n) for - * each @p n in the range @p [0,last-first). - */ - template<typename _ForwardIterator> - inline void - rotate(_ForwardIterator __first, _ForwardIterator __middle, - _ForwardIterator __last) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator>) - __glibcxx_requires_valid_range(__first, __middle); - __glibcxx_requires_valid_range(__middle, __last); - - typedef typename iterator_traits<_ForwardIterator>::iterator_category - _IterType; - std::__rotate(__first, __middle, __last, _IterType()); - } - - /** - * @brief Copy a sequence, rotating its elements. - * @param first A forward iterator. - * @param middle A forward iterator. - * @param last A forward iterator. - * @param result An output iterator. - * @return An iterator designating the end of the resulting sequence. - * - * Copies the elements of the range @p [first,last) to the range - * beginning at @result, rotating the copied elements by @p (middle-first) - * positions so that the element at @p middle is moved to @p result, the - * element at @p middle+1 is moved to @result+1 and so on for each element - * in the range @p [first,last). - * - * Performs @p *(result+(n+(last-middle))%(last-first))=*(first+n) for - * each @p n in the range @p [0,last-first). - */ - template<typename _ForwardIterator, typename _OutputIterator> - _OutputIterator - rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, - _ForwardIterator __last, _OutputIterator __result) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __middle); - __glibcxx_requires_valid_range(__middle, __last); - - return std::copy(__first, __middle, copy(__middle, __last, __result)); - } - - /** - * @brief Randomly shuffle the elements of a sequence. - * @param first A forward iterator. - * @param last A forward iterator. - * @return Nothing. - * - * Reorder the elements in the range @p [first,last) using a random - * distribution, so that every possible ordering of the sequence is - * equally likely. - */ - template<typename _RandomAccessIterator> - inline void - random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last) - { - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first != __last) - for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) - std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1))); - } - - /** - * @brief Shuffle the elements of a sequence using a random number - * generator. - * @param first A forward iterator. - * @param last A forward iterator. - * @param rand The RNG functor or function. - * @return Nothing. - * - * Reorders the elements in the range @p [first,last) using @p rand to - * provide a random distribution. Calling @p rand(N) for a positive - * integer @p N should return a randomly chosen integer from the - * range [0,N). - */ - template<typename _RandomAccessIterator, typename _RandomNumberGenerator> - void - random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, - _RandomNumberGenerator& __rand) - { - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) - return; - for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) - std::iter_swap(__i, __first + __rand((__i - __first) + 1)); - } - - - /** - * @if maint - * This is a helper function... - * @endif - */ - template<typename _ForwardIterator, typename _Predicate> - _ForwardIterator - __partition(_ForwardIterator __first, _ForwardIterator __last, - _Predicate __pred, - forward_iterator_tag) - { - if (__first == __last) - return __first; - - while (__pred(*__first)) - if (++__first == __last) - return __first; - - _ForwardIterator __next = __first; - - while (++__next != __last) - if (__pred(*__next)) - { - swap(*__first, *__next); - ++__first; - } - - return __first; - } - - /** - * @if maint - * This is a helper function... - * @endif - */ - template<typename _BidirectionalIterator, typename _Predicate> - _BidirectionalIterator - __partition(_BidirectionalIterator __first, _BidirectionalIterator __last, - _Predicate __pred, - bidirectional_iterator_tag) - { - while (true) - { - while (true) - if (__first == __last) - return __first; - else if (__pred(*__first)) - ++__first; - else - break; - --__last; - while (true) - if (__first == __last) - return __first; - else if (!__pred(*__last)) - --__last; - else - break; - std::iter_swap(__first, __last); - ++__first; - } - } - - /** - * @brief Move elements for which a predicate is true to the beginning - * of a sequence. - * @param first A forward iterator. - * @param last A forward iterator. - * @param pred A predicate functor. - * @return An iterator @p middle such that @p pred(i) is true for each - * iterator @p i in the range @p [first,middle) and false for each @p i - * in the range @p [middle,last). - * - * @p pred must not modify its operand. @p partition() does not preserve - * the relative ordering of elements in each group, use - * @p stable_partition() if this is needed. - */ - template<typename _ForwardIterator, typename _Predicate> - inline _ForwardIterator - partition(_ForwardIterator __first, _ForwardIterator __last, - _Predicate __pred) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator>) - __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - return std::__partition(__first, __last, __pred, - std::__iterator_category(__first)); - } - - - /** - * @if maint - * This is a helper function... - * @endif - */ - template<typename _ForwardIterator, typename _Predicate, typename _Distance> - _ForwardIterator - __inplace_stable_partition(_ForwardIterator __first, - _ForwardIterator __last, - _Predicate __pred, _Distance __len) - { - if (__len == 1) - return __pred(*__first) ? __last : __first; - _ForwardIterator __middle = __first; - std::advance(__middle, __len / 2); - _ForwardIterator __begin = std::__inplace_stable_partition(__first, - __middle, - __pred, - __len / 2); - _ForwardIterator __end = std::__inplace_stable_partition(__middle, __last, - __pred, - __len - - __len / 2); - std::rotate(__begin, __middle, __end); - std::advance(__begin, std::distance(__middle, __end)); - return __begin; - } - - /** - * @if maint - * This is a helper function... - * @endif - */ - template<typename _ForwardIterator, typename _Pointer, typename _Predicate, - typename _Distance> - _ForwardIterator - __stable_partition_adaptive(_ForwardIterator __first, - _ForwardIterator __last, - _Predicate __pred, _Distance __len, - _Pointer __buffer, - _Distance __buffer_size) - { - if (__len <= __buffer_size) - { - _ForwardIterator __result1 = __first; - _Pointer __result2 = __buffer; - for ( ; __first != __last ; ++__first) - if (__pred(*__first)) - { - *__result1 = *__first; - ++__result1; - } - else - { - *__result2 = *__first; - ++__result2; - } - std::copy(__buffer, __result2, __result1); - return __result1; - } - else - { - _ForwardIterator __middle = __first; - std::advance(__middle, __len / 2); - _ForwardIterator __begin = - std::__stable_partition_adaptive(__first, __middle, __pred, - __len / 2, __buffer, - __buffer_size); - _ForwardIterator __end = - std::__stable_partition_adaptive(__middle, __last, __pred, - __len - __len / 2, - __buffer, __buffer_size); - std::rotate(__begin, __middle, __end); - std::advance(__begin, std::distance(__middle, __end)); - return __begin; - } - } - - /** - * @brief Move elements for which a predicate is true to the beginning - * of a sequence, preserving relative ordering. - * @param first A forward iterator. - * @param last A forward iterator. - * @param pred A predicate functor. - * @return An iterator @p middle such that @p pred(i) is true for each - * iterator @p i in the range @p [first,middle) and false for each @p i - * in the range @p [middle,last). - * - * Performs the same function as @p partition() with the additional - * guarantee that the relative ordering of elements in each group is - * preserved, so any two elements @p x and @p y in the range - * @p [first,last) such that @p pred(x)==pred(y) will have the same - * relative ordering after calling @p stable_partition(). - */ - template<typename _ForwardIterator, typename _Predicate> - _ForwardIterator - stable_partition(_ForwardIterator __first, _ForwardIterator __last, - _Predicate __pred) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator>) - __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) - return __first; - else - { - typedef typename iterator_traits<_ForwardIterator>::value_type - _ValueType; - typedef typename iterator_traits<_ForwardIterator>::difference_type - _DistanceType; - - _Temporary_buffer<_ForwardIterator, _ValueType> __buf(__first, - __last); - if (__buf.size() > 0) - return - std::__stable_partition_adaptive(__first, __last, __pred, - _DistanceType(__buf.requested_size()), - __buf.begin(), __buf.size()); - else - return - std::__inplace_stable_partition(__first, __last, __pred, - _DistanceType(__buf.requested_size())); - } - } - - /** - * @if maint - * This is a helper function... - * @endif - */ - template<typename _RandomAccessIterator, typename _Tp> - _RandomAccessIterator - __unguarded_partition(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Tp __pivot) - { - while (true) - { - while (*__first < __pivot) - ++__first; - --__last; - while (__pivot < *__last) - --__last; - if (!(__first < __last)) - return __first; - std::iter_swap(__first, __last); - ++__first; - } - } - - /** - * @if maint - * This is a helper function... - * @endif - */ - template<typename _RandomAccessIterator, typename _Tp, typename _Compare> - _RandomAccessIterator - __unguarded_partition(_RandomAccessIterator __first, - _RandomAccessIterator __last, - _Tp __pivot, _Compare __comp) - { - while (true) - { - while (__comp(*__first, __pivot)) - ++__first; - --__last; - while (__comp(__pivot, *__last)) - --__last; - if (!(__first < __last)) - return __first; - std::iter_swap(__first, __last); - ++__first; - } - } - - /** - * @if maint - * @doctodo - * This controls some aspect of the sort routines. - * @endif - */ - enum { _S_threshold = 16 }; - - /** - * @if maint - * This is a helper function for the sort routine. - * @endif - */ - template<typename _RandomAccessIterator, typename _Tp> - void - __unguarded_linear_insert(_RandomAccessIterator __last, _Tp __val) - { - _RandomAccessIterator __next = __last; - --__next; - while (__val < *__next) - { - *__last = *__next; - __last = __next; - --__next; - } - *__last = __val; - } - - /** - * @if maint - * This is a helper function for the sort routine. - * @endif - */ - template<typename _RandomAccessIterator, typename _Tp, typename _Compare> - void - __unguarded_linear_insert(_RandomAccessIterator __last, _Tp __val, - _Compare __comp) - { - _RandomAccessIterator __next = __last; - --__next; - while (__comp(__val, *__next)) - { - *__last = *__next; - __last = __next; - --__next; - } - *__last = __val; - } - - /** - * @if maint - * This is a helper function for the sort routine. - * @endif - */ - template<typename _RandomAccessIterator> - void - __insertion_sort(_RandomAccessIterator __first, - _RandomAccessIterator __last) - { - if (__first == __last) - return; - - for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) - { - typename iterator_traits<_RandomAccessIterator>::value_type - __val = *__i; - if (__val < *__first) - { - std::copy_backward(__first, __i, __i + 1); - *__first = __val; - } - else - std::__unguarded_linear_insert(__i, __val); - } - } - - /** - * @if maint - * This is a helper function for the sort routine. - * @endif - */ - template<typename _RandomAccessIterator, typename _Compare> - void - __insertion_sort(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Compare __comp) - { - if (__first == __last) return; - - for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) - { - typename iterator_traits<_RandomAccessIterator>::value_type - __val = *__i; - if (__comp(__val, *__first)) - { - std::copy_backward(__first, __i, __i + 1); - *__first = __val; - } - else - std::__unguarded_linear_insert(__i, __val, __comp); - } - } - - /** - * @if maint - * This is a helper function for the sort routine. - * @endif - */ - template<typename _RandomAccessIterator> - inline void - __unguarded_insertion_sort(_RandomAccessIterator __first, - _RandomAccessIterator __last) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - for (_RandomAccessIterator __i = __first; __i != __last; ++__i) - std::__unguarded_linear_insert(__i, _ValueType(*__i)); - } - - /** - * @if maint - * This is a helper function for the sort routine. - * @endif - */ - template<typename _RandomAccessIterator, typename _Compare> - inline void - __unguarded_insertion_sort(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Compare __comp) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - for (_RandomAccessIterator __i = __first; __i != __last; ++__i) - std::__unguarded_linear_insert(__i, _ValueType(*__i), __comp); - } - - /** - * @if maint - * This is a helper function for the sort routine. - * @endif - */ - template<typename _RandomAccessIterator> - void - __final_insertion_sort(_RandomAccessIterator __first, - _RandomAccessIterator __last) - { - if (__last - __first > _S_threshold) - { - std::__insertion_sort(__first, __first + _S_threshold); - std::__unguarded_insertion_sort(__first + _S_threshold, __last); - } - else - std::__insertion_sort(__first, __last); - } - - /** - * @if maint - * This is a helper function for the sort routine. - * @endif - */ - template<typename _RandomAccessIterator, typename _Compare> - void - __final_insertion_sort(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Compare __comp) - { - if (__last - __first > _S_threshold) - { - std::__insertion_sort(__first, __first + _S_threshold, __comp); - std::__unguarded_insertion_sort(__first + _S_threshold, __last, - __comp); - } - else - std::__insertion_sort(__first, __last, __comp); - } - - /** - * @if maint - * This is a helper function for the sort routine. - * @endif - */ - template<typename _Size> - inline _Size - __lg(_Size __n) - { - _Size __k; - for (__k = 0; __n != 1; __n >>= 1) - ++__k; - return __k; - } - - /** - * @brief Sort the smallest elements of a sequence. - * @param first An iterator. - * @param middle Another iterator. - * @param last Another iterator. - * @return Nothing. - * - * Sorts the smallest @p (middle-first) elements in the range - * @p [first,last) and moves them to the range @p [first,middle). The - * order of the remaining elements in the range @p [middle,last) is - * undefined. - * After the sort if @p i and @j are iterators in the range - * @p [first,middle) such that @i precedes @j and @k is an iterator in - * the range @p [middle,last) then @p *j<*i and @p *k<*i are both false. - */ - template<typename _RandomAccessIterator> - void - partial_sort(_RandomAccessIterator __first, - _RandomAccessIterator __middle, - _RandomAccessIterator __last) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) - __glibcxx_requires_valid_range(__first, __middle); - __glibcxx_requires_valid_range(__middle, __last); - - std::make_heap(__first, __middle); - for (_RandomAccessIterator __i = __middle; __i < __last; ++__i) - if (*__i < *__first) - std::__pop_heap(__first, __middle, __i, _ValueType(*__i)); - std::sort_heap(__first, __middle); - } - - /** - * @brief Sort the smallest elements of a sequence using a predicate - * for comparison. - * @param first An iterator. - * @param middle Another iterator. - * @param last Another iterator. - * @param comp A comparison functor. - * @return Nothing. - * - * Sorts the smallest @p (middle-first) elements in the range - * @p [first,last) and moves them to the range @p [first,middle). The - * order of the remaining elements in the range @p [middle,last) is - * undefined. - * After the sort if @p i and @j are iterators in the range - * @p [first,middle) such that @i precedes @j and @k is an iterator in - * the range @p [middle,last) then @p *comp(j,*i) and @p comp(*k,*i) - * are both false. - */ - template<typename _RandomAccessIterator, typename _Compare> - void - partial_sort(_RandomAccessIterator __first, - _RandomAccessIterator __middle, - _RandomAccessIterator __last, - _Compare __comp) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - _ValueType, _ValueType>) - __glibcxx_requires_valid_range(__first, __middle); - __glibcxx_requires_valid_range(__middle, __last); - - std::make_heap(__first, __middle, __comp); - for (_RandomAccessIterator __i = __middle; __i < __last; ++__i) - if (__comp(*__i, *__first)) - std::__pop_heap(__first, __middle, __i, _ValueType(*__i), __comp); - std::sort_heap(__first, __middle, __comp); - } - - /** - * @brief Copy the smallest elements of a sequence. - * @param first An iterator. - * @param last Another iterator. - * @param result_first A random-access iterator. - * @param result_last Another random-access iterator. - * @return An iterator indicating the end of the resulting sequence. - * - * Copies and sorts the smallest N values from the range @p [first,last) - * to the range beginning at @p result_first, where the number of - * elements to be copied, @p N, is the smaller of @p (last-first) and - * @p (result_last-result_first). - * After the sort if @p i and @j are iterators in the range - * @p [result_first,result_first+N) such that @i precedes @j then - * @p *j<*i is false. - * The value returned is @p result_first+N. - */ - template<typename _InputIterator, typename _RandomAccessIterator> - _RandomAccessIterator - partial_sort_copy(_InputIterator __first, _InputIterator __last, - _RandomAccessIterator __result_first, - _RandomAccessIterator __result_last) - { - typedef typename iterator_traits<_InputIterator>::value_type - _InputValueType; - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _OutputValueType; - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_ConvertibleConcept<_InputValueType, - _OutputValueType>) - __glibcxx_function_requires(_LessThanComparableConcept<_OutputValueType>) - __glibcxx_function_requires(_LessThanComparableConcept<_InputValueType>) - __glibcxx_requires_valid_range(__first, __last); - __glibcxx_requires_valid_range(__result_first, __result_last); - - if (__result_first == __result_last) - return __result_last; - _RandomAccessIterator __result_real_last = __result_first; - while(__first != __last && __result_real_last != __result_last) - { - *__result_real_last = *__first; - ++__result_real_last; - ++__first; - } - std::make_heap(__result_first, __result_real_last); - while (__first != __last) - { - if (*__first < *__result_first) - std::__adjust_heap(__result_first, _DistanceType(0), - _DistanceType(__result_real_last - - __result_first), - _InputValueType(*__first)); - ++__first; - } - std::sort_heap(__result_first, __result_real_last); - return __result_real_last; - } - - /** - * @brief Copy the smallest elements of a sequence using a predicate for - * comparison. - * @param first An input iterator. - * @param last Another input iterator. - * @param result_first A random-access iterator. - * @param result_last Another random-access iterator. - * @param comp A comparison functor. - * @return An iterator indicating the end of the resulting sequence. - * - * Copies and sorts the smallest N values from the range @p [first,last) - * to the range beginning at @p result_first, where the number of - * elements to be copied, @p N, is the smaller of @p (last-first) and - * @p (result_last-result_first). - * After the sort if @p i and @j are iterators in the range - * @p [result_first,result_first+N) such that @i precedes @j then - * @p comp(*j,*i) is false. - * The value returned is @p result_first+N. - */ - template<typename _InputIterator, typename _RandomAccessIterator, typename _Compare> - _RandomAccessIterator - partial_sort_copy(_InputIterator __first, _InputIterator __last, - _RandomAccessIterator __result_first, - _RandomAccessIterator __result_last, - _Compare __comp) - { - typedef typename iterator_traits<_InputIterator>::value_type - _InputValueType; - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _OutputValueType; - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_ConvertibleConcept<_InputValueType, - _OutputValueType>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - _OutputValueType, _OutputValueType>) - __glibcxx_requires_valid_range(__first, __last); - __glibcxx_requires_valid_range(__result_first, __result_last); - - if (__result_first == __result_last) - return __result_last; - _RandomAccessIterator __result_real_last = __result_first; - while(__first != __last && __result_real_last != __result_last) - { - *__result_real_last = *__first; - ++__result_real_last; - ++__first; - } - std::make_heap(__result_first, __result_real_last, __comp); - while (__first != __last) - { - if (__comp(*__first, *__result_first)) - std::__adjust_heap(__result_first, _DistanceType(0), - _DistanceType(__result_real_last - - __result_first), - _InputValueType(*__first), - __comp); - ++__first; - } - std::sort_heap(__result_first, __result_real_last, __comp); - return __result_real_last; - } - - /** - * @if maint - * This is a helper function for the sort routine. - * @endif - */ - template<typename _RandomAccessIterator, typename _Size> - void - __introsort_loop(_RandomAccessIterator __first, - _RandomAccessIterator __last, - _Size __depth_limit) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - while (__last - __first > _S_threshold) - { - if (__depth_limit == 0) - { - std::partial_sort(__first, __last, __last); - return; - } - --__depth_limit; - _RandomAccessIterator __cut = - std::__unguarded_partition(__first, __last, - _ValueType(std::__median(*__first, - *(__first - + (__last - - __first) - / 2), - *(__last - - 1)))); - std::__introsort_loop(__cut, __last, __depth_limit); - __last = __cut; - } - } - - /** - * @if maint - * This is a helper function for the sort routine. - * @endif - */ - template<typename _RandomAccessIterator, typename _Size, typename _Compare> - void - __introsort_loop(_RandomAccessIterator __first, - _RandomAccessIterator __last, - _Size __depth_limit, _Compare __comp) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - while (__last - __first > _S_threshold) - { - if (__depth_limit == 0) - { - std::partial_sort(__first, __last, __last, __comp); - return; - } - --__depth_limit; - _RandomAccessIterator __cut = - std::__unguarded_partition(__first, __last, - _ValueType(std::__median(*__first, - *(__first - + (__last - - __first) - / 2), - *(__last - 1), - __comp)), - __comp); - std::__introsort_loop(__cut, __last, __depth_limit, __comp); - __last = __cut; - } - } - - /** - * @brief Sort the elements of a sequence. - * @param first An iterator. - * @param last Another iterator. - * @return Nothing. - * - * Sorts the elements in the range @p [first,last) in ascending order, - * such that @p *(i+1)<*i is false for each iterator @p i in the range - * @p [first,last-1). - * - * The relative ordering of equivalent elements is not preserved, use - * @p stable_sort() if this is needed. - */ - template<typename _RandomAccessIterator> - inline void - sort(_RandomAccessIterator __first, _RandomAccessIterator __last) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first != __last) - { - std::__introsort_loop(__first, __last, __lg(__last - __first) * 2); - std::__final_insertion_sort(__first, __last); - } - } - - /** - * @brief Sort the elements of a sequence using a predicate for comparison. - * @param first An iterator. - * @param last Another iterator. - * @param comp A comparison functor. - * @return Nothing. - * - * Sorts the elements in the range @p [first,last) in ascending order, - * such that @p comp(*(i+1),*i) is false for every iterator @p i in the - * range @p [first,last-1). - * - * The relative ordering of equivalent elements is not preserved, use - * @p stable_sort() if this is needed. - */ - template<typename _RandomAccessIterator, typename _Compare> - inline void - sort(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Compare __comp) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, - _ValueType>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first != __last) - { - std::__introsort_loop(__first, __last, __lg(__last - __first) * 2, - __comp); - std::__final_insertion_sort(__first, __last, __comp); - } - } - - /** - * @brief Finds the first position in which @a val could be inserted - * without changing the ordering. - * @param first An iterator. - * @param last Another iterator. - * @param val The search term. - * @return An iterator pointing to the first element "not less than" @a val, - * or end() if every element is less than @a val. - * @ingroup binarysearch - */ - template<typename _ForwardIterator, typename _Tp> - _ForwardIterator - lower_bound(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __val) - { - typedef typename iterator_traits<_ForwardIterator>::value_type - _ValueType; - typedef typename iterator_traits<_ForwardIterator>::difference_type - _DistanceType; - - // concept requirements - // Note that these are slightly stricter than those of the 4-argument - // version, defined next. The difference is in the strictness of the - // comparison operations... so for looser checking, define your own - // comparison function, as was intended. - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_SameTypeConcept<_Tp, _ValueType>) - __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) - __glibcxx_requires_partitioned(__first, __last, __val); - - _DistanceType __len = std::distance(__first, __last); - _DistanceType __half; - _ForwardIterator __middle; - - while (__len > 0) - { - __half = __len >> 1; - __middle = __first; - std::advance(__middle, __half); - if (*__middle < __val) - { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - else - __len = __half; - } - return __first; - } - - /** - * @brief Finds the first position in which @a val could be inserted - * without changing the ordering. - * @param first An iterator. - * @param last Another iterator. - * @param val The search term. - * @param comp A functor to use for comparisons. - * @return An iterator pointing to the first element "not less than" @a val, - * or end() if every element is less than @a val. - * @ingroup binarysearch - * - * The comparison function should have the same effects on ordering as - * the function used for the initial sort. - */ - template<typename _ForwardIterator, typename _Tp, typename _Compare> - _ForwardIterator - lower_bound(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __val, _Compare __comp) - { - typedef typename iterator_traits<_ForwardIterator>::value_type - _ValueType; - typedef typename iterator_traits<_ForwardIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - _ValueType, _Tp>) - __glibcxx_requires_partitioned_pred(__first, __last, __val, __comp); - - _DistanceType __len = std::distance(__first, __last); - _DistanceType __half; - _ForwardIterator __middle; - - while (__len > 0) - { - __half = __len >> 1; - __middle = __first; - std::advance(__middle, __half); - if (__comp(*__middle, __val)) - { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - else - __len = __half; - } - return __first; - } - - /** - * @brief Finds the last position in which @a val could be inserted - * without changing the ordering. - * @param first An iterator. - * @param last Another iterator. - * @param val The search term. - * @return An iterator pointing to the first element greater than @a val, - * or end() if no elements are greater than @a val. - * @ingroup binarysearch - */ - template<typename _ForwardIterator, typename _Tp> - _ForwardIterator - upper_bound(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __val) - { - typedef typename iterator_traits<_ForwardIterator>::value_type - _ValueType; - typedef typename iterator_traits<_ForwardIterator>::difference_type - _DistanceType; - - // concept requirements - // See comments on lower_bound. - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_SameTypeConcept<_Tp, _ValueType>) - __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) - __glibcxx_requires_partitioned(__first, __last, __val); - - _DistanceType __len = std::distance(__first, __last); - _DistanceType __half; - _ForwardIterator __middle; - - while (__len > 0) - { - __half = __len >> 1; - __middle = __first; - std::advance(__middle, __half); - if (__val < *__middle) - __len = __half; - else - { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - } - return __first; - } - - /** - * @brief Finds the last position in which @a val could be inserted - * without changing the ordering. - * @param first An iterator. - * @param last Another iterator. - * @param val The search term. - * @param comp A functor to use for comparisons. - * @return An iterator pointing to the first element greater than @a val, - * or end() if no elements are greater than @a val. - * @ingroup binarysearch - * - * The comparison function should have the same effects on ordering as - * the function used for the initial sort. - */ - template<typename _ForwardIterator, typename _Tp, typename _Compare> - _ForwardIterator - upper_bound(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __val, _Compare __comp) - { - typedef typename iterator_traits<_ForwardIterator>::value_type - _ValueType; - typedef typename iterator_traits<_ForwardIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - _Tp, _ValueType>) - __glibcxx_requires_partitioned_pred(__first, __last, __val, __comp); - - _DistanceType __len = std::distance(__first, __last); - _DistanceType __half; - _ForwardIterator __middle; - - while (__len > 0) - { - __half = __len >> 1; - __middle = __first; - std::advance(__middle, __half); - if (__comp(__val, *__middle)) - __len = __half; - else - { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - } - return __first; - } - - /** - * @if maint - * This is a helper function for the merge routines. - * @endif - */ - template<typename _BidirectionalIterator, typename _Distance> - void - __merge_without_buffer(_BidirectionalIterator __first, - _BidirectionalIterator __middle, - _BidirectionalIterator __last, - _Distance __len1, _Distance __len2) - { - if (__len1 == 0 || __len2 == 0) - return; - if (__len1 + __len2 == 2) - { - if (*__middle < *__first) - std::iter_swap(__first, __middle); - return; - } - _BidirectionalIterator __first_cut = __first; - _BidirectionalIterator __second_cut = __middle; - _Distance __len11 = 0; - _Distance __len22 = 0; - if (__len1 > __len2) - { - __len11 = __len1 / 2; - std::advance(__first_cut, __len11); - __second_cut = std::lower_bound(__middle, __last, *__first_cut); - __len22 = std::distance(__middle, __second_cut); - } - else - { - __len22 = __len2 / 2; - std::advance(__second_cut, __len22); - __first_cut = std::upper_bound(__first, __middle, *__second_cut); - __len11 = std::distance(__first, __first_cut); - } - std::rotate(__first_cut, __middle, __second_cut); - _BidirectionalIterator __new_middle = __first_cut; - std::advance(__new_middle, std::distance(__middle, __second_cut)); - std::__merge_without_buffer(__first, __first_cut, __new_middle, - __len11, __len22); - std::__merge_without_buffer(__new_middle, __second_cut, __last, - __len1 - __len11, __len2 - __len22); - } - - /** - * @if maint - * This is a helper function for the merge routines. - * @endif - */ - template<typename _BidirectionalIterator, typename _Distance, - typename _Compare> - void - __merge_without_buffer(_BidirectionalIterator __first, - _BidirectionalIterator __middle, - _BidirectionalIterator __last, - _Distance __len1, _Distance __len2, - _Compare __comp) - { - if (__len1 == 0 || __len2 == 0) - return; - if (__len1 + __len2 == 2) - { - if (__comp(*__middle, *__first)) - std::iter_swap(__first, __middle); - return; - } - _BidirectionalIterator __first_cut = __first; - _BidirectionalIterator __second_cut = __middle; - _Distance __len11 = 0; - _Distance __len22 = 0; - if (__len1 > __len2) - { - __len11 = __len1 / 2; - std::advance(__first_cut, __len11); - __second_cut = std::lower_bound(__middle, __last, *__first_cut, - __comp); - __len22 = std::distance(__middle, __second_cut); - } - else - { - __len22 = __len2 / 2; - std::advance(__second_cut, __len22); - __first_cut = std::upper_bound(__first, __middle, *__second_cut, - __comp); - __len11 = std::distance(__first, __first_cut); - } - std::rotate(__first_cut, __middle, __second_cut); - _BidirectionalIterator __new_middle = __first_cut; - std::advance(__new_middle, std::distance(__middle, __second_cut)); - std::__merge_without_buffer(__first, __first_cut, __new_middle, - __len11, __len22, __comp); - std::__merge_without_buffer(__new_middle, __second_cut, __last, - __len1 - __len11, __len2 - __len22, __comp); - } - - /** - * @if maint - * This is a helper function for the stable sorting routines. - * @endif - */ - template<typename _RandomAccessIterator> - void - __inplace_stable_sort(_RandomAccessIterator __first, - _RandomAccessIterator __last) - { - if (__last - __first < 15) - { - std::__insertion_sort(__first, __last); - return; - } - _RandomAccessIterator __middle = __first + (__last - __first) / 2; - std::__inplace_stable_sort(__first, __middle); - std::__inplace_stable_sort(__middle, __last); - std::__merge_without_buffer(__first, __middle, __last, - __middle - __first, - __last - __middle); - } - - /** - * @if maint - * This is a helper function for the stable sorting routines. - * @endif - */ - template<typename _RandomAccessIterator, typename _Compare> - void - __inplace_stable_sort(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Compare __comp) - { - if (__last - __first < 15) - { - std::__insertion_sort(__first, __last, __comp); - return; - } - _RandomAccessIterator __middle = __first + (__last - __first) / 2; - std::__inplace_stable_sort(__first, __middle, __comp); - std::__inplace_stable_sort(__middle, __last, __comp); - std::__merge_without_buffer(__first, __middle, __last, - __middle - __first, - __last - __middle, - __comp); - } - - /** - * @brief Merges two sorted ranges. - * @param first1 An iterator. - * @param first2 Another iterator. - * @param last1 Another iterator. - * @param last2 Another iterator. - * @param result An iterator pointing to the end of the merged range. - * @return An iterator pointing to the first element "not less than" @a val. - * - * Merges the ranges [first1,last1) and [first2,last2) into the sorted range - * [result, result + (last1-first1) + (last2-first2)). Both input ranges - * must be sorted, and the output range must not overlap with either of - * the input ranges. The sort is @e stable, that is, for equivalent - * elements in the two ranges, elements from the first range will always - * come before elements from the second. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _OutputIterator> - _OutputIterator - merge(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_requires_sorted(__first1, __last1); - __glibcxx_requires_sorted(__first2, __last2); - - while (__first1 != __last1 && __first2 != __last2) - { - if (*__first2 < *__first1) - { - *__result = *__first2; - ++__first2; - } - else - { - *__result = *__first1; - ++__first1; - } - ++__result; - } - return std::copy(__first2, __last2, std::copy(__first1, __last1, - __result)); - } - - /** - * @brief Merges two sorted ranges. - * @param first1 An iterator. - * @param first2 Another iterator. - * @param last1 Another iterator. - * @param last2 Another iterator. - * @param result An iterator pointing to the end of the merged range. - * @param comp A functor to use for comparisons. - * @return An iterator pointing to the first element "not less than" @a val. - * - * Merges the ranges [first1,last1) and [first2,last2) into the sorted range - * [result, result + (last1-first1) + (last2-first2)). Both input ranges - * must be sorted, and the output range must not overlap with either of - * the input ranges. The sort is @e stable, that is, for equivalent - * elements in the two ranges, elements from the first range will always - * come before elements from the second. - * - * The comparison function should have the same effects on ordering as - * the function used for the initial sort. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _OutputIterator, typename _Compare> - _OutputIterator - merge(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result, _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_requires_sorted_pred(__first1, __last1, __comp); - __glibcxx_requires_sorted_pred(__first2, __last2, __comp); - - while (__first1 != __last1 && __first2 != __last2) - { - if (__comp(*__first2, *__first1)) - { - *__result = *__first2; - ++__first2; - } - else - { - *__result = *__first1; - ++__first1; - } - ++__result; - } - return std::copy(__first2, __last2, std::copy(__first1, __last1, - __result)); - } - - template<typename _RandomAccessIterator1, typename _RandomAccessIterator2, - typename _Distance> - void - __merge_sort_loop(_RandomAccessIterator1 __first, - _RandomAccessIterator1 __last, - _RandomAccessIterator2 __result, - _Distance __step_size) - { - const _Distance __two_step = 2 * __step_size; - - while (__last - __first >= __two_step) - { - __result = std::merge(__first, __first + __step_size, - __first + __step_size, __first + __two_step, - __result); - __first += __two_step; - } - - __step_size = std::min(_Distance(__last - __first), __step_size); - std::merge(__first, __first + __step_size, __first + __step_size, __last, - __result); - } - - template<typename _RandomAccessIterator1, typename _RandomAccessIterator2, - typename _Distance, typename _Compare> - void - __merge_sort_loop(_RandomAccessIterator1 __first, - _RandomAccessIterator1 __last, - _RandomAccessIterator2 __result, _Distance __step_size, - _Compare __comp) - { - const _Distance __two_step = 2 * __step_size; - - while (__last - __first >= __two_step) - { - __result = std::merge(__first, __first + __step_size, - __first + __step_size, __first + __two_step, - __result, - __comp); - __first += __two_step; - } - __step_size = std::min(_Distance(__last - __first), __step_size); - - std::merge(__first, __first + __step_size, - __first + __step_size, __last, - __result, - __comp); - } - - enum { _S_chunk_size = 7 }; - - template<typename _RandomAccessIterator, typename _Distance> - void - __chunk_insertion_sort(_RandomAccessIterator __first, - _RandomAccessIterator __last, - _Distance __chunk_size) - { - while (__last - __first >= __chunk_size) - { - std::__insertion_sort(__first, __first + __chunk_size); - __first += __chunk_size; - } - std::__insertion_sort(__first, __last); - } - - template<typename _RandomAccessIterator, typename _Distance, typename _Compare> - void - __chunk_insertion_sort(_RandomAccessIterator __first, - _RandomAccessIterator __last, - _Distance __chunk_size, _Compare __comp) - { - while (__last - __first >= __chunk_size) - { - std::__insertion_sort(__first, __first + __chunk_size, __comp); - __first += __chunk_size; - } - std::__insertion_sort(__first, __last, __comp); - } - - template<typename _RandomAccessIterator, typename _Pointer> - void - __merge_sort_with_buffer(_RandomAccessIterator __first, - _RandomAccessIterator __last, - _Pointer __buffer) - { - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _Distance; - - const _Distance __len = __last - __first; - const _Pointer __buffer_last = __buffer + __len; - - _Distance __step_size = _S_chunk_size; - std::__chunk_insertion_sort(__first, __last, __step_size); - - while (__step_size < __len) - { - std::__merge_sort_loop(__first, __last, __buffer, __step_size); - __step_size *= 2; - std::__merge_sort_loop(__buffer, __buffer_last, __first, __step_size); - __step_size *= 2; - } - } - - template<typename _RandomAccessIterator, typename _Pointer, typename _Compare> - void - __merge_sort_with_buffer(_RandomAccessIterator __first, - _RandomAccessIterator __last, - _Pointer __buffer, _Compare __comp) - { - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _Distance; - - const _Distance __len = __last - __first; - const _Pointer __buffer_last = __buffer + __len; - - _Distance __step_size = _S_chunk_size; - std::__chunk_insertion_sort(__first, __last, __step_size, __comp); - - while (__step_size < __len) - { - std::__merge_sort_loop(__first, __last, __buffer, - __step_size, __comp); - __step_size *= 2; - std::__merge_sort_loop(__buffer, __buffer_last, __first, - __step_size, __comp); - __step_size *= 2; - } - } - - /** - * @if maint - * This is a helper function for the merge routines. - * @endif - */ - template<typename _BidirectionalIterator1, typename _BidirectionalIterator2, - typename _BidirectionalIterator3> - _BidirectionalIterator3 - __merge_backward(_BidirectionalIterator1 __first1, - _BidirectionalIterator1 __last1, - _BidirectionalIterator2 __first2, - _BidirectionalIterator2 __last2, - _BidirectionalIterator3 __result) - { - if (__first1 == __last1) - return std::copy_backward(__first2, __last2, __result); - if (__first2 == __last2) - return std::copy_backward(__first1, __last1, __result); - --__last1; - --__last2; - while (true) - { - if (*__last2 < *__last1) - { - *--__result = *__last1; - if (__first1 == __last1) - return std::copy_backward(__first2, ++__last2, __result); - --__last1; - } - else - { - *--__result = *__last2; - if (__first2 == __last2) - return std::copy_backward(__first1, ++__last1, __result); - --__last2; - } - } - } - - /** - * @if maint - * This is a helper function for the merge routines. - * @endif - */ - template<typename _BidirectionalIterator1, typename _BidirectionalIterator2, - typename _BidirectionalIterator3, typename _Compare> - _BidirectionalIterator3 - __merge_backward(_BidirectionalIterator1 __first1, - _BidirectionalIterator1 __last1, - _BidirectionalIterator2 __first2, - _BidirectionalIterator2 __last2, - _BidirectionalIterator3 __result, - _Compare __comp) - { - if (__first1 == __last1) - return std::copy_backward(__first2, __last2, __result); - if (__first2 == __last2) - return std::copy_backward(__first1, __last1, __result); - --__last1; - --__last2; - while (true) - { - if (__comp(*__last2, *__last1)) - { - *--__result = *__last1; - if (__first1 == __last1) - return std::copy_backward(__first2, ++__last2, __result); - --__last1; - } - else - { - *--__result = *__last2; - if (__first2 == __last2) - return std::copy_backward(__first1, ++__last1, __result); - --__last2; - } - } - } - - /** - * @if maint - * This is a helper function for the merge routines. - * @endif - */ - template<typename _BidirectionalIterator1, typename _BidirectionalIterator2, - typename _Distance> - _BidirectionalIterator1 - __rotate_adaptive(_BidirectionalIterator1 __first, - _BidirectionalIterator1 __middle, - _BidirectionalIterator1 __last, - _Distance __len1, _Distance __len2, - _BidirectionalIterator2 __buffer, - _Distance __buffer_size) - { - _BidirectionalIterator2 __buffer_end; - if (__len1 > __len2 && __len2 <= __buffer_size) - { - __buffer_end = std::copy(__middle, __last, __buffer); - std::copy_backward(__first, __middle, __last); - return std::copy(__buffer, __buffer_end, __first); - } - else if (__len1 <= __buffer_size) - { - __buffer_end = std::copy(__first, __middle, __buffer); - std::copy(__middle, __last, __first); - return std::copy_backward(__buffer, __buffer_end, __last); - } - else - { - std::rotate(__first, __middle, __last); - std::advance(__first, std::distance(__middle, __last)); - return __first; - } - } - - /** - * @if maint - * This is a helper function for the merge routines. - * @endif - */ - template<typename _BidirectionalIterator, typename _Distance, - typename _Pointer> - void - __merge_adaptive(_BidirectionalIterator __first, - _BidirectionalIterator __middle, - _BidirectionalIterator __last, - _Distance __len1, _Distance __len2, - _Pointer __buffer, _Distance __buffer_size) - { - if (__len1 <= __len2 && __len1 <= __buffer_size) - { - _Pointer __buffer_end = std::copy(__first, __middle, __buffer); - std::merge(__buffer, __buffer_end, __middle, __last, __first); - } - else if (__len2 <= __buffer_size) - { - _Pointer __buffer_end = std::copy(__middle, __last, __buffer); - std::__merge_backward(__first, __middle, __buffer, - __buffer_end, __last); - } - else - { - _BidirectionalIterator __first_cut = __first; - _BidirectionalIterator __second_cut = __middle; - _Distance __len11 = 0; - _Distance __len22 = 0; - if (__len1 > __len2) - { - __len11 = __len1 / 2; - std::advance(__first_cut, __len11); - __second_cut = std::lower_bound(__middle, __last, - *__first_cut); - __len22 = std::distance(__middle, __second_cut); - } - else - { - __len22 = __len2 / 2; - std::advance(__second_cut, __len22); - __first_cut = std::upper_bound(__first, __middle, - *__second_cut); - __len11 = std::distance(__first, __first_cut); - } - _BidirectionalIterator __new_middle = - std::__rotate_adaptive(__first_cut, __middle, __second_cut, - __len1 - __len11, __len22, __buffer, - __buffer_size); - std::__merge_adaptive(__first, __first_cut, __new_middle, __len11, - __len22, __buffer, __buffer_size); - std::__merge_adaptive(__new_middle, __second_cut, __last, - __len1 - __len11, - __len2 - __len22, __buffer, __buffer_size); - } - } - - /** - * @if maint - * This is a helper function for the merge routines. - * @endif - */ - template<typename _BidirectionalIterator, typename _Distance, typename _Pointer, - typename _Compare> - void - __merge_adaptive(_BidirectionalIterator __first, - _BidirectionalIterator __middle, - _BidirectionalIterator __last, - _Distance __len1, _Distance __len2, - _Pointer __buffer, _Distance __buffer_size, - _Compare __comp) - { - if (__len1 <= __len2 && __len1 <= __buffer_size) - { - _Pointer __buffer_end = std::copy(__first, __middle, __buffer); - std::merge(__buffer, __buffer_end, __middle, __last, __first, __comp); - } - else if (__len2 <= __buffer_size) - { - _Pointer __buffer_end = std::copy(__middle, __last, __buffer); - std::__merge_backward(__first, __middle, __buffer, __buffer_end, - __last, __comp); - } - else - { - _BidirectionalIterator __first_cut = __first; - _BidirectionalIterator __second_cut = __middle; - _Distance __len11 = 0; - _Distance __len22 = 0; - if (__len1 > __len2) - { - __len11 = __len1 / 2; - std::advance(__first_cut, __len11); - __second_cut = std::lower_bound(__middle, __last, *__first_cut, - __comp); - __len22 = std::distance(__middle, __second_cut); - } - else - { - __len22 = __len2 / 2; - std::advance(__second_cut, __len22); - __first_cut = std::upper_bound(__first, __middle, *__second_cut, - __comp); - __len11 = std::distance(__first, __first_cut); - } - _BidirectionalIterator __new_middle = - std::__rotate_adaptive(__first_cut, __middle, __second_cut, - __len1 - __len11, __len22, __buffer, - __buffer_size); - std::__merge_adaptive(__first, __first_cut, __new_middle, __len11, - __len22, __buffer, __buffer_size, __comp); - std::__merge_adaptive(__new_middle, __second_cut, __last, - __len1 - __len11, - __len2 - __len22, __buffer, - __buffer_size, __comp); - } - } - - /** - * @brief Merges two sorted ranges in place. - * @param first An iterator. - * @param middle Another iterator. - * @param last Another iterator. - * @return Nothing. - * - * Merges two sorted and consecutive ranges, [first,middle) and - * [middle,last), and puts the result in [first,last). The output will - * be sorted. The sort is @e stable, that is, for equivalent - * elements in the two ranges, elements from the first range will always - * come before elements from the second. - * - * If enough additional memory is available, this takes (last-first)-1 - * comparisons. Otherwise an NlogN algorithm is used, where N is - * distance(first,last). - */ - template<typename _BidirectionalIterator> - void - inplace_merge(_BidirectionalIterator __first, - _BidirectionalIterator __middle, - _BidirectionalIterator __last) - { - typedef typename iterator_traits<_BidirectionalIterator>::value_type - _ValueType; - typedef typename iterator_traits<_BidirectionalIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept< - _BidirectionalIterator>) - __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) - __glibcxx_requires_sorted(__first, __middle); - __glibcxx_requires_sorted(__middle, __last); - - if (__first == __middle || __middle == __last) - return; - - _DistanceType __len1 = std::distance(__first, __middle); - _DistanceType __len2 = std::distance(__middle, __last); - - _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first, - __last); - if (__buf.begin() == 0) - std::__merge_without_buffer(__first, __middle, __last, __len1, __len2); - else - std::__merge_adaptive(__first, __middle, __last, __len1, __len2, - __buf.begin(), _DistanceType(__buf.size())); - } - - /** - * @brief Merges two sorted ranges in place. - * @param first An iterator. - * @param middle Another iterator. - * @param last Another iterator. - * @param comp A functor to use for comparisons. - * @return Nothing. - * - * Merges two sorted and consecutive ranges, [first,middle) and - * [middle,last), and puts the result in [first,last). The output will - * be sorted. The sort is @e stable, that is, for equivalent - * elements in the two ranges, elements from the first range will always - * come before elements from the second. - * - * If enough additional memory is available, this takes (last-first)-1 - * comparisons. Otherwise an NlogN algorithm is used, where N is - * distance(first,last). - * - * The comparison function should have the same effects on ordering as - * the function used for the initial sort. - */ - template<typename _BidirectionalIterator, typename _Compare> - void - inplace_merge(_BidirectionalIterator __first, - _BidirectionalIterator __middle, - _BidirectionalIterator __last, - _Compare __comp) - { - typedef typename iterator_traits<_BidirectionalIterator>::value_type - _ValueType; - typedef typename iterator_traits<_BidirectionalIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept< - _BidirectionalIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - _ValueType, _ValueType>) - __glibcxx_requires_sorted_pred(__first, __middle, __comp); - __glibcxx_requires_sorted_pred(__middle, __last, __comp); - - if (__first == __middle || __middle == __last) - return; - - const _DistanceType __len1 = std::distance(__first, __middle); - const _DistanceType __len2 = std::distance(__middle, __last); - - _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first, - __last); - if (__buf.begin() == 0) - std::__merge_without_buffer(__first, __middle, __last, __len1, - __len2, __comp); - else - std::__merge_adaptive(__first, __middle, __last, __len1, __len2, - __buf.begin(), _DistanceType(__buf.size()), - __comp); - } - - template<typename _RandomAccessIterator, typename _Pointer, - typename _Distance> - void - __stable_sort_adaptive(_RandomAccessIterator __first, - _RandomAccessIterator __last, - _Pointer __buffer, _Distance __buffer_size) - { - const _Distance __len = (__last - __first + 1) / 2; - const _RandomAccessIterator __middle = __first + __len; - if (__len > __buffer_size) - { - std::__stable_sort_adaptive(__first, __middle, - __buffer, __buffer_size); - std::__stable_sort_adaptive(__middle, __last, - __buffer, __buffer_size); - } - else - { - std::__merge_sort_with_buffer(__first, __middle, __buffer); - std::__merge_sort_with_buffer(__middle, __last, __buffer); - } - std::__merge_adaptive(__first, __middle, __last, - _Distance(__middle - __first), - _Distance(__last - __middle), - __buffer, __buffer_size); - } - - template<typename _RandomAccessIterator, typename _Pointer, - typename _Distance, typename _Compare> - void - __stable_sort_adaptive(_RandomAccessIterator __first, - _RandomAccessIterator __last, - _Pointer __buffer, _Distance __buffer_size, - _Compare __comp) - { - const _Distance __len = (__last - __first + 1) / 2; - const _RandomAccessIterator __middle = __first + __len; - if (__len > __buffer_size) - { - std::__stable_sort_adaptive(__first, __middle, __buffer, - __buffer_size, __comp); - std::__stable_sort_adaptive(__middle, __last, __buffer, - __buffer_size, __comp); - } - else - { - std::__merge_sort_with_buffer(__first, __middle, __buffer, __comp); - std::__merge_sort_with_buffer(__middle, __last, __buffer, __comp); - } - std::__merge_adaptive(__first, __middle, __last, - _Distance(__middle - __first), - _Distance(__last - __middle), - __buffer, __buffer_size, - __comp); - } - - /** - * @brief Sort the elements of a sequence, preserving the relative order - * of equivalent elements. - * @param first An iterator. - * @param last Another iterator. - * @return Nothing. - * - * Sorts the elements in the range @p [first,last) in ascending order, - * such that @p *(i+1)<*i is false for each iterator @p i in the range - * @p [first,last-1). - * - * The relative ordering of equivalent elements is preserved, so any two - * elements @p x and @p y in the range @p [first,last) such that - * @p x<y is false and @p y<x is false will have the same relative - * ordering after calling @p stable_sort(). - */ - template<typename _RandomAccessIterator> - inline void - stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) - __glibcxx_requires_valid_range(__first, __last); - - _Temporary_buffer<_RandomAccessIterator, _ValueType> - buf(__first, __last); - if (buf.begin() == 0) - std::__inplace_stable_sort(__first, __last); - else - std::__stable_sort_adaptive(__first, __last, buf.begin(), - _DistanceType(buf.size())); - } - - /** - * @brief Sort the elements of a sequence using a predicate for comparison, - * preserving the relative order of equivalent elements. - * @param first An iterator. - * @param last Another iterator. - * @param comp A comparison functor. - * @return Nothing. - * - * Sorts the elements in the range @p [first,last) in ascending order, - * such that @p comp(*(i+1),*i) is false for each iterator @p i in the - * range @p [first,last-1). - * - * The relative ordering of equivalent elements is preserved, so any two - * elements @p x and @p y in the range @p [first,last) such that - * @p comp(x,y) is false and @p comp(y,x) is false will have the same - * relative ordering after calling @p stable_sort(). - */ - template<typename _RandomAccessIterator, typename _Compare> - inline void - stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Compare __comp) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - _ValueType, - _ValueType>) - __glibcxx_requires_valid_range(__first, __last); - - _Temporary_buffer<_RandomAccessIterator, _ValueType> buf(__first, __last); - if (buf.begin() == 0) - std::__inplace_stable_sort(__first, __last, __comp); - else - std::__stable_sort_adaptive(__first, __last, buf.begin(), - _DistanceType(buf.size()), __comp); - } - - /** - * @brief Sort a sequence just enough to find a particular position. - * @param first An iterator. - * @param nth Another iterator. - * @param last Another iterator. - * @return Nothing. - * - * Rearranges the elements in the range @p [first,last) so that @p *nth - * is the same element that would have been in that position had the - * whole sequence been sorted. - * whole sequence been sorted. The elements either side of @p *nth are - * not completely sorted, but for any iterator @i in the range - * @p [first,nth) and any iterator @j in the range @p [nth,last) it - * holds that @p *j<*i is false. - */ - template<typename _RandomAccessIterator> - void - nth_element(_RandomAccessIterator __first, - _RandomAccessIterator __nth, - _RandomAccessIterator __last) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) - __glibcxx_requires_valid_range(__first, __nth); - __glibcxx_requires_valid_range(__nth, __last); - - while (__last - __first > 3) - { - _RandomAccessIterator __cut = - std::__unguarded_partition(__first, __last, - _ValueType(std::__median(*__first, - *(__first - + (__last - - __first) - / 2), - *(__last - - 1)))); - if (__cut <= __nth) - __first = __cut; - else - __last = __cut; - } - std::__insertion_sort(__first, __last); - } - - /** - * @brief Sort a sequence just enough to find a particular position - * using a predicate for comparison. - * @param first An iterator. - * @param nth Another iterator. - * @param last Another iterator. - * @param comp A comparison functor. - * @return Nothing. - * - * Rearranges the elements in the range @p [first,last) so that @p *nth - * is the same element that would have been in that position had the - * whole sequence been sorted. The elements either side of @p *nth are - * not completely sorted, but for any iterator @i in the range - * @p [first,nth) and any iterator @j in the range @p [nth,last) it - * holds that @p comp(*j,*i) is false. - */ - template<typename _RandomAccessIterator, typename _Compare> - void - nth_element(_RandomAccessIterator __first, - _RandomAccessIterator __nth, - _RandomAccessIterator __last, - _Compare __comp) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - _ValueType, _ValueType>) - __glibcxx_requires_valid_range(__first, __nth); - __glibcxx_requires_valid_range(__nth, __last); - - while (__last - __first > 3) - { - _RandomAccessIterator __cut = - std::__unguarded_partition(__first, __last, - _ValueType(std::__median(*__first, - *(__first - + (__last - - __first) - / 2), - *(__last - 1), - __comp)), __comp); - if (__cut <= __nth) - __first = __cut; - else - __last = __cut; - } - std::__insertion_sort(__first, __last, __comp); - } - - /** - * @brief Finds the largest subrange in which @a val could be inserted - * at any place in it without changing the ordering. - * @param first An iterator. - * @param last Another iterator. - * @param val The search term. - * @return An pair of iterators defining the subrange. - * @ingroup binarysearch - * - * This is equivalent to - * @code - * std::make_pair(lower_bound(first, last, val), - * upper_bound(first, last, val)) - * @endcode - * but does not actually call those functions. - */ - template<typename _ForwardIterator, typename _Tp> - pair<_ForwardIterator, _ForwardIterator> - equal_range(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __val) - { - typedef typename iterator_traits<_ForwardIterator>::value_type - _ValueType; - typedef typename iterator_traits<_ForwardIterator>::difference_type - _DistanceType; - - // concept requirements - // See comments on lower_bound. - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_SameTypeConcept<_Tp, _ValueType>) - __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) - __glibcxx_requires_partitioned(__first, __last, __val); - - _DistanceType __len = std::distance(__first, __last); - _DistanceType __half; - _ForwardIterator __middle, __left, __right; - - while (__len > 0) - { - __half = __len >> 1; - __middle = __first; - std::advance(__middle, __half); - if (*__middle < __val) - { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - else if (__val < *__middle) - __len = __half; - else - { - __left = std::lower_bound(__first, __middle, __val); - std::advance(__first, __len); - __right = std::upper_bound(++__middle, __first, __val); - return pair<_ForwardIterator, _ForwardIterator>(__left, __right); - } - } - return pair<_ForwardIterator, _ForwardIterator>(__first, __first); - } - - /** - * @brief Finds the largest subrange in which @a val could be inserted - * at any place in it without changing the ordering. - * @param first An iterator. - * @param last Another iterator. - * @param val The search term. - * @param comp A functor to use for comparisons. - * @return An pair of iterators defining the subrange. - * @ingroup binarysearch - * - * This is equivalent to - * @code - * std::make_pair(lower_bound(first, last, val, comp), - * upper_bound(first, last, val, comp)) - * @endcode - * but does not actually call those functions. - */ - template<typename _ForwardIterator, typename _Tp, typename _Compare> - pair<_ForwardIterator, _ForwardIterator> - equal_range(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __val, - _Compare __comp) - { - typedef typename iterator_traits<_ForwardIterator>::value_type - _ValueType; - typedef typename iterator_traits<_ForwardIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - _ValueType, _Tp>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - _Tp, _ValueType>) - __glibcxx_requires_partitioned_pred(__first, __last, __val, __comp); - - _DistanceType __len = std::distance(__first, __last); - _DistanceType __half; - _ForwardIterator __middle, __left, __right; - - while (__len > 0) - { - __half = __len >> 1; - __middle = __first; - std::advance(__middle, __half); - if (__comp(*__middle, __val)) - { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - else if (__comp(__val, *__middle)) - __len = __half; - else - { - __left = std::lower_bound(__first, __middle, __val, __comp); - std::advance(__first, __len); - __right = std::upper_bound(++__middle, __first, __val, __comp); - return pair<_ForwardIterator, _ForwardIterator>(__left, __right); - } - } - return pair<_ForwardIterator, _ForwardIterator>(__first, __first); - } - - /** - * @brief Determines whether an element exists in a range. - * @param first An iterator. - * @param last Another iterator. - * @param val The search term. - * @return True if @a val (or its equivelent) is in [@a first,@a last ]. - * @ingroup binarysearch - * - * Note that this does not actually return an iterator to @a val. For - * that, use std::find or a container's specialized find member functions. - */ - template<typename _ForwardIterator, typename _Tp> - bool - binary_search(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __val) - { - // concept requirements - // See comments on lower_bound. - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_SameTypeConcept<_Tp, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) - __glibcxx_requires_partitioned(__first, __last, __val); - - _ForwardIterator __i = std::lower_bound(__first, __last, __val); - return __i != __last && !(__val < *__i); - } - - /** - * @brief Determines whether an element exists in a range. - * @param first An iterator. - * @param last Another iterator. - * @param val The search term. - * @param comp A functor to use for comparisons. - * @return True if @a val (or its equivelent) is in [@a first,@a last ]. - * @ingroup binarysearch - * - * Note that this does not actually return an iterator to @a val. For - * that, use std::find or a container's specialized find member functions. - * - * The comparison function should have the same effects on ordering as - * the function used for the initial sort. - */ - template<typename _ForwardIterator, typename _Tp, typename _Compare> - bool - binary_search(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __val, _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_ForwardIterator>::value_type, _Tp>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _Tp, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_partitioned_pred(__first, __last, __val, __comp); - - _ForwardIterator __i = std::lower_bound(__first, __last, __val, __comp); - return __i != __last && !__comp(__val, *__i); - } - - // Set algorithms: includes, set_union, set_intersection, set_difference, - // set_symmetric_difference. All of these algorithms have the precondition - // that their input ranges are sorted and the postcondition that their output - // ranges are sorted. - - /** - * @brief Determines whether all elements of a sequence exists in a range. - * @param first1 Start of search range. - * @param last1 End of search range. - * @param first2 Start of sequence - * @param last2 End of sequence. - * @return True if each element in [first2,last2) is contained in order - * within [first1,last1). False otherwise. - * @ingroup setoperations - * - * This operation expects both [first1,last1) and [first2,last2) to be - * sorted. Searches for the presence of each element in [first2,last2) - * within [first1,last1). The iterators over each range only move forward, - * so this is a linear algorithm. If an element in [first2,last2) is not - * found before the search iterator reaches @a last2, false is returned. - */ - template<typename _InputIterator1, typename _InputIterator2> - bool - includes(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_requires_sorted(__first1, __last1); - __glibcxx_requires_sorted(__first2, __last2); - - while (__first1 != __last1 && __first2 != __last2) - if (*__first2 < *__first1) - return false; - else if(*__first1 < *__first2) - ++__first1; - else - ++__first1, ++__first2; - - return __first2 == __last2; - } - - /** - * @brief Determines whether all elements of a sequence exists in a range - * using comparison. - * @param first1 Start of search range. - * @param last1 End of search range. - * @param first2 Start of sequence - * @param last2 End of sequence. - * @param comp Comparison function to use. - * @return True if each element in [first2,last2) is contained in order - * within [first1,last1) according to comp. False otherwise. - * @ingroup setoperations - * - * This operation expects both [first1,last1) and [first2,last2) to be - * sorted. Searches for the presence of each element in [first2,last2) - * within [first1,last1), using comp to decide. The iterators over each - * range only move forward, so this is a linear algorithm. If an element - * in [first2,last2) is not found before the search iterator reaches @a - * last2, false is returned. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _Compare> - bool - includes(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_requires_sorted_pred(__first1, __last1, __comp); - __glibcxx_requires_sorted_pred(__first2, __last2, __comp); - - while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first2, *__first1)) - return false; - else if(__comp(*__first1, *__first2)) - ++__first1; - else - ++__first1, ++__first2; - - return __first2 == __last2; - } - - /** - * @brief Return the union of two sorted ranges. - * @param first1 Start of first range. - * @param last1 End of first range. - * @param first2 Start of second range. - * @param last2 End of second range. - * @return End of the output range. - * @ingroup setoperations - * - * This operation iterates over both ranges, copying elements present in - * each range in order to the output range. Iterators increment for each - * range. When the current element of one range is less than the other, - * that element is copied and the iterator advanced. If an element is - * contained in both ranges, the element from the first range is copied and - * both ranges advance. The output range may not overlap either input - * range. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _OutputIterator> - _OutputIterator - set_union(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_requires_sorted(__first1, __last1); - __glibcxx_requires_sorted(__first2, __last2); - - while (__first1 != __last1 && __first2 != __last2) - { - if (*__first1 < *__first2) - { - *__result = *__first1; - ++__first1; - } - else if (*__first2 < *__first1) - { - *__result = *__first2; - ++__first2; - } - else - { - *__result = *__first1; - ++__first1; - ++__first2; - } - ++__result; - } - return std::copy(__first2, __last2, std::copy(__first1, __last1, - __result)); - } - - /** - * @brief Return the union of two sorted ranges using a comparison functor. - * @param first1 Start of first range. - * @param last1 End of first range. - * @param first2 Start of second range. - * @param last2 End of second range. - * @param comp The comparison functor. - * @return End of the output range. - * @ingroup setoperations - * - * This operation iterates over both ranges, copying elements present in - * each range in order to the output range. Iterators increment for each - * range. When the current element of one range is less than the other - * according to @a comp, that element is copied and the iterator advanced. - * If an equivalent element according to @a comp is contained in both - * ranges, the element from the first range is copied and both ranges - * advance. The output range may not overlap either input range. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _OutputIterator, typename _Compare> - _OutputIterator - set_union(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result, _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_requires_sorted_pred(__first1, __last1, __comp); - __glibcxx_requires_sorted_pred(__first2, __last2, __comp); - - while (__first1 != __last1 && __first2 != __last2) - { - if (__comp(*__first1, *__first2)) - { - *__result = *__first1; - ++__first1; - } - else if (__comp(*__first2, *__first1)) - { - *__result = *__first2; - ++__first2; - } - else - { - *__result = *__first1; - ++__first1; - ++__first2; - } - ++__result; - } - return std::copy(__first2, __last2, std::copy(__first1, __last1, - __result)); - } - - /** - * @brief Return the intersection of two sorted ranges. - * @param first1 Start of first range. - * @param last1 End of first range. - * @param first2 Start of second range. - * @param last2 End of second range. - * @return End of the output range. - * @ingroup setoperations - * - * This operation iterates over both ranges, copying elements present in - * both ranges in order to the output range. Iterators increment for each - * range. When the current element of one range is less than the other, - * that iterator advances. If an element is contained in both ranges, the - * element from the first range is copied and both ranges advance. The - * output range may not overlap either input range. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _OutputIterator> - _OutputIterator - set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_requires_sorted(__first1, __last1); - __glibcxx_requires_sorted(__first2, __last2); - - while (__first1 != __last1 && __first2 != __last2) - if (*__first1 < *__first2) - ++__first1; - else if (*__first2 < *__first1) - ++__first2; - else - { - *__result = *__first1; - ++__first1; - ++__first2; - ++__result; - } - return __result; - } - - /** - * @brief Return the intersection of two sorted ranges using comparison - * functor. - * @param first1 Start of first range. - * @param last1 End of first range. - * @param first2 Start of second range. - * @param last2 End of second range. - * @param comp The comparison functor. - * @return End of the output range. - * @ingroup setoperations - * - * This operation iterates over both ranges, copying elements present in - * both ranges in order to the output range. Iterators increment for each - * range. When the current element of one range is less than the other - * according to @a comp, that iterator advances. If an element is - * contained in both ranges according to @a comp, the element from the - * first range is copied and both ranges advance. The output range may not - * overlap either input range. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _OutputIterator, typename _Compare> - _OutputIterator - set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result, _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_requires_sorted_pred(__first1, __last1, __comp); - __glibcxx_requires_sorted_pred(__first2, __last2, __comp); - - while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first1, *__first2)) - ++__first1; - else if (__comp(*__first2, *__first1)) - ++__first2; - else - { - *__result = *__first1; - ++__first1; - ++__first2; - ++__result; - } - return __result; - } - - /** - * @brief Return the difference of two sorted ranges. - * @param first1 Start of first range. - * @param last1 End of first range. - * @param first2 Start of second range. - * @param last2 End of second range. - * @return End of the output range. - * @ingroup setoperations - * - * This operation iterates over both ranges, copying elements present in - * the first range but not the second in order to the output range. - * Iterators increment for each range. When the current element of the - * first range is less than the second, that element is copied and the - * iterator advances. If the current element of the second range is less, - * the iterator advances, but no element is copied. If an element is - * contained in both ranges, no elements are copied and both ranges - * advance. The output range may not overlap either input range. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _OutputIterator> - _OutputIterator - set_difference(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_requires_sorted(__first1, __last1); - __glibcxx_requires_sorted(__first2, __last2); - - while (__first1 != __last1 && __first2 != __last2) - if (*__first1 < *__first2) - { - *__result = *__first1; - ++__first1; - ++__result; - } - else if (*__first2 < *__first1) - ++__first2; - else - { - ++__first1; - ++__first2; - } - return std::copy(__first1, __last1, __result); - } - - /** - * @brief Return the difference of two sorted ranges using comparison - * functor. - * @param first1 Start of first range. - * @param last1 End of first range. - * @param first2 Start of second range. - * @param last2 End of second range. - * @param comp The comparison functor. - * @return End of the output range. - * @ingroup setoperations - * - * This operation iterates over both ranges, copying elements present in - * the first range but not the second in order to the output range. - * Iterators increment for each range. When the current element of the - * first range is less than the second according to @a comp, that element - * is copied and the iterator advances. If the current element of the - * second range is less, no element is copied and the iterator advances. - * If an element is contained in both ranges according to @a comp, no - * elements are copied and both ranges advance. The output range may not - * overlap either input range. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _OutputIterator, typename _Compare> - _OutputIterator - set_difference(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result, _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_requires_sorted_pred(__first1, __last1, __comp); - __glibcxx_requires_sorted_pred(__first2, __last2, __comp); - - while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first1, *__first2)) - { - *__result = *__first1; - ++__first1; - ++__result; - } - else if (__comp(*__first2, *__first1)) - ++__first2; - else - { - ++__first1; - ++__first2; - } - return std::copy(__first1, __last1, __result); - } - - /** - * @brief Return the symmetric difference of two sorted ranges. - * @param first1 Start of first range. - * @param last1 End of first range. - * @param first2 Start of second range. - * @param last2 End of second range. - * @return End of the output range. - * @ingroup setoperations - * - * This operation iterates over both ranges, copying elements present in - * one range but not the other in order to the output range. Iterators - * increment for each range. When the current element of one range is less - * than the other, that element is copied and the iterator advances. If an - * element is contained in both ranges, no elements are copied and both - * ranges advance. The output range may not overlap either input range. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _OutputIterator> - _OutputIterator - set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_requires_sorted(__first1, __last1); - __glibcxx_requires_sorted(__first2, __last2); - - while (__first1 != __last1 && __first2 != __last2) - if (*__first1 < *__first2) - { - *__result = *__first1; - ++__first1; - ++__result; - } - else if (*__first2 < *__first1) - { - *__result = *__first2; - ++__first2; - ++__result; - } - else - { - ++__first1; - ++__first2; - } - return std::copy(__first2, __last2, std::copy(__first1, - __last1, __result)); - } - - /** - * @brief Return the symmetric difference of two sorted ranges using - * comparison functor. - * @param first1 Start of first range. - * @param last1 End of first range. - * @param first2 Start of second range. - * @param last2 End of second range. - * @param comp The comparison functor. - * @return End of the output range. - * @ingroup setoperations - * - * This operation iterates over both ranges, copying elements present in - * one range but not the other in order to the output range. Iterators - * increment for each range. When the current element of one range is less - * than the other according to @a comp, that element is copied and the - * iterator advances. If an element is contained in both ranges according - * to @a comp, no elements are copied and both ranges advance. The output - * range may not overlap either input range. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _OutputIterator, typename _Compare> - _OutputIterator - set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result, - _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_requires_sorted_pred(__first1, __last1, __comp); - __glibcxx_requires_sorted_pred(__first2, __last2, __comp); - - while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first1, *__first2)) - { - *__result = *__first1; - ++__first1; - ++__result; - } - else if (__comp(*__first2, *__first1)) - { - *__result = *__first2; - ++__first2; - ++__result; - } - else - { - ++__first1; - ++__first2; - } - return std::copy(__first2, __last2, std::copy(__first1, - __last1, __result)); - } - - // min_element and max_element, with and without an explicitly supplied - // comparison function. - - /** - * @brief Return the maximum element in a range. - * @param first Start of range. - * @param last End of range. - * @return Iterator referencing the first instance of the largest value. - */ - template<typename _ForwardIterator> - _ForwardIterator - max_element(_ForwardIterator __first, _ForwardIterator __last) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) - return __first; - _ForwardIterator __result = __first; - while (++__first != __last) - if (*__result < *__first) - __result = __first; - return __result; - } - - /** - * @brief Return the maximum element in a range using comparison functor. - * @param first Start of range. - * @param last End of range. - * @param comp Comparison functor. - * @return Iterator referencing the first instance of the largest value - * according to comp. - */ - template<typename _ForwardIterator, typename _Compare> - _ForwardIterator - max_element(_ForwardIterator __first, _ForwardIterator __last, - _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_ForwardIterator>::value_type, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) return __first; - _ForwardIterator __result = __first; - while (++__first != __last) - if (__comp(*__result, *__first)) __result = __first; - return __result; - } - - /** - * @brief Return the minimum element in a range. - * @param first Start of range. - * @param last End of range. - * @return Iterator referencing the first instance of the smallest value. - */ - template<typename _ForwardIterator> - _ForwardIterator - min_element(_ForwardIterator __first, _ForwardIterator __last) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) - return __first; - _ForwardIterator __result = __first; - while (++__first != __last) - if (*__first < *__result) - __result = __first; - return __result; - } - - /** - * @brief Return the minimum element in a range using comparison functor. - * @param first Start of range. - * @param last End of range. - * @param comp Comparison functor. - * @return Iterator referencing the first instance of the smallest value - * according to comp. - */ - template<typename _ForwardIterator, typename _Compare> - _ForwardIterator - min_element(_ForwardIterator __first, _ForwardIterator __last, - _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_ForwardIterator>::value_type, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) - return __first; - _ForwardIterator __result = __first; - while (++__first != __last) - if (__comp(*__first, *__result)) - __result = __first; - return __result; - } - - // next_permutation and prev_permutation, with and without an explicitly - // supplied comparison function. - - /** - * @brief Permute range into the next "dictionary" ordering. - * @param first Start of range. - * @param last End of range. - * @return False if wrapped to first permutation, true otherwise. - * - * Treats all permutations of the range as a set of "dictionary" sorted - * sequences. Permutes the current sequence into the next one of this set. - * Returns true if there are more sequences to generate. If the sequence - * is the largest of the set, the smallest is generated and false returned. - */ - template<typename _BidirectionalIterator> - bool - next_permutation(_BidirectionalIterator __first, - _BidirectionalIterator __last) - { - // concept requirements - __glibcxx_function_requires(_BidirectionalIteratorConcept< - _BidirectionalIterator>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_BidirectionalIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) - return false; - _BidirectionalIterator __i = __first; - ++__i; - if (__i == __last) - return false; - __i = __last; - --__i; - - for(;;) - { - _BidirectionalIterator __ii = __i; - --__i; - if (*__i < *__ii) - { - _BidirectionalIterator __j = __last; - while (!(*__i < *--__j)) - {} - std::iter_swap(__i, __j); - std::reverse(__ii, __last); - return true; - } - if (__i == __first) - { - std::reverse(__first, __last); - return false; - } - } - } - - /** - * @brief Permute range into the next "dictionary" ordering using - * comparison functor. - * @param first Start of range. - * @param last End of range. - * @param comp - * @return False if wrapped to first permutation, true otherwise. - * - * Treats all permutations of the range [first,last) as a set of - * "dictionary" sorted sequences ordered by @a comp. Permutes the current - * sequence into the next one of this set. Returns true if there are more - * sequences to generate. If the sequence is the largest of the set, the - * smallest is generated and false returned. - */ - template<typename _BidirectionalIterator, typename _Compare> - bool - next_permutation(_BidirectionalIterator __first, - _BidirectionalIterator __last, _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_BidirectionalIteratorConcept< - _BidirectionalIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_BidirectionalIterator>::value_type, - typename iterator_traits<_BidirectionalIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) - return false; - _BidirectionalIterator __i = __first; - ++__i; - if (__i == __last) - return false; - __i = __last; - --__i; - - for(;;) - { - _BidirectionalIterator __ii = __i; - --__i; - if (__comp(*__i, *__ii)) - { - _BidirectionalIterator __j = __last; - while (!__comp(*__i, *--__j)) - {} - std::iter_swap(__i, __j); - std::reverse(__ii, __last); - return true; - } - if (__i == __first) - { - std::reverse(__first, __last); - return false; - } - } - } - - /** - * @brief Permute range into the previous "dictionary" ordering. - * @param first Start of range. - * @param last End of range. - * @return False if wrapped to last permutation, true otherwise. - * - * Treats all permutations of the range as a set of "dictionary" sorted - * sequences. Permutes the current sequence into the previous one of this - * set. Returns true if there are more sequences to generate. If the - * sequence is the smallest of the set, the largest is generated and false - * returned. - */ - template<typename _BidirectionalIterator> - bool - prev_permutation(_BidirectionalIterator __first, - _BidirectionalIterator __last) - { - // concept requirements - __glibcxx_function_requires(_BidirectionalIteratorConcept< - _BidirectionalIterator>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_BidirectionalIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) - return false; - _BidirectionalIterator __i = __first; - ++__i; - if (__i == __last) - return false; - __i = __last; - --__i; - - for(;;) - { - _BidirectionalIterator __ii = __i; - --__i; - if (*__ii < *__i) - { - _BidirectionalIterator __j = __last; - while (!(*--__j < *__i)) - {} - std::iter_swap(__i, __j); - std::reverse(__ii, __last); - return true; - } - if (__i == __first) - { - std::reverse(__first, __last); - return false; - } - } - } - - /** - * @brief Permute range into the previous "dictionary" ordering using - * comparison functor. - * @param first Start of range. - * @param last End of range. - * @param comp - * @return False if wrapped to last permutation, true otherwise. - * - * Treats all permutations of the range [first,last) as a set of - * "dictionary" sorted sequences ordered by @a comp. Permutes the current - * sequence into the previous one of this set. Returns true if there are - * more sequences to generate. If the sequence is the smallest of the set, - * the largest is generated and false returned. - */ - template<typename _BidirectionalIterator, typename _Compare> - bool - prev_permutation(_BidirectionalIterator __first, - _BidirectionalIterator __last, _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_BidirectionalIteratorConcept< - _BidirectionalIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_BidirectionalIterator>::value_type, - typename iterator_traits<_BidirectionalIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) - return false; - _BidirectionalIterator __i = __first; - ++__i; - if (__i == __last) - return false; - __i = __last; - --__i; - - for(;;) - { - _BidirectionalIterator __ii = __i; - --__i; - if (__comp(*__ii, *__i)) - { - _BidirectionalIterator __j = __last; - while (!__comp(*--__j, *__i)) - {} - std::iter_swap(__i, __j); - std::reverse(__ii, __last); - return true; - } - if (__i == __first) - { - std::reverse(__first, __last); - return false; - } - } - } - - // find_first_of, with and without an explicitly supplied comparison function. - - /** - * @brief Find element from a set in a sequence. - * @param first1 Start of range to search. - * @param last1 End of range to search. - * @param first2 Start of match candidates. - * @param last2 End of match candidates. - * @return The first iterator @c i in the range - * @p [first1,last1) such that @c *i == @p *(i2) such that i2 is an - * interator in [first2,last2), or @p last1 if no such iterator exists. - * - * Searches the range @p [first1,last1) for an element that is equal to - * some element in the range [first2,last2). If found, returns an iterator - * in the range [first1,last1), otherwise returns @p last1. - */ - template<typename _InputIterator, typename _ForwardIterator> - _InputIterator - find_first_of(_InputIterator __first1, _InputIterator __last1, - _ForwardIterator __first2, _ForwardIterator __last2) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIterator>::value_type, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - __glibcxx_requires_valid_range(__first2, __last2); - - for ( ; __first1 != __last1; ++__first1) - for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter) - if (*__first1 == *__iter) - return __first1; - return __last1; - } - - /** - * @brief Find element from a set in a sequence using a predicate. - * @param first1 Start of range to search. - * @param last1 End of range to search. - * @param first2 Start of match candidates. - * @param last2 End of match candidates. - * @param comp Predicate to use. - * @return The first iterator @c i in the range - * @p [first1,last1) such that @c comp(*i, @p *(i2)) is true and i2 is an - * interator in [first2,last2), or @p last1 if no such iterator exists. - * - * Searches the range @p [first1,last1) for an element that is equal to - * some element in the range [first2,last2). If found, returns an iterator in - * the range [first1,last1), otherwise returns @p last1. - */ - template<typename _InputIterator, typename _ForwardIterator, - typename _BinaryPredicate> - _InputIterator - find_first_of(_InputIterator __first1, _InputIterator __last1, - _ForwardIterator __first2, _ForwardIterator __last2, - _BinaryPredicate __comp) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_InputIterator>::value_type, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - __glibcxx_requires_valid_range(__first2, __last2); - - for ( ; __first1 != __last1; ++__first1) - for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter) - if (__comp(*__first1, *__iter)) - return __first1; - return __last1; - } - - - // find_end, with and without an explicitly supplied comparison function. - // Search [first2, last2) as a subsequence in [first1, last1), and return - // the *last* possible match. Note that find_end for bidirectional iterators - // is much faster than for forward iterators. - - // find_end for forward iterators. - template<typename _ForwardIterator1, typename _ForwardIterator2> - _ForwardIterator1 - __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, - forward_iterator_tag, forward_iterator_tag) - { - if (__first2 == __last2) - return __last1; - else - { - _ForwardIterator1 __result = __last1; - while (1) - { - _ForwardIterator1 __new_result - = std::search(__first1, __last1, __first2, __last2); - if (__new_result == __last1) - return __result; - else - { - __result = __new_result; - __first1 = __new_result; - ++__first1; - } - } - } - } - - template<typename _ForwardIterator1, typename _ForwardIterator2, - typename _BinaryPredicate> - _ForwardIterator1 - __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, - forward_iterator_tag, forward_iterator_tag, - _BinaryPredicate __comp) - { - if (__first2 == __last2) - return __last1; - else - { - _ForwardIterator1 __result = __last1; - while (1) - { - _ForwardIterator1 __new_result - = std::search(__first1, __last1, __first2, __last2, __comp); - if (__new_result == __last1) - return __result; - else - { - __result = __new_result; - __first1 = __new_result; - ++__first1; - } - } - } - } - - // find_end for bidirectional iterators. Requires partial specialization. - template<typename _BidirectionalIterator1, typename _BidirectionalIterator2> - _BidirectionalIterator1 - __find_end(_BidirectionalIterator1 __first1, - _BidirectionalIterator1 __last1, - _BidirectionalIterator2 __first2, - _BidirectionalIterator2 __last2, - bidirectional_iterator_tag, bidirectional_iterator_tag) - { - // concept requirements - __glibcxx_function_requires(_BidirectionalIteratorConcept< - _BidirectionalIterator1>) - __glibcxx_function_requires(_BidirectionalIteratorConcept< - _BidirectionalIterator2>) - - typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1; - typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2; - - _RevIterator1 __rlast1(__first1); - _RevIterator2 __rlast2(__first2); - _RevIterator1 __rresult = std::search(_RevIterator1(__last1), __rlast1, - _RevIterator2(__last2), __rlast2); - - if (__rresult == __rlast1) - return __last1; - else - { - _BidirectionalIterator1 __result = __rresult.base(); - std::advance(__result, -std::distance(__first2, __last2)); - return __result; - } - } - - template<typename _BidirectionalIterator1, typename _BidirectionalIterator2, - typename _BinaryPredicate> - _BidirectionalIterator1 - __find_end(_BidirectionalIterator1 __first1, - _BidirectionalIterator1 __last1, - _BidirectionalIterator2 __first2, - _BidirectionalIterator2 __last2, - bidirectional_iterator_tag, bidirectional_iterator_tag, - _BinaryPredicate __comp) - { - // concept requirements - __glibcxx_function_requires(_BidirectionalIteratorConcept< - _BidirectionalIterator1>) - __glibcxx_function_requires(_BidirectionalIteratorConcept< - _BidirectionalIterator2>) - - typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1; - typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2; - - _RevIterator1 __rlast1(__first1); - _RevIterator2 __rlast2(__first2); - _RevIterator1 __rresult = std::search(_RevIterator1(__last1), __rlast1, - _RevIterator2(__last2), __rlast2, - __comp); - - if (__rresult == __rlast1) - return __last1; - else - { - _BidirectionalIterator1 __result = __rresult.base(); - std::advance(__result, -std::distance(__first2, __last2)); - return __result; - } - } - - // Dispatching functions for find_end. - - /** - * @brief Find last matching subsequence in a sequence. - * @param first1 Start of range to search. - * @param last1 End of range to search. - * @param first2 Start of sequence to match. - * @param last2 End of sequence to match. - * @return The last iterator @c i in the range - * @p [first1,last1-(last2-first2)) such that @c *(i+N) == @p *(first2+N) - * for each @c N in the range @p [0,last2-first2), or @p last1 if no - * such iterator exists. - * - * Searches the range @p [first1,last1) for a sub-sequence that compares - * equal value-by-value with the sequence given by @p [first2,last2) and - * returns an iterator to the first element of the sub-sequence, or - * @p last1 if the sub-sequence is not found. The sub-sequence will be the - * last such subsequence contained in [first,last1). - * - * Because the sub-sequence must lie completely within the range - * @p [first1,last1) it must start at a position less than - * @p last1-(last2-first2) where @p last2-first2 is the length of the - * sub-sequence. - * This means that the returned iterator @c i will be in the range - * @p [first1,last1-(last2-first2)) - */ - template<typename _ForwardIterator1, typename _ForwardIterator2> - inline _ForwardIterator1 - find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>) - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>) - __glibcxx_function_requires(_EqualOpConcept< - typename iterator_traits<_ForwardIterator1>::value_type, - typename iterator_traits<_ForwardIterator2>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - __glibcxx_requires_valid_range(__first2, __last2); - - return std::__find_end(__first1, __last1, __first2, __last2, - std::__iterator_category(__first1), - std::__iterator_category(__first2)); - } - - /** - * @brief Find last matching subsequence in a sequence using a predicate. - * @param first1 Start of range to search. - * @param last1 End of range to search. - * @param first2 Start of sequence to match. - * @param last2 End of sequence to match. - * @param comp The predicate to use. - * @return The last iterator @c i in the range - * @p [first1,last1-(last2-first2)) such that @c predicate(*(i+N), @p - * (first2+N)) is true for each @c N in the range @p [0,last2-first2), or - * @p last1 if no such iterator exists. - * - * Searches the range @p [first1,last1) for a sub-sequence that compares - * equal value-by-value with the sequence given by @p [first2,last2) using - * comp as a predicate and returns an iterator to the first element of the - * sub-sequence, or @p last1 if the sub-sequence is not found. The - * sub-sequence will be the last such subsequence contained in - * [first,last1). - * - * Because the sub-sequence must lie completely within the range - * @p [first1,last1) it must start at a position less than - * @p last1-(last2-first2) where @p last2-first2 is the length of the - * sub-sequence. - * This means that the returned iterator @c i will be in the range - * @p [first1,last1-(last2-first2)) - */ - template<typename _ForwardIterator1, typename _ForwardIterator2, - typename _BinaryPredicate> - inline _ForwardIterator1 - find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, - _BinaryPredicate __comp) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>) - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>) - __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_ForwardIterator1>::value_type, - typename iterator_traits<_ForwardIterator2>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - __glibcxx_requires_valid_range(__first2, __last2); - - return std::__find_end(__first1, __last1, __first2, __last2, - std::__iterator_category(__first1), - std::__iterator_category(__first2), - __comp); - } - -} // namespace std - -#endif /* _ALGO_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algobase.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algobase.h deleted file mode 100644 index d482529bf9e..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algobase.h +++ /dev/null @@ -1,842 +0,0 @@ -// Bits and pieces used in algorithms -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996-1998 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_algobase.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _ALGOBASE_H -#define _ALGOBASE_H 1 - -#include <bits/c++config.h> -#include <cstring> -#include <climits> -#include <cstdlib> -#include <cstddef> -#include <new> -#include <iosfwd> -#include <bits/stl_pair.h> -#include <bits/type_traits.h> -#include <bits/stl_iterator_base_types.h> -#include <bits/stl_iterator_base_funcs.h> -#include <bits/stl_iterator.h> -#include <bits/concept_check.h> -#include <debug/debug.h> - -namespace std -{ - /** - * @brief Swaps the contents of two iterators. - * @param a An iterator. - * @param b Another iterator. - * @return Nothing. - * - * This function swaps the values pointed to by two iterators, not the - * iterators themselves. - */ - template<typename _ForwardIterator1, typename _ForwardIterator2> - inline void - iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b) - { - typedef typename iterator_traits<_ForwardIterator1>::value_type - _ValueType1; - typedef typename iterator_traits<_ForwardIterator2>::value_type - _ValueType2; - - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator1>) - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator2>) - __glibcxx_function_requires(_ConvertibleConcept<_ValueType1, - _ValueType2>) - __glibcxx_function_requires(_ConvertibleConcept<_ValueType2, - _ValueType1>) - - const _ValueType1 __tmp = *__a; - *__a = *__b; - *__b = __tmp; - } - - /** - * @brief Swaps two values. - * @param a A thing of arbitrary type. - * @param b Another thing of arbitrary type. - * @return Nothing. - * - * This is the simple classic generic implementation. It will work on - * any type which has a copy constructor and an assignment operator. - */ - template<typename _Tp> - inline void - swap(_Tp& __a, _Tp& __b) - { - // concept requirements - __glibcxx_function_requires(_SGIAssignableConcept<_Tp>) - - const _Tp __tmp = __a; - __a = __b; - __b = __tmp; - } - - #undef min - #undef max - - /** - * @brief This does what you think it does. - * @param a A thing of arbitrary type. - * @param b Another thing of arbitrary type. - * @return The lesser of the parameters. - * - * This is the simple classic generic implementation. It will work on - * temporary expressions, since they are only evaluated once, unlike a - * preprocessor macro. - */ - template<typename _Tp> - inline const _Tp& - min(const _Tp& __a, const _Tp& __b) - { - // concept requirements - __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) - //return __b < __a ? __b : __a; - if (__b < __a) - return __b; - return __a; - } - - /** - * @brief This does what you think it does. - * @param a A thing of arbitrary type. - * @param b Another thing of arbitrary type. - * @return The greater of the parameters. - * - * This is the simple classic generic implementation. It will work on - * temporary expressions, since they are only evaluated once, unlike a - * preprocessor macro. - */ - template<typename _Tp> - inline const _Tp& - max(const _Tp& __a, const _Tp& __b) - { - // concept requirements - __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) - //return __a < __b ? __b : __a; - if (__a < __b) - return __b; - return __a; - } - - /** - * @brief This does what you think it does. - * @param a A thing of arbitrary type. - * @param b Another thing of arbitrary type. - * @param comp A @link s20_3_3_comparisons comparison functor@endlink. - * @return The lesser of the parameters. - * - * This will work on temporary expressions, since they are only evaluated - * once, unlike a preprocessor macro. - */ - template<typename _Tp, typename _Compare> - inline const _Tp& - min(const _Tp& __a, const _Tp& __b, _Compare __comp) - { - //return __comp(__b, __a) ? __b : __a; - if (__comp(__b, __a)) - return __b; - return __a; - } - - /** - * @brief This does what you think it does. - * @param a A thing of arbitrary type. - * @param b Another thing of arbitrary type. - * @param comp A @link s20_3_3_comparisons comparison functor@endlink. - * @return The greater of the parameters. - * - * This will work on temporary expressions, since they are only evaluated - * once, unlike a preprocessor macro. - */ - template<typename _Tp, typename _Compare> - inline const _Tp& - max(const _Tp& __a, const _Tp& __b, _Compare __comp) - { - //return __comp(__a, __b) ? __b : __a; - if (__comp(__a, __b)) - return __b; - return __a; - } - - // All of these auxiliary functions serve two purposes. (1) Replace - // calls to copy with memmove whenever possible. (Memmove, not memcpy, - // because the input and output ranges are permitted to overlap.) - // (2) If we're using random access iterators, then write the loop as - // a for loop with an explicit count. - - template<typename _InputIterator, typename _OutputIterator> - inline _OutputIterator - __copy(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, input_iterator_tag) - { - for (; __first != __last; ++__result, ++__first) - *__result = *__first; - return __result; - } - - template<typename _RandomAccessIterator, typename _OutputIterator> - inline _OutputIterator - __copy(_RandomAccessIterator __first, _RandomAccessIterator __last, - _OutputIterator __result, random_access_iterator_tag) - { - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _Distance; - for (_Distance __n = __last - __first; __n > 0; --__n) - { - *__result = *__first; - ++__first; - ++__result; - } - return __result; - } - - template<typename _Tp> - inline _Tp* - __copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result) - { - std::memmove(__result, __first, sizeof(_Tp) * (__last - __first)); - return __result + (__last - __first); - } - - template<typename _InputIterator, typename _OutputIterator> - inline _OutputIterator - __copy_aux2(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, __false_type) - { return std::__copy(__first, __last, __result, - std::__iterator_category(__first)); } - - template<typename _InputIterator, typename _OutputIterator> - inline _OutputIterator - __copy_aux2(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, __true_type) - { return std::__copy(__first, __last, __result, - std::__iterator_category(__first)); } - - template<typename _Tp> - inline _Tp* - __copy_aux2(_Tp* __first, _Tp* __last, _Tp* __result, __true_type) - { return std::__copy_trivial(__first, __last, __result); } - - template<typename _Tp> - inline _Tp* - __copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result, - __true_type) - { return std::__copy_trivial(__first, __last, __result); } - - template<typename _InputIterator, typename _OutputIterator> - inline _OutputIterator - __copy_ni2(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, __true_type) - { - typedef typename iterator_traits<_InputIterator>::value_type - _ValueType; - typedef typename __type_traits< - _ValueType>::has_trivial_assignment_operator _Trivial; - return _OutputIterator(std::__copy_aux2(__first, __last, __result.base(), - _Trivial())); - } - - template<typename _InputIterator, typename _OutputIterator> - inline _OutputIterator - __copy_ni2(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, __false_type) - { - typedef typename iterator_traits<_InputIterator>::value_type _ValueType; - typedef typename __type_traits< - _ValueType>::has_trivial_assignment_operator _Trivial; - return std::__copy_aux2(__first, __last, __result, _Trivial()); - } - - template<typename _InputIterator, typename _OutputIterator> - inline _OutputIterator - __copy_ni1(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, __true_type) - { - typedef typename _Is_normal_iterator<_OutputIterator>::_Normal __Normal; - return std::__copy_ni2(__first.base(), __last.base(), - __result, __Normal()); - } - - template<typename _InputIterator, typename _OutputIterator> - inline _OutputIterator - __copy_ni1(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, __false_type) - { - typedef typename _Is_normal_iterator<_OutputIterator>::_Normal __Normal; - return std::__copy_ni2(__first, __last, __result, __Normal()); - } - - /** - * @brief Copies the range [first,last) into result. - * @param first An input iterator. - * @param last An input iterator. - * @param result An output iterator. - * @return result + (first - last) - * - * This inline function will boil down to a call to @c memmove whenever - * possible. Failing that, if random access iterators are passed, then the - * loop count will be known (and therefore a candidate for compiler - * optimizations such as unrolling). Result may not be contained within - * [first,last); the copy_backward function should be used instead. - * - * Note that the end of the output range is permitted to be contained - * within [first,last). - */ - template<typename _InputIterator, typename _OutputIterator> - inline _OutputIterator - copy(_InputIterator __first, _InputIterator __last, - _OutputIterator __result) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - typedef typename _Is_normal_iterator<_InputIterator>::_Normal __Normal; - return std::__copy_ni1(__first, __last, __result, __Normal()); - } - - template<typename _BidirectionalIterator1, typename _BidirectionalIterator2> - inline _BidirectionalIterator2 - __copy_backward(_BidirectionalIterator1 __first, - _BidirectionalIterator1 __last, - _BidirectionalIterator2 __result, - bidirectional_iterator_tag) - { - while (__first != __last) - *--__result = *--__last; - return __result; - } - - template<typename _RandomAccessIterator, typename _BidirectionalIterator> - inline _BidirectionalIterator - __copy_backward(_RandomAccessIterator __first, _RandomAccessIterator __last, - _BidirectionalIterator __result, random_access_iterator_tag) - { - typename iterator_traits<_RandomAccessIterator>::difference_type __n; - for (__n = __last - __first; __n > 0; --__n) - *--__result = *--__last; - return __result; - } - - - // This dispatch class is a workaround for compilers that do not - // have partial ordering of function templates. All we're doing is - // creating a specialization so that we can turn a call to copy_backward - // into a memmove whenever possible. - template<typename _BidirectionalIterator1, typename _BidirectionalIterator2, - typename _BoolType> - struct __copy_backward_dispatch - { - static _BidirectionalIterator2 - copy(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, - _BidirectionalIterator2 __result) - { return std::__copy_backward(__first, __last, __result, - std::__iterator_category(__first)); } - }; - - template<typename _Tp> - struct __copy_backward_dispatch<_Tp*, _Tp*, __true_type> - { - static _Tp* - copy(const _Tp* __first, const _Tp* __last, _Tp* __result) - { - const ptrdiff_t _Num = __last - __first; - std::memmove(__result - _Num, __first, sizeof(_Tp) * _Num); - return __result - _Num; - } - }; - - template<typename _Tp> - struct __copy_backward_dispatch<const _Tp*, _Tp*, __true_type> - { - static _Tp* - copy(const _Tp* __first, const _Tp* __last, _Tp* __result) - { - return std::__copy_backward_dispatch<_Tp*, _Tp*, __true_type> - ::copy(__first, __last, __result); - } - }; - - template<typename _BI1, typename _BI2> - inline _BI2 - __copy_backward_aux(_BI1 __first, _BI1 __last, _BI2 __result) - { - typedef typename __type_traits<typename iterator_traits<_BI2>::value_type> - ::has_trivial_assignment_operator _Trivial; - return - std::__copy_backward_dispatch<_BI1, _BI2, _Trivial>::copy(__first, - __last, - __result); - } - - template <typename _BI1, typename _BI2> - inline _BI2 - __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last, - _BI2 __result, __true_type) - { return _BI2(std::__copy_backward_aux(__first, __last, __result.base())); } - - template <typename _BI1, typename _BI2> - inline _BI2 - __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last, - _BI2 __result, __false_type) - { return std::__copy_backward_aux(__first, __last, __result); } - - template <typename _BI1, typename _BI2> - inline _BI2 - __copy_backward_input_normal_iterator(_BI1 __first, _BI1 __last, - _BI2 __result, __true_type) - { - typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal; - return std::__copy_backward_output_normal_iterator(__first.base(), - __last.base(), - __result, __Normal()); - } - - template <typename _BI1, typename _BI2> - inline _BI2 - __copy_backward_input_normal_iterator(_BI1 __first, _BI1 __last, - _BI2 __result, __false_type) - { - typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal; - return std::__copy_backward_output_normal_iterator(__first, __last, - __result, __Normal()); - } - - /** - * @brief Copies the range [first,last) into result. - * @param first A bidirectional iterator. - * @param last A bidirectional iterator. - * @param result A bidirectional iterator. - * @return result - (first - last) - * - * The function has the same effect as copy, but starts at the end of the - * range and works its way to the start, returning the start of the result. - * This inline function will boil down to a call to @c memmove whenever - * possible. Failing that, if random access iterators are passed, then the - * loop count will be known (and therefore a candidate for compiler - * optimizations such as unrolling). - * - * Result may not be in the range [first,last). Use copy instead. Note - * that the start of the output range may overlap [first,last). - */ - template <typename _BI1, typename _BI2> - inline _BI2 - copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) - { - // concept requirements - __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>) - __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>) - __glibcxx_function_requires(_ConvertibleConcept< - typename iterator_traits<_BI1>::value_type, - typename iterator_traits<_BI2>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - typedef typename _Is_normal_iterator<_BI1>::_Normal __Normal; - return std::__copy_backward_input_normal_iterator(__first, __last, - __result, __Normal()); - } - - - /** - * @brief Fills the range [first,last) with copies of value. - * @param first A forward iterator. - * @param last A forward iterator. - * @param value A reference-to-const of arbitrary type. - * @return Nothing. - * - * This function fills a range with copies of the same value. For one-byte - * types filling contiguous areas of memory, this becomes an inline call to - * @c memset. - */ - template<typename _ForwardIterator, typename _Tp> - void - fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first) - *__first = __value; - } - - /** - * @brief Fills the range [first,first+n) with copies of value. - * @param first An output iterator. - * @param n The count of copies to perform. - * @param value A reference-to-const of arbitrary type. - * @return The iterator at first+n. - * - * This function fills a range with copies of the same value. For one-byte - * types filling contiguous areas of memory, this becomes an inline call to - * @c memset. - */ - template<typename _OutputIterator, typename _Size, typename _Tp> - _OutputIterator - fill_n(_OutputIterator __first, _Size __n, const _Tp& __value) - { - // concept requirements - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,_Tp>) - - for ( ; __n > 0; --__n, ++__first) - *__first = __value; - return __first; - } - - // Specialization: for one-byte types we can use memset. - inline void - fill(unsigned char* __first, unsigned char* __last, const unsigned char& __c) - { - __glibcxx_requires_valid_range(__first, __last); - const unsigned char __tmp = __c; - std::memset(__first, __tmp, __last - __first); - } - - inline void - fill(signed char* __first, signed char* __last, const signed char& __c) - { - __glibcxx_requires_valid_range(__first, __last); - const signed char __tmp = __c; - std::memset(__first, static_cast<unsigned char>(__tmp), __last - __first); - } - - inline void - fill(char* __first, char* __last, const char& __c) - { - __glibcxx_requires_valid_range(__first, __last); - const char __tmp = __c; - std::memset(__first, static_cast<unsigned char>(__tmp), __last - __first); - } - - template<typename _Size> - inline unsigned char* - fill_n(unsigned char* __first, _Size __n, const unsigned char& __c) - { - std::fill(__first, __first + __n, __c); - return __first + __n; - } - - template<typename _Size> - inline signed char* - fill_n(char* __first, _Size __n, const signed char& __c) - { - std::fill(__first, __first + __n, __c); - return __first + __n; - } - - template<typename _Size> - inline char* - fill_n(char* __first, _Size __n, const char& __c) - { - std::fill(__first, __first + __n, __c); - return __first + __n; - } - - - /** - * @brief Finds the places in ranges which don't match. - * @param first1 An input iterator. - * @param last1 An input iterator. - * @param first2 An input iterator. - * @return A pair of iterators pointing to the first mismatch. - * - * This compares the elements of two ranges using @c == and returns a pair - * of iterators. The first iterator points into the first range, the - * second iterator points into the second range, and the elements pointed - * to by the iterators are not equal. - */ - template<typename _InputIterator1, typename _InputIterator2> - pair<_InputIterator1, _InputIterator2> - mismatch(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - - while (__first1 != __last1 && *__first1 == *__first2) - { - ++__first1; - ++__first2; - } - return pair<_InputIterator1, _InputIterator2>(__first1, __first2); - } - - /** - * @brief Finds the places in ranges which don't match. - * @param first1 An input iterator. - * @param last1 An input iterator. - * @param first2 An input iterator. - * @param binary_pred A binary predicate @link s20_3_1_base functor@endlink. - * @return A pair of iterators pointing to the first mismatch. - * - * This compares the elements of two ranges using the binary_pred - * parameter, and returns a pair - * of iterators. The first iterator points into the first range, the - * second iterator points into the second range, and the elements pointed - * to by the iterators are not equal. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _BinaryPredicate> - pair<_InputIterator1, _InputIterator2> - mismatch(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _BinaryPredicate __binary_pred) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_requires_valid_range(__first1, __last1); - - while (__first1 != __last1 && __binary_pred(*__first1, *__first2)) - { - ++__first1; - ++__first2; - } - return pair<_InputIterator1, _InputIterator2>(__first1, __first2); - } - - /** - * @brief Tests a range for element-wise equality. - * @param first1 An input iterator. - * @param last1 An input iterator. - * @param first2 An input iterator. - * @return A boolean true or false. - * - * This compares the elements of two ranges using @c == and returns true or - * false depending on whether all of the corresponding elements of the - * ranges are equal. - */ - template<typename _InputIterator1, typename _InputIterator2> - inline bool - equal(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - - for ( ; __first1 != __last1; ++__first1, ++__first2) - if (!(*__first1 == *__first2)) - return false; - return true; - } - - /** - * @brief Tests a range for element-wise equality. - * @param first1 An input iterator. - * @param last1 An input iterator. - * @param first2 An input iterator. - * @param binary_pred A binary predicate @link s20_3_1_base functor@endlink. - * @return A boolean true or false. - * - * This compares the elements of two ranges using the binary_pred - * parameter, and returns true or - * false depending on whether all of the corresponding elements of the - * ranges are equal. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _BinaryPredicate> - inline bool - equal(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, - _BinaryPredicate __binary_pred) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_requires_valid_range(__first1, __last1); - - for ( ; __first1 != __last1; ++__first1, ++__first2) - if (!__binary_pred(*__first1, *__first2)) - return false; - return true; - } - - /** - * @brief Performs "dictionary" comparison on ranges. - * @param first1 An input iterator. - * @param last1 An input iterator. - * @param first2 An input iterator. - * @param last2 An input iterator. - * @return A boolean true or false. - * - * "Returns true if the sequence of elements defined by the range - * [first1,last1) is lexicographically less than the sequence of elements - * defined by the range [first2,last2). Returns false otherwise." - * (Quoted from [25.3.8]/1.) If the iterators are all character pointers, - * then this is an inline call to @c memcmp. - */ - template<typename _InputIterator1, typename _InputIterator2> - bool - lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_LessThanOpConcept< - typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_function_requires(_LessThanOpConcept< - typename iterator_traits<_InputIterator2>::value_type, - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - __glibcxx_requires_valid_range(__first2, __last2); - - for (;__first1 != __last1 && __first2 != __last2; ++__first1, ++__first2) - { - if (*__first1 < *__first2) - return true; - if (*__first2 < *__first1) - return false; - } - return __first1 == __last1 && __first2 != __last2; - } - - /** - * @brief Performs "dictionary" comparison on ranges. - * @param first1 An input iterator. - * @param last1 An input iterator. - * @param first2 An input iterator. - * @param last2 An input iterator. - * @param comp A @link s20_3_3_comparisons comparison functor@endlink. - * @return A boolean true or false. - * - * The same as the four-parameter @c lexigraphical_compare, but uses the - * comp parameter instead of @c <. - */ - template<typename _InputIterator1, typename _InputIterator2, - typename _Compare> - bool - lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_requires_valid_range(__first1, __last1); - __glibcxx_requires_valid_range(__first2, __last2); - - for ( ; __first1 != __last1 && __first2 != __last2 - ; ++__first1, ++__first2) - { - if (__comp(*__first1, *__first2)) - return true; - if (__comp(*__first2, *__first1)) - return false; - } - return __first1 == __last1 && __first2 != __last2; - } - - inline bool - lexicographical_compare(const unsigned char* __first1, - const unsigned char* __last1, - const unsigned char* __first2, - const unsigned char* __last2) - { - __glibcxx_requires_valid_range(__first1, __last1); - __glibcxx_requires_valid_range(__first2, __last2); - - const size_t __len1 = __last1 - __first1; - const size_t __len2 = __last2 - __first2; - const int __result = std::memcmp(__first1, __first2, - std::min(__len1, __len2)); - return __result != 0 ? __result < 0 : __len1 < __len2; - } - - inline bool - lexicographical_compare(const char* __first1, const char* __last1, - const char* __first2, const char* __last2) - { - __glibcxx_requires_valid_range(__first1, __last1); - __glibcxx_requires_valid_range(__first2, __last2); - -#if CHAR_MAX == SCHAR_MAX - return std::lexicographical_compare((const signed char*) __first1, - (const signed char*) __last1, - (const signed char*) __first2, - (const signed char*) __last2); -#else /* CHAR_MAX == SCHAR_MAX */ - return std::lexicographical_compare((const unsigned char*) __first1, - (const unsigned char*) __last1, - (const unsigned char*) __first2, - (const unsigned char*) __last2); -#endif /* CHAR_MAX == SCHAR_MAX */ - } - -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_bvector.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_bvector.h deleted file mode 100644 index afae738418d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_bvector.h +++ /dev/null @@ -1,876 +0,0 @@ -// vector<bool> specialization -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996-1999 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_bvector.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _BVECTOR_H -#define _BVECTOR_H 1 - -namespace _GLIBCXX_STD -{ - typedef unsigned long _Bit_type; - enum { _S_word_bit = int(CHAR_BIT * sizeof(_Bit_type)) }; - - struct _Bit_reference - { - _Bit_type * _M_p; - _Bit_type _M_mask; - - _Bit_reference(_Bit_type * __x, _Bit_type __y) - : _M_p(__x), _M_mask(__y) { } - - _Bit_reference() : _M_p(0), _M_mask(0) { } - - operator bool() const { return !!(*_M_p & _M_mask); } - - _Bit_reference& - operator=(bool __x) - { - if (__x) - *_M_p |= _M_mask; - else - *_M_p &= ~_M_mask; - return *this; - } - - _Bit_reference& - operator=(const _Bit_reference& __x) - { return *this = bool(__x); } - - bool - operator==(const _Bit_reference& __x) const - { return bool(*this) == bool(__x); } - - bool - operator<(const _Bit_reference& __x) const - { return !bool(*this) && bool(__x); } - - void - flip() { *_M_p ^= _M_mask; } - }; - - struct _Bit_iterator_base : public iterator<random_access_iterator_tag, bool> - { - _Bit_type * _M_p; - unsigned int _M_offset; - - _Bit_iterator_base(_Bit_type * __x, unsigned int __y) - : _M_p(__x), _M_offset(__y) { } - - void - _M_bump_up() - { - if (_M_offset++ == _S_word_bit - 1) - { - _M_offset = 0; - ++_M_p; - } - } - - void - _M_bump_down() - { - if (_M_offset-- == 0) - { - _M_offset = _S_word_bit - 1; - --_M_p; - } - } - - void - _M_incr(ptrdiff_t __i) - { - difference_type __n = __i + _M_offset; - _M_p += __n / _S_word_bit; - __n = __n % _S_word_bit; - if (__n < 0) - { - _M_offset = static_cast<unsigned int>(__n + _S_word_bit); - --_M_p; - } - else - _M_offset = static_cast<unsigned int>(__n); - } - - bool - operator==(const _Bit_iterator_base& __i) const - { return _M_p == __i._M_p && _M_offset == __i._M_offset; } - - bool - operator<(const _Bit_iterator_base& __i) const - { - return _M_p < __i._M_p - || (_M_p == __i._M_p && _M_offset < __i._M_offset); - } - - bool - operator!=(const _Bit_iterator_base& __i) const - { return !(*this == __i); } - - bool - operator>(const _Bit_iterator_base& __i) const - { return __i < *this; } - - bool - operator<=(const _Bit_iterator_base& __i) const - { return !(__i < *this); } - - bool - operator>=(const _Bit_iterator_base& __i) const - { return !(*this < __i); } - }; - - inline ptrdiff_t - operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) - { - return _S_word_bit * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset; - } - - struct _Bit_iterator : public _Bit_iterator_base - { - typedef _Bit_reference reference; - typedef _Bit_reference* pointer; - typedef _Bit_iterator iterator; - - _Bit_iterator() : _Bit_iterator_base(0, 0) { } - _Bit_iterator(_Bit_type * __x, unsigned int __y) - : _Bit_iterator_base(__x, __y) { } - - reference - operator*() const { return reference(_M_p, 1UL << _M_offset); } - - iterator& - operator++() - { - _M_bump_up(); - return *this; - } - - iterator - operator++(int) - { - iterator __tmp = *this; - _M_bump_up(); - return __tmp; - } - - iterator& - operator--() - { - _M_bump_down(); - return *this; - } - - iterator - operator--(int) - { - iterator __tmp = *this; - _M_bump_down(); - return __tmp; - } - - iterator& - operator+=(difference_type __i) - { - _M_incr(__i); - return *this; - } - - iterator& - operator-=(difference_type __i) - { - *this += -__i; - return *this; - } - - iterator - operator+(difference_type __i) const - { - iterator __tmp = *this; - return __tmp += __i; - } - - iterator - operator-(difference_type __i) const - { - iterator __tmp = *this; - return __tmp -= __i; - } - - reference - operator[](difference_type __i) - { return *(*this + __i); } - }; - - inline _Bit_iterator - operator+(ptrdiff_t __n, const _Bit_iterator& __x) { return __x + __n; } - - - struct _Bit_const_iterator : public _Bit_iterator_base - { - typedef bool reference; - typedef bool const_reference; - typedef const bool* pointer; - typedef _Bit_const_iterator const_iterator; - - _Bit_const_iterator() : _Bit_iterator_base(0, 0) { } - _Bit_const_iterator(_Bit_type * __x, unsigned int __y) - : _Bit_iterator_base(__x, __y) { } - _Bit_const_iterator(const _Bit_iterator& __x) - : _Bit_iterator_base(__x._M_p, __x._M_offset) { } - - const_reference - operator*() const - { return _Bit_reference(_M_p, 1UL << _M_offset); } - - const_iterator& - operator++() - { - _M_bump_up(); - return *this; - } - - const_iterator - operator++(int) - { - const_iterator __tmp = *this; - _M_bump_up(); - return __tmp; - } - - const_iterator& - operator--() - { - _M_bump_down(); - return *this; - } - - const_iterator - operator--(int) - { - const_iterator __tmp = *this; - _M_bump_down(); - return __tmp; - } - - const_iterator& - operator+=(difference_type __i) - { - _M_incr(__i); - return *this; - } - - const_iterator& - operator-=(difference_type __i) - { - *this += -__i; - return *this; - } - - const_iterator - operator+(difference_type __i) const { - const_iterator __tmp = *this; - return __tmp += __i; - } - - const_iterator - operator-(difference_type __i) const - { - const_iterator __tmp = *this; - return __tmp -= __i; - } - - const_reference - operator[](difference_type __i) - { return *(*this + __i); } - }; - - inline _Bit_const_iterator - operator+(ptrdiff_t __n, const _Bit_const_iterator& __x) - { return __x + __n; } - - template<class _Alloc> - class _Bvector_base - { - typedef typename _Alloc::template rebind<_Bit_type>::other - _Bit_alloc_type; - - struct _Bvector_impl : public _Bit_alloc_type - { - _Bit_iterator _M_start; - _Bit_iterator _M_finish; - _Bit_type* _M_end_of_storage; - _Bvector_impl(const _Bit_alloc_type& __a) - : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0) - { } - }; - - public: - typedef _Alloc allocator_type; - - allocator_type - get_allocator() const - { return *static_cast<const _Bit_alloc_type*>(&this->_M_impl); } - - _Bvector_base(const allocator_type& __a) : _M_impl(__a) { } - - ~_Bvector_base() { this->_M_deallocate(); } - - protected: - _Bvector_impl _M_impl; - - _Bit_type* - _M_allocate(size_t __n) - { return _M_impl.allocate((__n + _S_word_bit - 1) / _S_word_bit); } - - void - _M_deallocate() - { - if (_M_impl._M_start._M_p) - _M_impl.deallocate(_M_impl._M_start._M_p, - _M_impl._M_end_of_storage - _M_impl._M_start._M_p); - } - }; -} // namespace std - -// Declare a partial specialization of vector<T, Alloc>. -#include <bits/stl_vector.h> - -namespace _GLIBCXX_STD -{ - /** - * @brief A specialization of vector for booleans which offers fixed time - * access to individual elements in any order. - * - * Note that vector<bool> does not actually meet the requirements for being - * a container. This is because the reference and pointer types are not - * really references and pointers to bool. See DR96 for details. @see - * vector for function documentation. - * - * @ingroup Containers - * @ingroup Sequences - * - * In some terminology a %vector can be described as a dynamic - * C-style array, it offers fast and efficient access to individual - * elements in any order and saves the user from worrying about - * memory and size allocation. Subscripting ( @c [] ) access is - * also provided as with C-style arrays. - */ -template<typename _Alloc> - class vector<bool, _Alloc> : public _Bvector_base<_Alloc> - { - public: - typedef bool value_type; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef _Bit_reference reference; - typedef bool const_reference; - typedef _Bit_reference* pointer; - typedef const bool* const_pointer; - - typedef _Bit_iterator iterator; - typedef _Bit_const_iterator const_iterator; - - typedef std::reverse_iterator<const_iterator> const_reverse_iterator; - typedef std::reverse_iterator<iterator> reverse_iterator; - - typedef typename _Bvector_base<_Alloc>::allocator_type allocator_type; - - allocator_type get_allocator() const - { return _Bvector_base<_Alloc>::get_allocator(); } - - protected: - using _Bvector_base<_Alloc>::_M_allocate; - using _Bvector_base<_Alloc>::_M_deallocate; - - protected: - void _M_initialize(size_type __n) - { - _Bit_type* __q = this->_M_allocate(__n); - this->_M_impl._M_end_of_storage = __q - + (__n + _S_word_bit - 1) / _S_word_bit; - this->_M_impl._M_start = iterator(__q, 0); - this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n); - } - - void _M_insert_aux(iterator __position, bool __x) - { - if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage) - { - std::copy_backward(__position, this->_M_impl._M_finish, - this->_M_impl._M_finish + 1); - *__position = __x; - ++this->_M_impl._M_finish; - } - else - { - const size_type __len = size() ? 2 * size() - : static_cast<size_type>(_S_word_bit); - _Bit_type * __q = this->_M_allocate(__len); - iterator __i = std::copy(begin(), __position, iterator(__q, 0)); - *__i++ = __x; - this->_M_impl._M_finish = std::copy(__position, end(), __i); - this->_M_deallocate(); - this->_M_impl._M_end_of_storage = __q + (__len + _S_word_bit - 1) - / _S_word_bit; - this->_M_impl._M_start = iterator(__q, 0); - } - } - - template<class _InputIterator> - void _M_initialize_range(_InputIterator __first, _InputIterator __last, - input_iterator_tag) - { - this->_M_impl._M_start = iterator(); - this->_M_impl._M_finish = iterator(); - this->_M_impl._M_end_of_storage = 0; - for ( ; __first != __last; ++__first) - push_back(*__first); - } - - template<class _ForwardIterator> - void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) - { - const size_type __n = std::distance(__first, __last); - _M_initialize(__n); - std::copy(__first, __last, this->_M_impl._M_start); - } - - template<class _InputIterator> - void _M_insert_range(iterator __pos, _InputIterator __first, - _InputIterator __last, input_iterator_tag) - { - for ( ; __first != __last; ++__first) - { - __pos = insert(__pos, *__first); - ++__pos; - } - } - - template<class _ForwardIterator> - void _M_insert_range(iterator __position, _ForwardIterator __first, - _ForwardIterator __last, forward_iterator_tag) - { - if (__first != __last) - { - size_type __n = std::distance(__first, __last); - if (capacity() - size() >= __n) - { - std::copy_backward(__position, end(), - this->_M_impl._M_finish + difference_type(__n)); - std::copy(__first, __last, __position); - this->_M_impl._M_finish += difference_type(__n); - } - else - { - const size_type __len = size() + std::max(size(), __n); - _Bit_type * __q = this->_M_allocate(__len); - iterator __i = std::copy(begin(), __position, iterator(__q, 0)); - __i = std::copy(__first, __last, __i); - this->_M_impl._M_finish = std::copy(__position, end(), __i); - this->_M_deallocate(); - this->_M_impl._M_end_of_storage = __q + (__len + _S_word_bit - 1) - / _S_word_bit; - this->_M_impl._M_start = iterator(__q, 0); - } - } - } - - public: - iterator begin() - { return this->_M_impl._M_start; } - - const_iterator begin() const - { return this->_M_impl._M_start; } - - iterator end() - { return this->_M_impl._M_finish; } - - const_iterator end() const - { return this->_M_impl._M_finish; } - - reverse_iterator rbegin() - { return reverse_iterator(end()); } - - const_reverse_iterator rbegin() const - { return const_reverse_iterator(end()); } - - reverse_iterator rend() - { return reverse_iterator(begin()); } - - const_reverse_iterator rend() const - { return const_reverse_iterator(begin()); } - - size_type size() const - { return size_type(end() - begin()); } - - size_type max_size() const - { return size_type(-1); } - - size_type capacity() const - { return size_type(const_iterator(this->_M_impl._M_end_of_storage, 0) - - begin()); } - bool empty() const - { return begin() == end(); } - - reference operator[](size_type __n) - { return *(begin() + difference_type(__n)); } - - const_reference operator[](size_type __n) const - { return *(begin() + difference_type(__n)); } - - void _M_range_check(size_type __n) const - { - if (__n >= this->size()) - __throw_out_of_range(__N("vector<bool>::_M_range_check")); - } - - reference at(size_type __n) - { _M_range_check(__n); return (*this)[__n]; } - - const_reference at(size_type __n) const - { _M_range_check(__n); return (*this)[__n]; } - - explicit vector(const allocator_type& __a = allocator_type()) - : _Bvector_base<_Alloc>(__a) { } - - vector(size_type __n, bool __value, - const allocator_type& __a = allocator_type()) - : _Bvector_base<_Alloc>(__a) - { - _M_initialize(__n); - std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage, - __value ? ~0 : 0); - } - - explicit vector(size_type __n) - : _Bvector_base<_Alloc>(allocator_type()) - { - _M_initialize(__n); - std::fill(this->_M_impl._M_start._M_p, - this->_M_impl._M_end_of_storage, 0); - } - - vector(const vector& __x) : _Bvector_base<_Alloc>(__x.get_allocator()) - { - _M_initialize(__x.size()); - std::copy(__x.begin(), __x.end(), this->_M_impl._M_start); - } - - // Check whether it's an integral type. If so, it's not an iterator. - template<class _Integer> - void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) - { - _M_initialize(__n); - std::fill(this->_M_impl._M_start._M_p, - this->_M_impl._M_end_of_storage, __x ? ~0 : 0); - } - - template<class _InputIterator> - void - _M_initialize_dispatch(_InputIterator __first, _InputIterator __last, - __false_type) - { _M_initialize_range(__first, __last, - std::__iterator_category(__first)); } - - template<class _InputIterator> - vector(_InputIterator __first, _InputIterator __last, - const allocator_type& __a = allocator_type()) - : _Bvector_base<_Alloc>(__a) - { - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_initialize_dispatch(__first, __last, _Integral()); - } - - ~vector() { } - - vector& operator=(const vector& __x) - { - if (&__x == this) - return *this; - if (__x.size() > capacity()) - { - this->_M_deallocate(); - _M_initialize(__x.size()); - } - std::copy(__x.begin(), __x.end(), begin()); - this->_M_impl._M_finish = begin() + difference_type(__x.size()); - return *this; - } - - // assign(), a generalized assignment member function. Two - // versions: one that takes a count, and one that takes a range. - // The range version is a member template, so we dispatch on whether - // or not the type is an integer. - - void _M_fill_assign(size_t __n, bool __x) - { - if (__n > size()) - { - std::fill(this->_M_impl._M_start._M_p, - this->_M_impl._M_end_of_storage, __x ? ~0 : 0); - insert(end(), __n - size(), __x); - } - else - { - erase(begin() + __n, end()); - std::fill(this->_M_impl._M_start._M_p, - this->_M_impl._M_end_of_storage, __x ? ~0 : 0); - } - } - - void assign(size_t __n, bool __x) - { _M_fill_assign(__n, __x); } - - template<class _InputIterator> - void assign(_InputIterator __first, _InputIterator __last) - { - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_assign_dispatch(__first, __last, _Integral()); - } - - template<class _Integer> - void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) - { _M_fill_assign((size_t) __n, (bool) __val); } - - template<class _InputIterator> - void _M_assign_dispatch(_InputIterator __first, _InputIterator __last, - __false_type) - { _M_assign_aux(__first, __last, std::__iterator_category(__first)); } - - template<class _InputIterator> - void _M_assign_aux(_InputIterator __first, _InputIterator __last, - input_iterator_tag) - { - iterator __cur = begin(); - for ( ; __first != __last && __cur != end(); ++__cur, ++__first) - *__cur = *__first; - if (__first == __last) - erase(__cur, end()); - else - insert(end(), __first, __last); - } - - template<class _ForwardIterator> - void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) - { - const size_type __len = std::distance(__first, __last); - if (__len < size()) - erase(std::copy(__first, __last, begin()), end()); - else - { - _ForwardIterator __mid = __first; - std::advance(__mid, size()); - std::copy(__first, __mid, begin()); - insert(end(), __mid, __last); - } - } - - void reserve(size_type __n) - { - if (__n > this->max_size()) - __throw_length_error(__N("vector::reserve")); - if (this->capacity() < __n) - { - _Bit_type* __q = this->_M_allocate(__n); - this->_M_impl._M_finish = std::copy(begin(), end(), - iterator(__q, 0)); - this->_M_deallocate(); - this->_M_impl._M_start = iterator(__q, 0); - this->_M_impl._M_end_of_storage = __q + (__n + _S_word_bit - 1) / _S_word_bit; - } - } - - reference front() - { return *begin(); } - - const_reference front() const - { return *begin(); } - - reference back() - { return *(end() - 1); } - - const_reference back() const - { return *(end() - 1); } - - void push_back(bool __x) - { - if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage) - *this->_M_impl._M_finish++ = __x; - else - _M_insert_aux(end(), __x); - } - - void swap(vector<bool, _Alloc>& __x) - { - std::swap(this->_M_impl._M_start, __x._M_impl._M_start); - std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish); - std::swap(this->_M_impl._M_end_of_storage, - __x._M_impl._M_end_of_storage); - } - - // [23.2.5]/1, third-to-last entry in synopsis listing - static void swap(reference __x, reference __y) - { - bool __tmp = __x; - __x = __y; - __y = __tmp; - } - - iterator insert(iterator __position, bool __x = bool()) - { - const difference_type __n = __position - begin(); - if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage - && __position == end()) - *this->_M_impl._M_finish++ = __x; - else - _M_insert_aux(__position, __x); - return begin() + __n; - } - - // Check whether it's an integral type. If so, it's not an iterator. - - template<class _Integer> - void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x, - __true_type) - { _M_fill_insert(__pos, __n, __x); } - - template<class _InputIterator> - void _M_insert_dispatch(iterator __pos, - _InputIterator __first, _InputIterator __last, - __false_type) - { _M_insert_range(__pos, __first, __last, - std::__iterator_category(__first)); } - - template<class _InputIterator> - void insert(iterator __position, - _InputIterator __first, _InputIterator __last) - { - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_insert_dispatch(__position, __first, __last, _Integral()); - } - - void _M_fill_insert(iterator __position, size_type __n, bool __x) - { - if (__n == 0) - return; - if (capacity() - size() >= __n) - { - std::copy_backward(__position, end(), - this->_M_impl._M_finish + difference_type(__n)); - std::fill(__position, __position + difference_type(__n), __x); - this->_M_impl._M_finish += difference_type(__n); - } - else - { - const size_type __len = size() + std::max(size(), __n); - _Bit_type * __q = this->_M_allocate(__len); - iterator __i = std::copy(begin(), __position, iterator(__q, 0)); - std::fill_n(__i, __n, __x); - this->_M_impl._M_finish = std::copy(__position, end(), - __i + difference_type(__n)); - this->_M_deallocate(); - this->_M_impl._M_end_of_storage = __q + (__len + _S_word_bit - 1) - / _S_word_bit; - this->_M_impl._M_start = iterator(__q, 0); - } - } - - void insert(iterator __position, size_type __n, bool __x) - { _M_fill_insert(__position, __n, __x); } - - void pop_back() - { --this->_M_impl._M_finish; } - - iterator erase(iterator __position) - { - if (__position + 1 != end()) - std::copy(__position + 1, end(), __position); - --this->_M_impl._M_finish; - return __position; - } - - iterator erase(iterator __first, iterator __last) - { - this->_M_impl._M_finish = std::copy(__last, end(), __first); - return __first; - } - - void resize(size_type __new_size, bool __x = bool()) - { - if (__new_size < size()) - erase(begin() + difference_type(__new_size), end()); - else - insert(end(), __new_size - size(), __x); - } - - void flip() - { - for (_Bit_type * __p = this->_M_impl._M_start._M_p; - __p != this->_M_impl._M_end_of_storage; ++__p) - *__p = ~*__p; - } - - void clear() - { erase(begin(), end()); } - }; -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_construct.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_construct.h deleted file mode 100644 index afb33879852..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_construct.h +++ /dev/null @@ -1,157 +0,0 @@ -// nonstandard construct and destroy functions -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_construct.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _STL_CONSTRUCT_H -#define _STL_CONSTRUCT_H 1 - -#include <bits/type_traits.h> -#include <new> - -namespace std -{ - /** - * @if maint - * Constructs an object in existing memory by invoking an allocated - * object's constructor with an initializer. - * @endif - */ - template<typename _T1, typename _T2> - inline void - _Construct(_T1* __p, const _T2& __value) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 402. wrong new expression in [some_]allocator::construct - ::new(static_cast<void*>(__p)) _T1(__value); - } - - /** - * @if maint - * Constructs an object in existing memory by invoking an allocated - * object's default constructor (no initializers). - * @endif - */ - template<typename _T1> - inline void - _Construct(_T1* __p) - { - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 402. wrong new expression in [some_]allocator::construct - ::new(static_cast<void*>(__p)) _T1(); - } - - /** - * @if maint - * Destroy the object pointed to by a pointer type. - * @endif - */ - template<typename _Tp> - inline void - _Destroy(_Tp* __pointer) - { __pointer->~_Tp(); } - - /** - * @if maint - * Destroy a range of objects with nontrivial destructors. - * - * This is a helper function used only by _Destroy(). - * @endif - */ - template<typename _ForwardIterator> - inline void - __destroy_aux(_ForwardIterator __first, _ForwardIterator __last, - __false_type) - { for ( ; __first != __last; ++__first) std::_Destroy(&*__first); } - - /** - * @if maint - * Destroy a range of objects with trivial destructors. Since the destructors - * are trivial, there's nothing to do and hopefully this function will be - * entirely optimized away. - * - * This is a helper function used only by _Destroy(). - * @endif - */ - template<typename _ForwardIterator> - inline void - __destroy_aux(_ForwardIterator, _ForwardIterator, __true_type) - { } - - /** - * @if maint - * Destroy a range of objects. If the value_type of the object has - * a trivial destructor, the compiler should optimize all of this - * away, otherwise the objects' destructors must be invoked. - * @endif - */ - template<typename _ForwardIterator> - inline void - _Destroy(_ForwardIterator __first, _ForwardIterator __last) - { - typedef typename iterator_traits<_ForwardIterator>::value_type - _Value_type; - typedef typename __type_traits<_Value_type>::has_trivial_destructor - _Has_trivial_destructor; - - std::__destroy_aux(__first, __last, _Has_trivial_destructor()); - } -} // namespace std - -#endif /* _STL_CONSTRUCT_H */ - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_deque.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_deque.h deleted file mode 100644 index 54dadf2c659..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_deque.h +++ /dev/null @@ -1,1501 +0,0 @@ -// Deque implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_deque.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _DEQUE_H -#define _DEQUE_H 1 - -#include <bits/concept_check.h> -#include <bits/stl_iterator_base_types.h> -#include <bits/stl_iterator_base_funcs.h> - -namespace _GLIBCXX_STD -{ - /** - * @if maint - * @brief This function controls the size of memory nodes. - * @param size The size of an element. - * @return The number (not byte size) of elements per node. - * - * This function started off as a compiler kludge from SGI, but seems to - * be a useful wrapper around a repeated constant expression. The '512' is - * tuneable (and no other code needs to change), but no investigation has - * been done since inheriting the SGI code. - * @endif - */ - inline size_t - __deque_buf_size(size_t __size) - { return __size < 512 ? size_t(512 / __size) : size_t(1); } - - - /** - * @brief A deque::iterator. - * - * Quite a bit of intelligence here. Much of the functionality of deque is - * actually passed off to this class. A deque holds two of these internally, - * marking its valid range. Access to elements is done as offsets of either - * of those two, relying on operator overloading in this class. - * - * @if maint - * All the functions are op overloads except for _M_set_node. - * @endif - */ - template<typename _Tp, typename _Ref, typename _Ptr> - struct _Deque_iterator - { - typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator; - typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator; - - static size_t _S_buffer_size() - { return __deque_buf_size(sizeof(_Tp)); } - - typedef random_access_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Ptr pointer; - typedef _Ref reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef _Tp** _Map_pointer; - typedef _Deque_iterator _Self; - - _Tp* _M_cur; - _Tp* _M_first; - _Tp* _M_last; - _Map_pointer _M_node; - - _Deque_iterator(_Tp* __x, _Map_pointer __y) - : _M_cur(__x), _M_first(*__y), - _M_last(*__y + _S_buffer_size()), _M_node(__y) {} - - _Deque_iterator() : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {} - - _Deque_iterator(const iterator& __x) - : _M_cur(__x._M_cur), _M_first(__x._M_first), - _M_last(__x._M_last), _M_node(__x._M_node) {} - - reference - operator*() const - { return *_M_cur; } - - pointer - operator->() const - { return _M_cur; } - - _Self& - operator++() - { - ++_M_cur; - if (_M_cur == _M_last) - { - _M_set_node(_M_node + 1); - _M_cur = _M_first; - } - return *this; - } - - _Self - operator++(int) - { - _Self __tmp = *this; - ++*this; - return __tmp; - } - - _Self& - operator--() - { - if (_M_cur == _M_first) - { - _M_set_node(_M_node - 1); - _M_cur = _M_last; - } - --_M_cur; - return *this; - } - - _Self - operator--(int) - { - _Self __tmp = *this; - --*this; - return __tmp; - } - - _Self& - operator+=(difference_type __n) - { - const difference_type __offset = __n + (_M_cur - _M_first); - if (__offset >= 0 && __offset < difference_type(_S_buffer_size())) - _M_cur += __n; - else - { - const difference_type __node_offset = - __offset > 0 ? __offset / difference_type(_S_buffer_size()) - : -difference_type((-__offset - 1) - / _S_buffer_size()) - 1; - _M_set_node(_M_node + __node_offset); - _M_cur = _M_first + (__offset - __node_offset - * difference_type(_S_buffer_size())); - } - return *this; - } - - _Self - operator+(difference_type __n) const - { - _Self __tmp = *this; - return __tmp += __n; - } - - _Self& - operator-=(difference_type __n) - { return *this += -__n; } - - _Self - operator-(difference_type __n) const - { - _Self __tmp = *this; - return __tmp -= __n; - } - - reference - operator[](difference_type __n) const - { return *(*this + __n); } - - /** @if maint - * Prepares to traverse new_node. Sets everything except _M_cur, which - * should therefore be set by the caller immediately afterwards, based on - * _M_first and _M_last. - * @endif - */ - void - _M_set_node(_Map_pointer __new_node) - { - _M_node = __new_node; - _M_first = *__new_node; - _M_last = _M_first + difference_type(_S_buffer_size()); - } - }; - - // Note: we also provide overloads whose operands are of the same type in - // order to avoid ambiguous overload resolution when std::rel_ops operators - // are in scope (for additional details, see libstdc++/3628) - template<typename _Tp, typename _Ref, typename _Ptr> - inline bool - operator==(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, - const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) - { return __x._M_cur == __y._M_cur; } - - template<typename _Tp, typename _RefL, typename _PtrL, - typename _RefR, typename _PtrR> - inline bool - operator==(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, - const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) - { return __x._M_cur == __y._M_cur; } - - template<typename _Tp, typename _Ref, typename _Ptr> - inline bool - operator!=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, - const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) - { return !(__x == __y); } - - template<typename _Tp, typename _RefL, typename _PtrL, - typename _RefR, typename _PtrR> - inline bool - operator!=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, - const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) - { return !(__x == __y); } - - template<typename _Tp, typename _Ref, typename _Ptr> - inline bool - operator<(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, - const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) - { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur) - : (__x._M_node < __y._M_node); } - - template<typename _Tp, typename _RefL, typename _PtrL, - typename _RefR, typename _PtrR> - inline bool - operator<(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, - const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) - { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur) - : (__x._M_node < __y._M_node); } - - template<typename _Tp, typename _Ref, typename _Ptr> - inline bool - operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, - const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) - { return __y < __x; } - - template<typename _Tp, typename _RefL, typename _PtrL, - typename _RefR, typename _PtrR> - inline bool - operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, - const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) - { return __y < __x; } - - template<typename _Tp, typename _Ref, typename _Ptr> - inline bool - operator<=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, - const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) - { return !(__y < __x); } - - template<typename _Tp, typename _RefL, typename _PtrL, - typename _RefR, typename _PtrR> - inline bool - operator<=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, - const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) - { return !(__y < __x); } - - template<typename _Tp, typename _Ref, typename _Ptr> - inline bool - operator>=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, - const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) - { return !(__x < __y); } - - template<typename _Tp, typename _RefL, typename _PtrL, - typename _RefR, typename _PtrR> - inline bool - operator>=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, - const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) - { return !(__x < __y); } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // According to the resolution of DR179 not only the various comparison - // operators but also operator- must accept mixed iterator/const_iterator - // parameters. - template<typename _Tp, typename _RefL, typename _PtrL, - typename _RefR, typename _PtrR> - inline typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type - operator-(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, - const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) - { - return typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type - (_Deque_iterator<_Tp, _RefL, _PtrL>::_S_buffer_size()) - * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first) - + (__y._M_last - __y._M_cur); - } - - template<typename _Tp, typename _Ref, typename _Ptr> - inline _Deque_iterator<_Tp, _Ref, _Ptr> - operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x) - { return __x + __n; } - - /** - * @if maint - * Deque base class. This class provides the unified face for %deque's - * allocation. This class's constructor and destructor allocate and - * deallocate (but do not initialize) storage. This makes %exception - * safety easier. - * - * Nothing in this class ever constructs or destroys an actual Tp element. - * (Deque handles that itself.) Only/All memory management is performed - * here. - * @endif - */ - template<typename _Tp, typename _Alloc> - class _Deque_base - { - public: - typedef _Alloc allocator_type; - - allocator_type - get_allocator() const - { return *static_cast<const _Alloc*>(&this->_M_impl); } - - typedef _Deque_iterator<_Tp,_Tp&,_Tp*> iterator; - typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*> const_iterator; - - _Deque_base(const allocator_type& __a, size_t __num_elements) - : _M_impl(__a) - { _M_initialize_map(__num_elements); } - - _Deque_base(const allocator_type& __a) - : _M_impl(__a) - { } - - ~_Deque_base(); - - protected: - //This struct encapsulates the implementation of the std::deque - //standard container and at the same time makes use of the EBO - //for empty allocators. - struct _Deque_impl - : public _Alloc { - _Tp** _M_map; - size_t _M_map_size; - iterator _M_start; - iterator _M_finish; - - _Deque_impl(const _Alloc& __a) - : _Alloc(__a), _M_map(0), _M_map_size(0), _M_start(), _M_finish() - { } - }; - - typedef typename _Alloc::template rebind<_Tp*>::other _Map_alloc_type; - _Map_alloc_type _M_get_map_allocator() const - { return _Map_alloc_type(this->get_allocator()); } - - _Tp* - _M_allocate_node() - { return _M_impl._Alloc::allocate(__deque_buf_size(sizeof(_Tp))); } - - void - _M_deallocate_node(_Tp* __p) - { _M_impl._Alloc::deallocate(__p, __deque_buf_size(sizeof(_Tp))); } - - _Tp** - _M_allocate_map(size_t __n) - { return _M_get_map_allocator().allocate(__n); } - - void - _M_deallocate_map(_Tp** __p, size_t __n) - { _M_get_map_allocator().deallocate(__p, __n); } - - protected: - void _M_initialize_map(size_t); - void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish); - void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish); - enum { _S_initial_map_size = 8 }; - - _Deque_impl _M_impl; - }; - - template<typename _Tp, typename _Alloc> - _Deque_base<_Tp,_Alloc>::~_Deque_base() - { - if (this->_M_impl._M_map) - { - _M_destroy_nodes(this->_M_impl._M_start._M_node, this->_M_impl._M_finish._M_node + 1); - _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size); - } - } - - /** - * @if maint - * @brief Layout storage. - * @param num_elements The count of T's for which to allocate space - * at first. - * @return Nothing. - * - * The initial underlying memory layout is a bit complicated... - * @endif - */ - template<typename _Tp, typename _Alloc> - void - _Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t __num_elements) - { - size_t __num_nodes = __num_elements / __deque_buf_size(sizeof(_Tp)) + 1; - - this->_M_impl._M_map_size = std::max((size_t) _S_initial_map_size, - __num_nodes + 2); - this->_M_impl._M_map = _M_allocate_map(this->_M_impl._M_map_size); - - // For "small" maps (needing less than _M_map_size nodes), allocation - // starts in the middle elements and grows outwards. So nstart may be - // the beginning of _M_map, but for small maps it may be as far in as - // _M_map+3. - - _Tp** __nstart = this->_M_impl._M_map + (this->_M_impl._M_map_size - __num_nodes) / 2; - _Tp** __nfinish = __nstart + __num_nodes; - - try - { _M_create_nodes(__nstart, __nfinish); } - catch(...) - { - _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size); - this->_M_impl._M_map = 0; - this->_M_impl._M_map_size = 0; - __throw_exception_again; - } - - this->_M_impl._M_start._M_set_node(__nstart); - this->_M_impl._M_finish._M_set_node(__nfinish - 1); - this->_M_impl._M_start._M_cur = _M_impl._M_start._M_first; - this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first + __num_elements - % __deque_buf_size(sizeof(_Tp)); - } - - template<typename _Tp, typename _Alloc> - void - _Deque_base<_Tp,_Alloc>::_M_create_nodes(_Tp** __nstart, _Tp** __nfinish) - { - _Tp** __cur; - try - { - for (__cur = __nstart; __cur < __nfinish; ++__cur) - *__cur = this->_M_allocate_node(); - } - catch(...) - { - _M_destroy_nodes(__nstart, __cur); - __throw_exception_again; - } - } - - template<typename _Tp, typename _Alloc> - void - _Deque_base<_Tp,_Alloc>::_M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish) - { - for (_Tp** __n = __nstart; __n < __nfinish; ++__n) - _M_deallocate_node(*__n); - } - - /** - * @brief A standard container using fixed-size memory allocation and - * constant-time manipulation of elements at either end. - * - * @ingroup Containers - * @ingroup Sequences - * - * Meets the requirements of a <a href="tables.html#65">container</a>, a - * <a href="tables.html#66">reversible container</a>, and a - * <a href="tables.html#67">sequence</a>, including the - * <a href="tables.html#68">optional sequence requirements</a>. - * - * In previous HP/SGI versions of deque, there was an extra template - * parameter so users could control the node size. This extension turned - * out to violate the C++ standard (it can be detected using template - * template parameters), and it was removed. - * - * @if maint - * Here's how a deque<Tp> manages memory. Each deque has 4 members: - * - * - Tp** _M_map - * - size_t _M_map_size - * - iterator _M_start, _M_finish - * - * map_size is at least 8. %map is an array of map_size pointers-to-"nodes". - * (The name %map has nothing to do with the std::map class, and "nodes" - * should not be confused with std::list's usage of "node".) - * - * A "node" has no specific type name as such, but it is referred to as - * "node" in this file. It is a simple array-of-Tp. If Tp is very large, - * there will be one Tp element per node (i.e., an "array" of one). - * For non-huge Tp's, node size is inversely related to Tp size: the - * larger the Tp, the fewer Tp's will fit in a node. The goal here is to - * keep the total size of a node relatively small and constant over different - * Tp's, to improve allocator efficiency. - * - * **** As I write this, the nodes are /not/ allocated using the high-speed - * memory pool. There are 20 hours left in the year; perhaps I can fix - * this before 2002. - * - * Not every pointer in the %map array will point to a node. If the initial - * number of elements in the deque is small, the /middle/ %map pointers will - * be valid, and the ones at the edges will be unused. This same situation - * will arise as the %map grows: available %map pointers, if any, will be on - * the ends. As new nodes are created, only a subset of the %map's pointers - * need to be copied "outward". - * - * Class invariants: - * - For any nonsingular iterator i: - * - i.node points to a member of the %map array. (Yes, you read that - * correctly: i.node does not actually point to a node.) The member of - * the %map array is what actually points to the node. - * - i.first == *(i.node) (This points to the node (first Tp element).) - * - i.last == i.first + node_size - * - i.cur is a pointer in the range [i.first, i.last). NOTE: - * the implication of this is that i.cur is always a dereferenceable - * pointer, even if i is a past-the-end iterator. - * - Start and Finish are always nonsingular iterators. NOTE: this means that - * an empty deque must have one node, a deque with <N elements (where N is - * the node buffer size) must have one node, a deque with N through (2N-1) - * elements must have two nodes, etc. - * - For every node other than start.node and finish.node, every element in - * the node is an initialized object. If start.node == finish.node, then - * [start.cur, finish.cur) are initialized objects, and the elements outside - * that range are uninitialized storage. Otherwise, [start.cur, start.last) - * and [finish.first, finish.cur) are initialized objects, and [start.first, - * start.cur) and [finish.cur, finish.last) are uninitialized storage. - * - [%map, %map + map_size) is a valid, non-empty range. - * - [start.node, finish.node] is a valid range contained within - * [%map, %map + map_size). - * - A pointer in the range [%map, %map + map_size) points to an allocated - * node if and only if the pointer is in the range - * [start.node, finish.node]. - * - * Here's the magic: nothing in deque is "aware" of the discontiguous - * storage! - * - * The memory setup and layout occurs in the parent, _Base, and the iterator - * class is entirely responsible for "leaping" from one node to the next. - * All the implementation routines for deque itself work only through the - * start and finish iterators. This keeps the routines simple and sane, - * and we can use other standard algorithms as well. - * @endif - */ - template<typename _Tp, typename _Alloc = allocator<_Tp> > - class deque : protected _Deque_base<_Tp, _Alloc> - { - // concept requirements - __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - - typedef _Deque_base<_Tp, _Alloc> _Base; - - public: - typedef _Tp value_type; - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - typedef typename _Base::iterator iterator; - typedef typename _Base::const_iterator const_iterator; - typedef std::reverse_iterator<const_iterator> const_reverse_iterator; - typedef std::reverse_iterator<iterator> reverse_iterator; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef typename _Base::allocator_type allocator_type; - - protected: - typedef pointer* _Map_pointer; - - static size_t _S_buffer_size() - { return __deque_buf_size(sizeof(_Tp)); } - - // Functions controlling memory layout, and nothing else. - using _Base::_M_initialize_map; - using _Base::_M_create_nodes; - using _Base::_M_destroy_nodes; - using _Base::_M_allocate_node; - using _Base::_M_deallocate_node; - using _Base::_M_allocate_map; - using _Base::_M_deallocate_map; - - /** @if maint - * A total of four data members accumulated down the heirarchy. - * May be accessed via _M_impl.* - * @endif - */ - using _Base::_M_impl; - - public: - // [23.2.1.1] construct/copy/destroy - // (assign() and get_allocator() are also listed in this section) - /** - * @brief Default constructor creates no elements. - */ - explicit - deque(const allocator_type& __a = allocator_type()) - : _Base(__a, 0) {} - - /** - * @brief Create a %deque with copies of an exemplar element. - * @param n The number of elements to initially create. - * @param value An element to copy. - * - * This constructor fills the %deque with @a n copies of @a value. - */ - deque(size_type __n, const value_type& __value, - const allocator_type& __a = allocator_type()) - : _Base(__a, __n) - { _M_fill_initialize(__value); } - - /** - * @brief Create a %deque with default elements. - * @param n The number of elements to initially create. - * - * This constructor fills the %deque with @a n copies of a - * default-constructed element. - */ - explicit - deque(size_type __n) - : _Base(allocator_type(), __n) - { _M_fill_initialize(value_type()); } - - /** - * @brief %Deque copy constructor. - * @param x A %deque of identical element and allocator types. - * - * The newly-created %deque uses a copy of the allocation object used - * by @a x. - */ - deque(const deque& __x) - : _Base(__x.get_allocator(), __x.size()) - { std::uninitialized_copy(__x.begin(), __x.end(), this->_M_impl._M_start); } - - /** - * @brief Builds a %deque from a range. - * @param first An input iterator. - * @param last An input iterator. - * - * Create a %deque consisting of copies of the elements from [first, - * last). - * - * If the iterators are forward, bidirectional, or random-access, then - * this will call the elements' copy constructor N times (where N is - * distance(first,last)) and do no memory reallocation. But if only - * input iterators are used, then this will do at most 2N calls to the - * copy constructor, and logN memory reallocations. - */ - template<typename _InputIterator> - deque(_InputIterator __first, _InputIterator __last, - const allocator_type& __a = allocator_type()) - : _Base(__a) - { - // Check whether it's an integral type. If so, it's not an iterator. - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_initialize_dispatch(__first, __last, _Integral()); - } - - /** - * The dtor only erases the elements, and note that if the elements - * themselves are pointers, the pointed-to memory is not touched in any - * way. Managing the pointer is the user's responsibilty. - */ - ~deque() - { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish); } - - /** - * @brief %Deque assignment operator. - * @param x A %deque of identical element and allocator types. - * - * All the elements of @a x are copied, but unlike the copy constructor, - * the allocator object is not copied. - */ - deque& - operator=(const deque& __x); - - /** - * @brief Assigns a given value to a %deque. - * @param n Number of elements to be assigned. - * @param val Value to be assigned. - * - * This function fills a %deque with @a n copies of the given value. - * Note that the assignment completely changes the %deque and that the - * resulting %deque's size is the same as the number of elements assigned. - * Old data may be lost. - */ - void - assign(size_type __n, const value_type& __val) - { _M_fill_assign(__n, __val); } - - /** - * @brief Assigns a range to a %deque. - * @param first An input iterator. - * @param last An input iterator. - * - * This function fills a %deque with copies of the elements in the - * range [first,last). - * - * Note that the assignment completely changes the %deque and that the - * resulting %deque's size is the same as the number of elements - * assigned. Old data may be lost. - */ - template<typename _InputIterator> - void - assign(_InputIterator __first, _InputIterator __last) - { - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_assign_dispatch(__first, __last, _Integral()); - } - - /// Get a copy of the memory allocation object. - allocator_type - get_allocator() const - { return _Base::get_allocator(); } - - // iterators - /** - * Returns a read/write iterator that points to the first element in the - * %deque. Iteration is done in ordinary element order. - */ - iterator - begin() - { return this->_M_impl._M_start; } - - /** - * Returns a read-only (constant) iterator that points to the first - * element in the %deque. Iteration is done in ordinary element order. - */ - const_iterator - begin() const - { return this->_M_impl._M_start; } - - /** - * Returns a read/write iterator that points one past the last element in - * the %deque. Iteration is done in ordinary element order. - */ - iterator - end() - { return this->_M_impl._M_finish; } - - /** - * Returns a read-only (constant) iterator that points one past the last - * element in the %deque. Iteration is done in ordinary element order. - */ - const_iterator - end() const - { return this->_M_impl._M_finish; } - - /** - * Returns a read/write reverse iterator that points to the last element - * in the %deque. Iteration is done in reverse element order. - */ - reverse_iterator - rbegin() - { return reverse_iterator(this->_M_impl._M_finish); } - - /** - * Returns a read-only (constant) reverse iterator that points to the - * last element in the %deque. Iteration is done in reverse element - * order. - */ - const_reverse_iterator - rbegin() const - { return const_reverse_iterator(this->_M_impl._M_finish); } - - /** - * Returns a read/write reverse iterator that points to one before the - * first element in the %deque. Iteration is done in reverse element - * order. - */ - reverse_iterator - rend() { return reverse_iterator(this->_M_impl._M_start); } - - /** - * Returns a read-only (constant) reverse iterator that points to one - * before the first element in the %deque. Iteration is done in reverse - * element order. - */ - const_reverse_iterator - rend() const - { return const_reverse_iterator(this->_M_impl._M_start); } - - // [23.2.1.2] capacity - /** Returns the number of elements in the %deque. */ - size_type - size() const - { return this->_M_impl._M_finish - this->_M_impl._M_start; } - - /** Returns the size() of the largest possible %deque. */ - size_type - max_size() const - { return size_type(-1); } - - /** - * @brief Resizes the %deque to the specified number of elements. - * @param new_size Number of elements the %deque should contain. - * @param x Data with which new elements should be populated. - * - * This function will %resize the %deque to the specified number of - * elements. If the number is smaller than the %deque's current size the - * %deque is truncated, otherwise the %deque is extended and new elements - * are populated with given data. - */ - void - resize(size_type __new_size, const value_type& __x) - { - const size_type __len = size(); - if (__new_size < __len) - erase(this->_M_impl._M_start + __new_size, this->_M_impl._M_finish); - else - insert(this->_M_impl._M_finish, __new_size - __len, __x); - } - - /** - * @brief Resizes the %deque to the specified number of elements. - * @param new_size Number of elements the %deque should contain. - * - * This function will resize the %deque to the specified number of - * elements. If the number is smaller than the %deque's current size the - * %deque is truncated, otherwise the %deque is extended and new elements - * are default-constructed. - */ - void - resize(size_type new_size) - { resize(new_size, value_type()); } - - /** - * Returns true if the %deque is empty. (Thus begin() would equal end().) - */ - bool - empty() const - { return this->_M_impl._M_finish == this->_M_impl._M_start; } - - // element access - /** - * @brief Subscript access to the data contained in the %deque. - * @param n The index of the element for which data should be accessed. - * @return Read/write reference to data. - * - * This operator allows for easy, array-style, data access. - * Note that data access with this operator is unchecked and out_of_range - * lookups are not defined. (For checked lookups see at().) - */ - reference - operator[](size_type __n) - { return this->_M_impl._M_start[difference_type(__n)]; } - - /** - * @brief Subscript access to the data contained in the %deque. - * @param n The index of the element for which data should be accessed. - * @return Read-only (constant) reference to data. - * - * This operator allows for easy, array-style, data access. - * Note that data access with this operator is unchecked and out_of_range - * lookups are not defined. (For checked lookups see at().) - */ - const_reference - operator[](size_type __n) const - { return this->_M_impl._M_start[difference_type(__n)]; } - - protected: - /// @if maint Safety check used only from at(). @endif - void - _M_range_check(size_type __n) const - { - if (__n >= this->size()) - __throw_out_of_range(__N("deque::_M_range_check")); - } - - public: - /** - * @brief Provides access to the data contained in the %deque. - * @param n The index of the element for which data should be accessed. - * @return Read/write reference to data. - * @throw std::out_of_range If @a n is an invalid index. - * - * This function provides for safer data access. The parameter is first - * checked that it is in the range of the deque. The function throws - * out_of_range if the check fails. - */ - reference - at(size_type __n) - { _M_range_check(__n); return (*this)[__n]; } - - /** - * @brief Provides access to the data contained in the %deque. - * @param n The index of the element for which data should be accessed. - * @return Read-only (constant) reference to data. - * @throw std::out_of_range If @a n is an invalid index. - * - * This function provides for safer data access. The parameter is first - * checked that it is in the range of the deque. The function throws - * out_of_range if the check fails. - */ - const_reference - at(size_type __n) const - { - _M_range_check(__n); - return (*this)[__n]; - } - - /** - * Returns a read/write reference to the data at the first element of the - * %deque. - */ - reference - front() - { return *this->_M_impl._M_start; } - - /** - * Returns a read-only (constant) reference to the data at the first - * element of the %deque. - */ - const_reference - front() const - { return *this->_M_impl._M_start; } - - /** - * Returns a read/write reference to the data at the last element of the - * %deque. - */ - reference - back() - { - iterator __tmp = this->_M_impl._M_finish; - --__tmp; - return *__tmp; - } - - /** - * Returns a read-only (constant) reference to the data at the last - * element of the %deque. - */ - const_reference - back() const - { - const_iterator __tmp = this->_M_impl._M_finish; - --__tmp; - return *__tmp; - } - - // [23.2.1.2] modifiers - /** - * @brief Add data to the front of the %deque. - * @param x Data to be added. - * - * This is a typical stack operation. The function creates an element at - * the front of the %deque and assigns the given data to it. Due to the - * nature of a %deque this operation can be done in constant time. - */ - void - push_front(const value_type& __x) - { - if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first) - { - std::_Construct(this->_M_impl._M_start._M_cur - 1, __x); - --this->_M_impl._M_start._M_cur; - } - else - _M_push_front_aux(__x); - } - - /** - * @brief Add data to the end of the %deque. - * @param x Data to be added. - * - * This is a typical stack operation. The function creates an element at - * the end of the %deque and assigns the given data to it. Due to the - * nature of a %deque this operation can be done in constant time. - */ - void - push_back(const value_type& __x) - { - if (this->_M_impl._M_finish._M_cur != this->_M_impl._M_finish._M_last - 1) - { - std::_Construct(this->_M_impl._M_finish._M_cur, __x); - ++this->_M_impl._M_finish._M_cur; - } - else - _M_push_back_aux(__x); - } - - /** - * @brief Removes first element. - * - * This is a typical stack operation. It shrinks the %deque by one. - * - * Note that no data is returned, and if the first element's data is - * needed, it should be retrieved before pop_front() is called. - */ - void - pop_front() - { - if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_last - 1) - { - std::_Destroy(this->_M_impl._M_start._M_cur); - ++this->_M_impl._M_start._M_cur; - } - else - _M_pop_front_aux(); - } - - /** - * @brief Removes last element. - * - * This is a typical stack operation. It shrinks the %deque by one. - * - * Note that no data is returned, and if the last element's data is - * needed, it should be retrieved before pop_back() is called. - */ - void - pop_back() - { - if (this->_M_impl._M_finish._M_cur != this->_M_impl._M_finish._M_first) - { - --this->_M_impl._M_finish._M_cur; - std::_Destroy(this->_M_impl._M_finish._M_cur); - } - else - _M_pop_back_aux(); - } - - /** - * @brief Inserts given value into %deque before specified iterator. - * @param position An iterator into the %deque. - * @param x Data to be inserted. - * @return An iterator that points to the inserted data. - * - * This function will insert a copy of the given value before the - * specified location. - */ - iterator - insert(iterator position, const value_type& __x); - - /** - * @brief Inserts a number of copies of given data into the %deque. - * @param position An iterator into the %deque. - * @param n Number of elements to be inserted. - * @param x Data to be inserted. - * - * This function will insert a specified number of copies of the given - * data before the location specified by @a position. - */ - void - insert(iterator __position, size_type __n, const value_type& __x) - { _M_fill_insert(__position, __n, __x); } - - /** - * @brief Inserts a range into the %deque. - * @param position An iterator into the %deque. - * @param first An input iterator. - * @param last An input iterator. - * - * This function will insert copies of the data in the range [first,last) - * into the %deque before the location specified by @a pos. This is - * known as "range insert." - */ - template<typename _InputIterator> - void - insert(iterator __position, _InputIterator __first, - _InputIterator __last) - { - // Check whether it's an integral type. If so, it's not an iterator. - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_insert_dispatch(__position, __first, __last, _Integral()); - } - - /** - * @brief Remove element at given position. - * @param position Iterator pointing to element to be erased. - * @return An iterator pointing to the next element (or end()). - * - * This function will erase the element at the given position and thus - * shorten the %deque by one. - * - * The user is cautioned that - * this function only erases the element, and that if the element is - * itself a pointer, the pointed-to memory is not touched in any way. - * Managing the pointer is the user's responsibilty. - */ - iterator - erase(iterator __position); - - /** - * @brief Remove a range of elements. - * @param first Iterator pointing to the first element to be erased. - * @param last Iterator pointing to one past the last element to be - * erased. - * @return An iterator pointing to the element pointed to by @a last - * prior to erasing (or end()). - * - * This function will erase the elements in the range [first,last) and - * shorten the %deque accordingly. - * - * The user is cautioned that - * this function only erases the elements, and that if the elements - * themselves are pointers, the pointed-to memory is not touched in any - * way. Managing the pointer is the user's responsibilty. - */ - iterator - erase(iterator __first, iterator __last); - - /** - * @brief Swaps data with another %deque. - * @param x A %deque of the same element and allocator types. - * - * This exchanges the elements between two deques in constant time. - * (Four pointers, so it should be quite fast.) - * Note that the global std::swap() function is specialized such that - * std::swap(d1,d2) will feed to this function. - */ - void - swap(deque& __x) - { - std::swap(this->_M_impl._M_start, __x._M_impl._M_start); - std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish); - std::swap(this->_M_impl._M_map, __x._M_impl._M_map); - std::swap(this->_M_impl._M_map_size, __x._M_impl._M_map_size); - } - - /** - * Erases all the elements. Note that this function only erases the - * elements, and that if the elements themselves are pointers, the - * pointed-to memory is not touched in any way. Managing the pointer is - * the user's responsibilty. - */ - void clear(); - - protected: - // Internal constructor functions follow. - - // called by the range constructor to implement [23.1.1]/9 - template<typename _Integer> - void - _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) - { - _M_initialize_map(__n); - _M_fill_initialize(__x); - } - - // called by the range constructor to implement [23.1.1]/9 - template<typename _InputIterator> - void - _M_initialize_dispatch(_InputIterator __first, _InputIterator __last, - __false_type) - { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; - _M_range_initialize(__first, __last, _IterCategory()); - } - - // called by the second initialize_dispatch above - //@{ - /** - * @if maint - * @brief Fills the deque with whatever is in [first,last). - * @param first An input iterator. - * @param last An input iterator. - * @return Nothing. - * - * If the iterators are actually forward iterators (or better), then the - * memory layout can be done all at once. Else we move forward using - * push_back on each value from the iterator. - * @endif - */ - template<typename _InputIterator> - void - _M_range_initialize(_InputIterator __first, _InputIterator __last, - input_iterator_tag); - - // called by the second initialize_dispatch above - template<typename _ForwardIterator> - void - _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag); - //@} - - /** - * @if maint - * @brief Fills the %deque with copies of value. - * @param value Initial value. - * @return Nothing. - * @pre _M_start and _M_finish have already been initialized, but none of - * the %deque's elements have yet been constructed. - * - * This function is called only when the user provides an explicit size - * (with or without an explicit exemplar value). - * @endif - */ - void - _M_fill_initialize(const value_type& __value); - - // Internal assign functions follow. The *_aux functions do the actual - // assignment work for the range versions. - - // called by the range assign to implement [23.1.1]/9 - template<typename _Integer> - void - _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) - { - _M_fill_assign(static_cast<size_type>(__n), - static_cast<value_type>(__val)); - } - - // called by the range assign to implement [23.1.1]/9 - template<typename _InputIterator> - void - _M_assign_dispatch(_InputIterator __first, _InputIterator __last, - __false_type) - { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; - _M_assign_aux(__first, __last, _IterCategory()); - } - - // called by the second assign_dispatch above - template<typename _InputIterator> - void - _M_assign_aux(_InputIterator __first, _InputIterator __last, - input_iterator_tag); - - // called by the second assign_dispatch above - template<typename _ForwardIterator> - void - _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) - { - const size_type __len = std::distance(__first, __last); - if (__len > size()) - { - _ForwardIterator __mid = __first; - std::advance(__mid, size()); - std::copy(__first, __mid, begin()); - insert(end(), __mid, __last); - } - else - erase(std::copy(__first, __last, begin()), end()); - } - - // Called by assign(n,t), and the range assign when it turns out to be the - // same thing. - void - _M_fill_assign(size_type __n, const value_type& __val) - { - if (__n > size()) - { - std::fill(begin(), end(), __val); - insert(end(), __n - size(), __val); - } - else - { - erase(begin() + __n, end()); - std::fill(begin(), end(), __val); - } - } - - //@{ - /** - * @if maint - * @brief Helper functions for push_* and pop_*. - * @endif - */ - void _M_push_back_aux(const value_type&); - void _M_push_front_aux(const value_type&); - void _M_pop_back_aux(); - void _M_pop_front_aux(); - //@} - - // Internal insert functions follow. The *_aux functions do the actual - // insertion work when all shortcuts fail. - - // called by the range insert to implement [23.1.1]/9 - template<typename _Integer> - void - _M_insert_dispatch(iterator __pos, - _Integer __n, _Integer __x, __true_type) - { - _M_fill_insert(__pos, static_cast<size_type>(__n), - static_cast<value_type>(__x)); - } - - // called by the range insert to implement [23.1.1]/9 - template<typename _InputIterator> - void - _M_insert_dispatch(iterator __pos, - _InputIterator __first, _InputIterator __last, - __false_type) - { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; - _M_range_insert_aux(__pos, __first, __last, _IterCategory()); - } - - // called by the second insert_dispatch above - template<typename _InputIterator> - void - _M_range_insert_aux(iterator __pos, _InputIterator __first, - _InputIterator __last, input_iterator_tag); - - // called by the second insert_dispatch above - template<typename _ForwardIterator> - void - _M_range_insert_aux(iterator __pos, _ForwardIterator __first, - _ForwardIterator __last, forward_iterator_tag); - - // Called by insert(p,n,x), and the range insert when it turns out to be - // the same thing. Can use fill functions in optimal situations, - // otherwise passes off to insert_aux(p,n,x). - void - _M_fill_insert(iterator __pos, size_type __n, const value_type& __x); - - // called by insert(p,x) - iterator - _M_insert_aux(iterator __pos, const value_type& __x); - - // called by insert(p,n,x) via fill_insert - void - _M_insert_aux(iterator __pos, size_type __n, const value_type& __x); - - // called by range_insert_aux for forward iterators - template<typename _ForwardIterator> - void - _M_insert_aux(iterator __pos, - _ForwardIterator __first, _ForwardIterator __last, - size_type __n); - - //@{ - /** - * @if maint - * @brief Memory-handling helpers for the previous internal insert - * functions. - * @endif - */ - iterator - _M_reserve_elements_at_front(size_type __n) - { - const size_type __vacancies = this->_M_impl._M_start._M_cur - - this->_M_impl._M_start._M_first; - if (__n > __vacancies) - _M_new_elements_at_front(__n - __vacancies); - return this->_M_impl._M_start - difference_type(__n); - } - - iterator - _M_reserve_elements_at_back(size_type __n) - { - const size_type __vacancies = (this->_M_impl._M_finish._M_last - - this->_M_impl._M_finish._M_cur) - 1; - if (__n > __vacancies) - _M_new_elements_at_back(__n - __vacancies); - return this->_M_impl._M_finish + difference_type(__n); - } - - void - _M_new_elements_at_front(size_type __new_elements); - - void - _M_new_elements_at_back(size_type __new_elements); - //@} - - - //@{ - /** - * @if maint - * @brief Memory-handling helpers for the major %map. - * - * Makes sure the _M_map has space for new nodes. Does not actually add - * the nodes. Can invalidate _M_map pointers. (And consequently, %deque - * iterators.) - * @endif - */ - void - _M_reserve_map_at_back (size_type __nodes_to_add = 1) - { - if (__nodes_to_add + 1 > this->_M_impl._M_map_size - - (this->_M_impl._M_finish._M_node - this->_M_impl._M_map)) - _M_reallocate_map(__nodes_to_add, false); - } - - void - _M_reserve_map_at_front (size_type __nodes_to_add = 1) - { - if (__nodes_to_add > size_type(this->_M_impl._M_start._M_node - this->_M_impl._M_map)) - _M_reallocate_map(__nodes_to_add, true); - } - - void - _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front); - //@} - }; - - - /** - * @brief Deque equality comparison. - * @param x A %deque. - * @param y A %deque of the same type as @a x. - * @return True iff the size and elements of the deques are equal. - * - * This is an equivalence relation. It is linear in the size of the - * deques. Deques are considered equivalent if their sizes are equal, - * and if corresponding elements compare equal. - */ - template<typename _Tp, typename _Alloc> - inline bool - operator==(const deque<_Tp, _Alloc>& __x, - const deque<_Tp, _Alloc>& __y) - { return __x.size() == __y.size() - && std::equal(__x.begin(), __x.end(), __y.begin()); } - - /** - * @brief Deque ordering relation. - * @param x A %deque. - * @param y A %deque of the same type as @a x. - * @return True iff @a x is lexicographically less than @a y. - * - * This is a total ordering relation. It is linear in the size of the - * deques. The elements must be comparable with @c <. - * - * See std::lexicographical_compare() for how the determination is made. - */ - template<typename _Tp, typename _Alloc> - inline bool - operator<(const deque<_Tp, _Alloc>& __x, - const deque<_Tp, _Alloc>& __y) - { return lexicographical_compare(__x.begin(), __x.end(), - __y.begin(), __y.end()); } - - /// Based on operator== - template<typename _Tp, typename _Alloc> - inline bool - operator!=(const deque<_Tp, _Alloc>& __x, - const deque<_Tp, _Alloc>& __y) - { return !(__x == __y); } - - /// Based on operator< - template<typename _Tp, typename _Alloc> - inline bool - operator>(const deque<_Tp, _Alloc>& __x, - const deque<_Tp, _Alloc>& __y) - { return __y < __x; } - - /// Based on operator< - template<typename _Tp, typename _Alloc> - inline bool - operator<=(const deque<_Tp, _Alloc>& __x, - const deque<_Tp, _Alloc>& __y) - { return !(__y < __x); } - - /// Based on operator< - template<typename _Tp, typename _Alloc> - inline bool - operator>=(const deque<_Tp, _Alloc>& __x, - const deque<_Tp, _Alloc>& __y) - { return !(__x < __y); } - - /// See std::deque::swap(). - template<typename _Tp, typename _Alloc> - inline void - swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y) - { __x.swap(__y); } -} // namespace std - -#endif /* _DEQUE_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_function.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_function.h deleted file mode 100644 index 74ddcce9d8b..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_function.h +++ /dev/null @@ -1,898 +0,0 @@ -// Functor implementations -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996-1998 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_function.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _FUNCTION_H -#define _FUNCTION_H 1 - -namespace std -{ - // 20.3.1 base classes - /** @defgroup s20_3_1_base Functor Base Classes - * Function objects, or @e functors, are objects with an @c operator() - * defined and accessible. They can be passed as arguments to algorithm - * templates and used in place of a function pointer. Not only is the - * resulting expressiveness of the library increased, but the generated - * code can be more efficient than what you might write by hand. When we - * refer to "functors," then, generally we include function pointers in - * the description as well. - * - * Often, functors are only created as temporaries passed to algorithm - * calls, rather than being created as named variables. - * - * Two examples taken from the standard itself follow. To perform a - * by-element addition of two vectors @c a and @c b containing @c double, - * and put the result in @c a, use - * \code - * transform (a.begin(), a.end(), b.begin(), a.begin(), plus<double>()); - * \endcode - * To negate every element in @c a, use - * \code - * transform(a.begin(), a.end(), a.begin(), negate<double>()); - * \endcode - * The addition and negation functions will be inlined directly. - * - * The standard functiors are derived from structs named @c unary_function - * and @c binary_function. These two classes contain nothing but typedefs, - * to aid in generic (template) programming. If you write your own - * functors, you might consider doing the same. - * - * @{ - */ - /** - * This is one of the @link s20_3_1_base functor base classes@endlink. - */ - template <class _Arg, class _Result> - struct unary_function - { - typedef _Arg argument_type; ///< @c argument_type is the type of the - /// argument (no surprises here) - - typedef _Result result_type; ///< @c result_type is the return type - }; - - /** - * This is one of the @link s20_3_1_base functor base classes@endlink. - */ - template <class _Arg1, class _Arg2, class _Result> - struct binary_function - { - typedef _Arg1 first_argument_type; ///< the type of the first argument - /// (no surprises here) - - typedef _Arg2 second_argument_type; ///< the type of the second argument - typedef _Result result_type; ///< type of the return type - }; - /** @} */ - - // 20.3.2 arithmetic - /** @defgroup s20_3_2_arithmetic Arithmetic Classes - * Because basic math often needs to be done during an algorithm, the library - * provides functors for those operations. See the documentation for - * @link s20_3_1_base the base classes@endlink for examples of their use. - * - * @{ - */ - /// One of the @link s20_3_2_arithmetic math functors@endlink. - template <class _Tp> - struct plus : public binary_function<_Tp, _Tp, _Tp> - { - _Tp - operator()(const _Tp& __x, const _Tp& __y) const - { return __x + __y; } - }; - - /// One of the @link s20_3_2_arithmetic math functors@endlink. - template <class _Tp> - struct minus : public binary_function<_Tp, _Tp, _Tp> - { - _Tp - operator()(const _Tp& __x, const _Tp& __y) const - { return __x - __y; } - }; - - /// One of the @link s20_3_2_arithmetic math functors@endlink. - template <class _Tp> - struct multiplies : public binary_function<_Tp, _Tp, _Tp> - { - _Tp - operator()(const _Tp& __x, const _Tp& __y) const - { return __x * __y; } - }; - - /// One of the @link s20_3_2_arithmetic math functors@endlink. - template <class _Tp> - struct divides : public binary_function<_Tp, _Tp, _Tp> - { - _Tp - operator()(const _Tp& __x, const _Tp& __y) const - { return __x / __y; } - }; - - /// One of the @link s20_3_2_arithmetic math functors@endlink. - template <class _Tp> - struct modulus : public binary_function<_Tp, _Tp, _Tp> - { - _Tp - operator()(const _Tp& __x, const _Tp& __y) const - { return __x % __y; } - }; - - /// One of the @link s20_3_2_arithmetic math functors@endlink. - template <class _Tp> - struct negate : public unary_function<_Tp, _Tp> - { - _Tp - operator()(const _Tp& __x) const - { return -__x; } - }; - /** @} */ - - // 20.3.3 comparisons - /** @defgroup s20_3_3_comparisons Comparison Classes - * The library provides six wrapper functors for all the basic comparisons - * in C++, like @c <. - * - * @{ - */ - /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template <class _Tp> - struct equal_to : public binary_function<_Tp, _Tp, bool> - { - bool - operator()(const _Tp& __x, const _Tp& __y) const - { return __x == __y; } - }; - - /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template <class _Tp> - struct not_equal_to : public binary_function<_Tp, _Tp, bool> - { - bool - operator()(const _Tp& __x, const _Tp& __y) const - { return __x != __y; } - }; - - /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template <class _Tp> - struct greater : public binary_function<_Tp, _Tp, bool> - { - bool - operator()(const _Tp& __x, const _Tp& __y) const - { return __x > __y; } - }; - - /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template <class _Tp> - struct less : public binary_function<_Tp, _Tp, bool> - { - bool - operator()(const _Tp& __x, const _Tp& __y) const - { return __x < __y; } - }; - - /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template <class _Tp> - struct greater_equal : public binary_function<_Tp, _Tp, bool> - { - bool - operator()(const _Tp& __x, const _Tp& __y) const - { return __x >= __y; } - }; - - /// One of the @link s20_3_3_comparisons comparison functors@endlink. - template <class _Tp> - struct less_equal : public binary_function<_Tp, _Tp, bool> - { - bool - operator()(const _Tp& __x, const _Tp& __y) const - { return __x <= __y; } - }; - /** @} */ - - // 20.3.4 logical operations - /** @defgroup s20_3_4_logical Boolean Operations Classes - * Here are wrapper functors for Boolean operations: @c &&, @c ||, and @c !. - * - * @{ - */ - /// One of the @link s20_3_4_logical Boolean operations functors@endlink. - template <class _Tp> - struct logical_and : public binary_function<_Tp, _Tp, bool> - { - bool - operator()(const _Tp& __x, const _Tp& __y) const - { return __x && __y; } - }; - - /// One of the @link s20_3_4_logical Boolean operations functors@endlink. - template <class _Tp> - struct logical_or : public binary_function<_Tp, _Tp, bool> - { - bool - operator()(const _Tp& __x, const _Tp& __y) const - { return __x || __y; } - }; - - /// One of the @link s20_3_4_logical Boolean operations functors@endlink. - template <class _Tp> - struct logical_not : public unary_function<_Tp, bool> - { - bool - operator()(const _Tp& __x) const - { return !__x; } - }; - /** @} */ - - // 20.3.5 negators - /** @defgroup s20_3_5_negators Negators - * The functions @c not1 and @c not2 each take a predicate functor - * and return an instance of @c unary_negate or - * @c binary_negate, respectively. These classes are functors whose - * @c operator() performs the stored predicate function and then returns - * the negation of the result. - * - * For example, given a vector of integers and a trivial predicate, - * \code - * struct IntGreaterThanThree - * : public std::unary_function<int, bool> - * { - * bool operator() (int x) { return x > 3; } - * }; - * - * std::find_if (v.begin(), v.end(), not1(IntGreaterThanThree())); - * \endcode - * The call to @c find_if will locate the first index (i) of @c v for which - * "!(v[i] > 3)" is true. - * - * The not1/unary_negate combination works on predicates taking a single - * argument. The not2/binary_negate combination works on predicates which - * take two arguments. - * - * @{ - */ - /// One of the @link s20_3_5_negators negation functors@endlink. - template <class _Predicate> - class unary_negate - : public unary_function<typename _Predicate::argument_type, bool> - { - protected: - _Predicate _M_pred; - public: - explicit - unary_negate(const _Predicate& __x) : _M_pred(__x) {} - - bool - operator()(const typename _Predicate::argument_type& __x) const - { return !_M_pred(__x); } - }; - - /// One of the @link s20_3_5_negators negation functors@endlink. - template <class _Predicate> - inline unary_negate<_Predicate> - not1(const _Predicate& __pred) - { return unary_negate<_Predicate>(__pred); } - - /// One of the @link s20_3_5_negators negation functors@endlink. - template <class _Predicate> - class binary_negate - : public binary_function<typename _Predicate::first_argument_type, - typename _Predicate::second_argument_type, - bool> - { - protected: - _Predicate _M_pred; - public: - explicit - binary_negate(const _Predicate& __x) - : _M_pred(__x) { } - - bool - operator()(const typename _Predicate::first_argument_type& __x, - const typename _Predicate::second_argument_type& __y) const - { return !_M_pred(__x, __y); } - }; - - /// One of the @link s20_3_5_negators negation functors@endlink. - template <class _Predicate> - inline binary_negate<_Predicate> - not2(const _Predicate& __pred) - { return binary_negate<_Predicate>(__pred); } - /** @} */ - - // 20.3.6 binders - /** @defgroup s20_3_6_binder Binder Classes - * Binders turn functions/functors with two arguments into functors with - * a single argument, storing an argument to be applied later. For - * example, an variable @c B of type @c binder1st is constructed from a - * functor @c f and an argument @c x. Later, B's @c operator() is called - * with a single argument @c y. The return value is the value of @c f(x,y). - * @c B can be "called" with various arguments (y1, y2, ...) and will in - * turn call @c f(x,y1), @c f(x,y2), ... - * - * The function @c bind1st is provided to save some typing. It takes the - * function and an argument as parameters, and returns an instance of - * @c binder1st. - * - * The type @c binder2nd and its creator function @c bind2nd do the same - * thing, but the stored argument is passed as the second parameter instead - * of the first, e.g., @c bind2nd(std::minus<float>,1.3) will create a - * functor whose @c operator() accepts a floating-point number, subtracts - * 1.3 from it, and returns the result. (If @c bind1st had been used, - * the functor would perform "1.3 - x" instead. - * - * Creator-wrapper functions like @c bind1st are intended to be used in - * calling algorithms. Their return values will be temporary objects. - * (The goal is to not require you to type names like - * @c std::binder1st<std::plus<int>> for declaring a variable to hold the - * return value from @c bind1st(std::plus<int>,5). - * - * These become more useful when combined with the composition functions. - * - * @{ - */ - /// One of the @link s20_3_6_binder binder functors@endlink. - template <class _Operation> - class binder1st - : public unary_function<typename _Operation::second_argument_type, - typename _Operation::result_type> - { - protected: - _Operation op; - typename _Operation::first_argument_type value; - public: - binder1st(const _Operation& __x, - const typename _Operation::first_argument_type& __y) - : op(__x), value(__y) {} - - typename _Operation::result_type - operator()(const typename _Operation::second_argument_type& __x) const - { return op(value, __x); } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 109. Missing binders for non-const sequence elements - typename _Operation::result_type - operator()(typename _Operation::second_argument_type& __x) const - { return op(value, __x); } - }; - - /// One of the @link s20_3_6_binder binder functors@endlink. - template <class _Operation, class _Tp> - inline binder1st<_Operation> - bind1st(const _Operation& __fn, const _Tp& __x) - { - typedef typename _Operation::first_argument_type _Arg1_type; - return binder1st<_Operation>(__fn, _Arg1_type(__x)); - } - - /// One of the @link s20_3_6_binder binder functors@endlink. - template <class _Operation> - class binder2nd - : public unary_function<typename _Operation::first_argument_type, - typename _Operation::result_type> - { - protected: - _Operation op; - typename _Operation::second_argument_type value; - public: - binder2nd(const _Operation& __x, - const typename _Operation::second_argument_type& __y) - : op(__x), value(__y) {} - - typename _Operation::result_type - operator()(const typename _Operation::first_argument_type& __x) const - { return op(__x, value); } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 109. Missing binders for non-const sequence elements - typename _Operation::result_type - operator()(typename _Operation::first_argument_type& __x) const - { return op(__x, value); } - }; - - /// One of the @link s20_3_6_binder binder functors@endlink. - template <class _Operation, class _Tp> - inline binder2nd<_Operation> - bind2nd(const _Operation& __fn, const _Tp& __x) - { - typedef typename _Operation::second_argument_type _Arg2_type; - return binder2nd<_Operation>(__fn, _Arg2_type(__x)); - } - /** @} */ - - // 20.3.7 adaptors pointers functions - /** @defgroup s20_3_7_adaptors Adaptors for pointers to functions - * The advantage of function objects over pointers to functions is that - * the objects in the standard library declare nested typedefs describing - * their argument and result types with uniform names (e.g., @c result_type - * from the base classes @c unary_function and @c binary_function). - * Sometimes those typedefs are required, not just optional. - * - * Adaptors are provided to turn pointers to unary (single-argument) and - * binary (double-argument) functions into function objects. The - * long-winded functor @c pointer_to_unary_function is constructed with a - * function pointer @c f, and its @c operator() called with argument @c x - * returns @c f(x). The functor @c pointer_to_binary_function does the same - * thing, but with a double-argument @c f and @c operator(). - * - * The function @c ptr_fun takes a pointer-to-function @c f and constructs - * an instance of the appropriate functor. - * - * @{ - */ - /// One of the @link s20_3_7_adaptors adaptors for function pointers@endlink. - template <class _Arg, class _Result> - class pointer_to_unary_function : public unary_function<_Arg, _Result> - { - protected: - _Result (*_M_ptr)(_Arg); - public: - pointer_to_unary_function() {} - - explicit - pointer_to_unary_function(_Result (*__x)(_Arg)) - : _M_ptr(__x) {} - - _Result - operator()(_Arg __x) const - { return _M_ptr(__x); } - }; - - /// One of the @link s20_3_7_adaptors adaptors for function pointers@endlink. - template <class _Arg, class _Result> - inline pointer_to_unary_function<_Arg, _Result> - ptr_fun(_Result (*__x)(_Arg)) - { return pointer_to_unary_function<_Arg, _Result>(__x); } - - /// One of the @link s20_3_7_adaptors adaptors for function pointers@endlink. - template <class _Arg1, class _Arg2, class _Result> - class pointer_to_binary_function - : public binary_function<_Arg1, _Arg2, _Result> - { - protected: - _Result (*_M_ptr)(_Arg1, _Arg2); - public: - pointer_to_binary_function() {} - - explicit - pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2)) - : _M_ptr(__x) {} - - _Result - operator()(_Arg1 __x, _Arg2 __y) const - { return _M_ptr(__x, __y); } - }; - - /// One of the @link s20_3_7_adaptors adaptors for function pointers@endlink. - template <class _Arg1, class _Arg2, class _Result> - inline pointer_to_binary_function<_Arg1, _Arg2, _Result> - ptr_fun(_Result (*__x)(_Arg1, _Arg2)) - { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); } - /** @} */ - - template <class _Tp> - struct _Identity : public unary_function<_Tp,_Tp> - { - _Tp& - operator()(_Tp& __x) const - { return __x; } - - const _Tp& - operator()(const _Tp& __x) const - { return __x; } - }; - - template <class _Pair> - struct _Select1st : public unary_function<_Pair, - typename _Pair::first_type> - { - typename _Pair::first_type& - operator()(_Pair& __x) const - { return __x.first; } - - const typename _Pair::first_type& - operator()(const _Pair& __x) const - { return __x.first; } - }; - - template <class _Pair> - struct _Select2nd : public unary_function<_Pair, - typename _Pair::second_type> - { - typename _Pair::second_type& - operator()(_Pair& __x) const - { return __x.second; } - - const typename _Pair::second_type& - operator()(const _Pair& __x) const - { return __x.second; } - }; - - // 20.3.8 adaptors pointers members - /** @defgroup s20_3_8_memadaptors Adaptors for pointers to members - * There are a total of 16 = 2^4 function objects in this family. - * (1) Member functions taking no arguments vs member functions taking - * one argument. - * (2) Call through pointer vs call through reference. - * (3) Member function with void return type vs member function with - * non-void return type. - * (4) Const vs non-const member function. - * - * Note that choice (3) is nothing more than a workaround: according - * to the draft, compilers should handle void and non-void the same way. - * This feature is not yet widely implemented, though. You can only use - * member functions returning void if your compiler supports partial - * specialization. - * - * All of this complexity is in the function objects themselves. You can - * ignore it by using the helper function mem_fun and mem_fun_ref, - * which create whichever type of adaptor is appropriate. - * - * @{ - */ - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Ret, class _Tp> - class mem_fun_t : public unary_function<_Tp*, _Ret> - { - public: - explicit - mem_fun_t(_Ret (_Tp::*__pf)()) - : _M_f(__pf) {} - - _Ret - operator()(_Tp* __p) const - { return (__p->*_M_f)(); } - private: - _Ret (_Tp::*_M_f)(); - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Ret, class _Tp> - class const_mem_fun_t : public unary_function<const _Tp*, _Ret> - { - public: - explicit - const_mem_fun_t(_Ret (_Tp::*__pf)() const) - : _M_f(__pf) {} - - _Ret - operator()(const _Tp* __p) const - { return (__p->*_M_f)(); } - private: - _Ret (_Tp::*_M_f)() const; - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Ret, class _Tp> - class mem_fun_ref_t : public unary_function<_Tp, _Ret> - { - public: - explicit - mem_fun_ref_t(_Ret (_Tp::*__pf)()) - : _M_f(__pf) {} - - _Ret - operator()(_Tp& __r) const - { return (__r.*_M_f)(); } - private: - _Ret (_Tp::*_M_f)(); - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Ret, class _Tp> - class const_mem_fun_ref_t : public unary_function<_Tp, _Ret> - { - public: - explicit - const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const) - : _M_f(__pf) {} - - _Ret - operator()(const _Tp& __r) const - { return (__r.*_M_f)(); } - private: - _Ret (_Tp::*_M_f)() const; - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Ret, class _Tp, class _Arg> - class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret> - { - public: - explicit - mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) - : _M_f(__pf) {} - - _Ret - operator()(_Tp* __p, _Arg __x) const - { return (__p->*_M_f)(__x); } - private: - _Ret (_Tp::*_M_f)(_Arg); - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Ret, class _Tp, class _Arg> - class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret> - { - public: - explicit - const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const) - : _M_f(__pf) {} - - _Ret - operator()(const _Tp* __p, _Arg __x) const - { return (__p->*_M_f)(__x); } - private: - _Ret (_Tp::*_M_f)(_Arg) const; - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Ret, class _Tp, class _Arg> - class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret> - { - public: - explicit - mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg)) - : _M_f(__pf) {} - - _Ret - operator()(_Tp& __r, _Arg __x) const - { return (__r.*_M_f)(__x); } - private: - _Ret (_Tp::*_M_f)(_Arg); - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Ret, class _Tp, class _Arg> - class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret> - { - public: - explicit - const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const) - : _M_f(__pf) {} - - _Ret - operator()(const _Tp& __r, _Arg __x) const - { return (__r.*_M_f)(__x); } - private: - _Ret (_Tp::*_M_f)(_Arg) const; - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Tp> - class mem_fun_t<void, _Tp> : public unary_function<_Tp*, void> - { - public: - explicit - mem_fun_t(void (_Tp::*__pf)()) - : _M_f(__pf) {} - - void - operator()(_Tp* __p) const - { (__p->*_M_f)(); } - private: - void (_Tp::*_M_f)(); - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Tp> - class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*, void> - { - public: - explicit - const_mem_fun_t(void (_Tp::*__pf)() const) - : _M_f(__pf) {} - - void - operator()(const _Tp* __p) const - { (__p->*_M_f)(); } - private: - void (_Tp::*_M_f)() const; - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Tp> - class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void> - { - public: - explicit - mem_fun_ref_t(void (_Tp::*__pf)()) - : _M_f(__pf) {} - - void - operator()(_Tp& __r) const - { (__r.*_M_f)(); } - private: - void (_Tp::*_M_f)(); - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Tp> - class const_mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void> - { - public: - explicit - const_mem_fun_ref_t(void (_Tp::*__pf)() const) - : _M_f(__pf) {} - - void - operator()(const _Tp& __r) const - { (__r.*_M_f)(); } - private: - void (_Tp::*_M_f)() const; - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Tp, class _Arg> - class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*, _Arg, void> - { - public: - explicit - mem_fun1_t(void (_Tp::*__pf)(_Arg)) - : _M_f(__pf) {} - - void - operator()(_Tp* __p, _Arg __x) const - { (__p->*_M_f)(__x); } - private: - void (_Tp::*_M_f)(_Arg); - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Tp, class _Arg> - class const_mem_fun1_t<void, _Tp, _Arg> - : public binary_function<const _Tp*, _Arg, void> - { - public: - explicit - const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const) - : _M_f(__pf) {} - - void - operator()(const _Tp* __p, _Arg __x) const - { (__p->*_M_f)(__x); } - private: - void (_Tp::*_M_f)(_Arg) const; - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Tp, class _Arg> - class mem_fun1_ref_t<void, _Tp, _Arg> - : public binary_function<_Tp, _Arg, void> - { - public: - explicit - mem_fun1_ref_t(void (_Tp::*__pf)(_Arg)) - : _M_f(__pf) {} - - void - operator()(_Tp& __r, _Arg __x) const - { (__r.*_M_f)(__x); } - private: - void (_Tp::*_M_f)(_Arg); - }; - - /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. - template <class _Tp, class _Arg> - class const_mem_fun1_ref_t<void, _Tp, _Arg> - : public binary_function<_Tp, _Arg, void> - { - public: - explicit - const_mem_fun1_ref_t(void (_Tp::*__pf)(_Arg) const) - : _M_f(__pf) {} - - void - operator()(const _Tp& __r, _Arg __x) const - { (__r.*_M_f)(__x); } - private: - void (_Tp::*_M_f)(_Arg) const; - }; - - // Mem_fun adaptor helper functions. There are only two: - // mem_fun and mem_fun_ref. - template <class _Ret, class _Tp> - inline mem_fun_t<_Ret, _Tp> - mem_fun(_Ret (_Tp::*__f)()) - { return mem_fun_t<_Ret, _Tp>(__f); } - - template <class _Ret, class _Tp> - inline const_mem_fun_t<_Ret, _Tp> - mem_fun(_Ret (_Tp::*__f)() const) - { return const_mem_fun_t<_Ret, _Tp>(__f); } - - template <class _Ret, class _Tp> - inline mem_fun_ref_t<_Ret, _Tp> - mem_fun_ref(_Ret (_Tp::*__f)()) - { return mem_fun_ref_t<_Ret, _Tp>(__f); } - - template <class _Ret, class _Tp> - inline const_mem_fun_ref_t<_Ret, _Tp> - mem_fun_ref(_Ret (_Tp::*__f)() const) - { return const_mem_fun_ref_t<_Ret, _Tp>(__f); } - - template <class _Ret, class _Tp, class _Arg> - inline mem_fun1_t<_Ret, _Tp, _Arg> - mem_fun(_Ret (_Tp::*__f)(_Arg)) - { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); } - - template <class _Ret, class _Tp, class _Arg> - inline const_mem_fun1_t<_Ret, _Tp, _Arg> - mem_fun(_Ret (_Tp::*__f)(_Arg) const) - { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); } - - template <class _Ret, class _Tp, class _Arg> - inline mem_fun1_ref_t<_Ret, _Tp, _Arg> - mem_fun_ref(_Ret (_Tp::*__f)(_Arg)) - { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); } - - template <class _Ret, class _Tp, class _Arg> - inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg> - mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const) - { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); } - - /** @} */ - -} // namespace std - -#endif /* _FUNCTION_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_heap.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_heap.h deleted file mode 100644 index eff7fd351d7..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_heap.h +++ /dev/null @@ -1,467 +0,0 @@ -// Heap implementation -*- C++ -*- - -// Copyright (C) 2001, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_heap.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _STL_HEAP_H -#define _STL_HEAP_H 1 - -#include <debug/debug.h> - -namespace std -{ - // is_heap, a predicate testing whether or not a range is - // a heap. This function is an extension, not part of the C++ - // standard. - template<typename _RandomAccessIterator, typename _Distance> - bool - __is_heap(_RandomAccessIterator __first, _Distance __n) - { - _Distance __parent = 0; - for (_Distance __child = 1; __child < __n; ++__child) - { - if (__first[__parent] < __first[__child]) - return false; - if ((__child & 1) == 0) - ++__parent; - } - return true; - } - - template<typename _RandomAccessIterator, typename _Distance, - typename _StrictWeakOrdering> - bool - __is_heap(_RandomAccessIterator __first, _StrictWeakOrdering __comp, - _Distance __n) - { - _Distance __parent = 0; - for (_Distance __child = 1; __child < __n; ++__child) - { - if (__comp(__first[__parent], __first[__child])) - return false; - if ((__child & 1) == 0) - ++__parent; - } - return true; - } - - template<typename _RandomAccessIterator> - bool - __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) - { return std::__is_heap(__first, std::distance(__first, __last)); } - - template<typename _RandomAccessIterator, typename _StrictWeakOrdering> - bool - __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, - _StrictWeakOrdering __comp) - { return std::__is_heap(__first, __comp, std::distance(__first, __last)); } - - // Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap. - - template<typename _RandomAccessIterator, typename _Distance, typename _Tp> - void - __push_heap(_RandomAccessIterator __first, - _Distance __holeIndex, _Distance __topIndex, _Tp __value) - { - _Distance __parent = (__holeIndex - 1) / 2; - while (__holeIndex > __topIndex && *(__first + __parent) < __value) - { - *(__first + __holeIndex) = *(__first + __parent); - __holeIndex = __parent; - __parent = (__holeIndex - 1) / 2; - } - *(__first + __holeIndex) = __value; - } - - /** - * @brief Push an element onto a heap. - * @param first Start of heap. - * @param last End of heap + element. - * @ingroup heap - * - * This operation pushes the element at last-1 onto the valid heap over the - * range [first,last-1). After completion, [first,last) is a valid heap. - */ - template<typename _RandomAccessIterator> - inline void - push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) - __glibcxx_requires_valid_range(__first, __last); - // __glibcxx_requires_heap(__first, __last - 1); - - std::__push_heap(__first, _DistanceType((__last - __first) - 1), - _DistanceType(0), _ValueType(*(__last - 1))); - } - - template<typename _RandomAccessIterator, typename _Distance, typename _Tp, - typename _Compare> - void - __push_heap(_RandomAccessIterator __first, _Distance __holeIndex, - _Distance __topIndex, _Tp __value, _Compare __comp) - { - _Distance __parent = (__holeIndex - 1) / 2; - while (__holeIndex > __topIndex - && __comp(*(__first + __parent), __value)) - { - *(__first + __holeIndex) = *(__first + __parent); - __holeIndex = __parent; - __parent = (__holeIndex - 1) / 2; - } - *(__first + __holeIndex) = __value; - } - - /** - * @brief Push an element onto a heap using comparison functor. - * @param first Start of heap. - * @param last End of heap + element. - * @param comp Comparison functor. - * @ingroup heap - * - * This operation pushes the element at last-1 onto the valid heap over the - * range [first,last-1). After completion, [first,last) is a valid heap. - * Compare operations are performed using comp. - */ - template<typename _RandomAccessIterator, typename _Compare> - inline void - push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Compare __comp) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_requires_valid_range(__first, __last); - __glibcxx_requires_heap_pred(__first, __last - 1, __comp); - - std::__push_heap(__first, _DistanceType((__last - __first) - 1), - _DistanceType(0), _ValueType(*(__last - 1)), __comp); - } - - template<typename _RandomAccessIterator, typename _Distance, typename _Tp> - void - __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, - _Distance __len, _Tp __value) - { - const _Distance __topIndex = __holeIndex; - _Distance __secondChild = 2 * __holeIndex + 2; - while (__secondChild < __len) - { - if (*(__first + __secondChild) < *(__first + (__secondChild - 1))) - __secondChild--; - *(__first + __holeIndex) = *(__first + __secondChild); - __holeIndex = __secondChild; - __secondChild = 2 * (__secondChild + 1); - } - if (__secondChild == __len) - { - *(__first + __holeIndex) = *(__first + (__secondChild - 1)); - __holeIndex = __secondChild - 1; - } - std::__push_heap(__first, __holeIndex, __topIndex, __value); - } - - template<typename _RandomAccessIterator, typename _Tp> - inline void - __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, - _RandomAccessIterator __result, _Tp __value) - { - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _Distance; - *__result = *__first; - std::__adjust_heap(__first, _Distance(0), _Distance(__last - __first), - __value); - } - - /** - * @brief Pop an element off a heap. - * @param first Start of heap. - * @param last End of heap. - * @ingroup heap - * - * This operation pops the top of the heap. The elements first and last-1 - * are swapped and [first,last-1) is made into a heap. - */ - template<typename _RandomAccessIterator> - inline void - pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) - __glibcxx_requires_valid_range(__first, __last); - __glibcxx_requires_heap(__first, __last); - - std::__pop_heap(__first, __last - 1, __last - 1, - _ValueType(*(__last - 1))); - } - - template<typename _RandomAccessIterator, typename _Distance, - typename _Tp, typename _Compare> - void - __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, - _Distance __len, _Tp __value, _Compare __comp) - { - const _Distance __topIndex = __holeIndex; - _Distance __secondChild = 2 * __holeIndex + 2; - while (__secondChild < __len) - { - if (__comp(*(__first + __secondChild), - *(__first + (__secondChild - 1)))) - __secondChild--; - *(__first + __holeIndex) = *(__first + __secondChild); - __holeIndex = __secondChild; - __secondChild = 2 * (__secondChild + 1); - } - if (__secondChild == __len) - { - *(__first + __holeIndex) = *(__first + (__secondChild - 1)); - __holeIndex = __secondChild - 1; - } - std::__push_heap(__first, __holeIndex, __topIndex, __value, __comp); - } - - template<typename _RandomAccessIterator, typename _Tp, typename _Compare> - inline void - __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, - _RandomAccessIterator __result, _Tp __value, _Compare __comp) - { - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _Distance; - *__result = *__first; - std::__adjust_heap(__first, _Distance(0), _Distance(__last - __first), - __value, __comp); - } - - /** - * @brief Pop an element off a heap using comparison functor. - * @param first Start of heap. - * @param last End of heap. - * @param comp Comparison functor to use. - * @ingroup heap - * - * This operation pops the top of the heap. The elements first and last-1 - * are swapped and [first,last-1) is made into a heap. Comparisons are - * made using comp. - */ - template<typename _RandomAccessIterator, typename _Compare> - inline void - pop_heap(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_requires_valid_range(__first, __last); - __glibcxx_requires_heap_pred(__first, __last, __comp); - - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - std::__pop_heap(__first, __last - 1, __last - 1, - _ValueType(*(__last - 1)), __comp); - } - - /** - * @brief Construct a heap over a range. - * @param first Start of heap. - * @param last End of heap. - * @ingroup heap - * - * This operation makes the elements in [first,last) into a heap. - */ - template<typename _RandomAccessIterator> - void - make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) - __glibcxx_requires_valid_range(__first, __last); - - if (__last - __first < 2) - return; - - const _DistanceType __len = __last - __first; - _DistanceType __parent = (__len - 2) / 2; - while (true) - { - std::__adjust_heap(__first, __parent, __len, - _ValueType(*(__first + __parent))); - if (__parent == 0) - return; - __parent--; - } - } - - /** - * @brief Construct a heap over a range using comparison functor. - * @param first Start of heap. - * @param last End of heap. - * @param comp Comparison functor to use. - * @ingroup heap - * - * This operation makes the elements in [first,last) into a heap. - * Comparisons are made using comp. - */ - template<typename _RandomAccessIterator, typename _Compare> - inline void - make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Compare __comp) - { - typedef typename iterator_traits<_RandomAccessIterator>::value_type - _ValueType; - typedef typename iterator_traits<_RandomAccessIterator>::difference_type - _DistanceType; - - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_requires_valid_range(__first, __last); - - if (__last - __first < 2) - return; - - const _DistanceType __len = __last - __first; - _DistanceType __parent = (__len - 2) / 2; - while (true) - { - std::__adjust_heap(__first, __parent, __len, - _ValueType(*(__first + __parent)), __comp); - if (__parent == 0) - return; - __parent--; - } - } - - /** - * @brief Sort a heap. - * @param first Start of heap. - * @param last End of heap. - * @ingroup heap - * - * This operation sorts the valid heap in the range [first,last). - */ - template<typename _RandomAccessIterator> - void - sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) - { - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - // __glibcxx_requires_heap(__first, __last); - - while (__last - __first > 1) - std::pop_heap(__first, __last--); - } - - /** - * @brief Sort a heap using comparison functor. - * @param first Start of heap. - * @param last End of heap. - * @param comp Comparison functor to use. - * @ingroup heap - * - * This operation sorts the valid heap in the range [first,last). - * Comparisons are made using comp. - */ - template<typename _RandomAccessIterator, typename _Compare> - void - sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Compare __comp) - { - // concept requirements - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_requires_valid_range(__first, __last); - __glibcxx_requires_heap_pred(__first, __last, __comp); - - while (__last - __first > 1) - std::pop_heap(__first, __last--, __comp); - } - -} // namespace std - -#endif /* _STL_HEAP_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_iterator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_iterator.h deleted file mode 100644 index cc564314bc8..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_iterator.h +++ /dev/null @@ -1,772 +0,0 @@ -// Iterators -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996-1998 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_iterator.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - * - * This file implements reverse_iterator, back_insert_iterator, - * front_insert_iterator, insert_iterator, __normal_iterator, and their - * supporting functions and overloaded operators. - */ - -#ifndef _ITERATOR_H -#define _ITERATOR_H 1 - -namespace std -{ - // 24.4.1 Reverse iterators - /** - * "Bidirectional and random access iterators have corresponding reverse - * %iterator adaptors that iterate through the data structure in the - * opposite direction. They have the same signatures as the corresponding - * iterators. The fundamental relation between a reverse %iterator and its - * corresponding %iterator @c i is established by the identity: - * @code - * &*(reverse_iterator(i)) == &*(i - 1) - * @endcode - * - * This mapping is dictated by the fact that while there is always a - * pointer past the end of an array, there might not be a valid pointer - * before the beginning of an array." [24.4.1]/1,2 - * - * Reverse iterators can be tricky and surprising at first. Their - * semantics make sense, however, and the trickiness is a side effect of - * the requirement that the iterators must be safe. - */ - template<typename _Iterator> - class reverse_iterator - : public iterator<typename iterator_traits<_Iterator>::iterator_category, - typename iterator_traits<_Iterator>::value_type, - typename iterator_traits<_Iterator>::difference_type, - typename iterator_traits<_Iterator>::pointer, - typename iterator_traits<_Iterator>::reference> - { - protected: - _Iterator current; - - public: - typedef _Iterator iterator_type; - typedef typename iterator_traits<_Iterator>::difference_type - difference_type; - typedef typename iterator_traits<_Iterator>::reference reference; - typedef typename iterator_traits<_Iterator>::pointer pointer; - - public: - /** - * The default constructor default-initializes member @p current. - * If it is a pointer, that means it is zero-initialized. - */ - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 235 No specification of default ctor for reverse_iterator - reverse_iterator() : current() { } - - /** - * This %iterator will move in the opposite direction that @p x does. - */ - explicit - reverse_iterator(iterator_type __x) : current(__x) { } - - /** - * The copy constructor is normal. - */ - reverse_iterator(const reverse_iterator& __x) - : current(__x.current) { } - - /** - * A reverse_iterator across other types can be copied in the normal - * fashion. - */ - template<typename _Iter> - reverse_iterator(const reverse_iterator<_Iter>& __x) - : current(__x.base()) { } - - /** - * @return @c current, the %iterator used for underlying work. - */ - iterator_type - base() const - { return current; } - - /** - * @return TODO - * - * @doctodo - */ - reference - operator*() const - { - _Iterator __tmp = current; - return *--__tmp; - } - - /** - * @return TODO - * - * @doctodo - */ - pointer - operator->() const - { return &(operator*()); } - - /** - * @return TODO - * - * @doctodo - */ - reverse_iterator& - operator++() - { - --current; - return *this; - } - - /** - * @return TODO - * - * @doctodo - */ - reverse_iterator - operator++(int) - { - reverse_iterator __tmp = *this; - --current; - return __tmp; - } - - /** - * @return TODO - * - * @doctodo - */ - reverse_iterator& - operator--() - { - ++current; - return *this; - } - - /** - * @return TODO - * - * @doctodo - */ - reverse_iterator operator--(int) - { - reverse_iterator __tmp = *this; - ++current; - return __tmp; - } - - /** - * @return TODO - * - * @doctodo - */ - reverse_iterator - operator+(difference_type __n) const - { return reverse_iterator(current - __n); } - - /** - * @return TODO - * - * @doctodo - */ - reverse_iterator& - operator+=(difference_type __n) - { - current -= __n; - return *this; - } - - /** - * @return TODO - * - * @doctodo - */ - reverse_iterator - operator-(difference_type __n) const - { return reverse_iterator(current + __n); } - - /** - * @return TODO - * - * @doctodo - */ - reverse_iterator& - operator-=(difference_type __n) - { - current += __n; - return *this; - } - - /** - * @return TODO - * - * @doctodo - */ - reference - operator[](difference_type __n) const - { return *(*this + __n); } - }; - - //@{ - /** - * @param x A %reverse_iterator. - * @param y A %reverse_iterator. - * @return A simple bool. - * - * Reverse iterators forward many operations to their underlying base() - * iterators. Others are implemented in terms of one another. - * - */ - template<typename _Iterator> - inline bool - operator==(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) - { return __x.base() == __y.base(); } - - template<typename _Iterator> - inline bool - operator<(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) - { return __y.base() < __x.base(); } - - template<typename _Iterator> - inline bool - operator!=(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) - { return !(__x == __y); } - - template<typename _Iterator> - inline bool - operator>(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) - { return __y < __x; } - - template<typename _Iterator> - inline bool - operator<=(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) - { return !(__y < __x); } - - template<typename _Iterator> - inline bool - operator>=(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) - { return !(__x < __y); } - - template<typename _Iterator> - inline typename reverse_iterator<_Iterator>::difference_type - operator-(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) - { return __y.base() - __x.base(); } - - template<typename _Iterator> - inline reverse_iterator<_Iterator> - operator+(typename reverse_iterator<_Iterator>::difference_type __n, - const reverse_iterator<_Iterator>& __x) - { return reverse_iterator<_Iterator>(__x.base() - __n); } - //@} - - // 24.4.2.2.1 back_insert_iterator - /** - * @brief Turns assignment into insertion. - * - * These are output iterators, constructed from a container-of-T. - * Assigning a T to the iterator appends it to the container using - * push_back. - * - * Tip: Using the back_inserter function to create these iterators can - * save typing. - */ - template<typename _Container> - class back_insert_iterator - : public iterator<output_iterator_tag, void, void, void, void> - { - protected: - _Container* container; - - public: - /// A nested typedef for the type of whatever container you used. - typedef _Container container_type; - - /// The only way to create this %iterator is with a container. - explicit - back_insert_iterator(_Container& __x) : container(&__x) { } - - /** - * @param value An instance of whatever type - * container_type::const_reference is; presumably a - * reference-to-const T for container<T>. - * @return This %iterator, for chained operations. - * - * This kind of %iterator doesn't really have a "position" in the - * container (you can think of the position as being permanently at - * the end, if you like). Assigning a value to the %iterator will - * always append the value to the end of the container. - */ - back_insert_iterator& - operator=(typename _Container::const_reference __value) - { - container->push_back(__value); - return *this; - } - - /// Simply returns *this. - back_insert_iterator& - operator*() - { return *this; } - - /// Simply returns *this. (This %iterator does not "move".) - back_insert_iterator& - operator++() - { return *this; } - - /// Simply returns *this. (This %iterator does not "move".) - back_insert_iterator - operator++(int) - { return *this; } - }; - - /** - * @param x A container of arbitrary type. - * @return An instance of back_insert_iterator working on @p x. - * - * This wrapper function helps in creating back_insert_iterator instances. - * Typing the name of the %iterator requires knowing the precise full - * type of the container, which can be tedious and impedes generic - * programming. Using this function lets you take advantage of automatic - * template parameter deduction, making the compiler match the correct - * types for you. - */ - template<typename _Container> - inline back_insert_iterator<_Container> - back_inserter(_Container& __x) - { return back_insert_iterator<_Container>(__x); } - - /** - * @brief Turns assignment into insertion. - * - * These are output iterators, constructed from a container-of-T. - * Assigning a T to the iterator prepends it to the container using - * push_front. - * - * Tip: Using the front_inserter function to create these iterators can - * save typing. - */ - template<typename _Container> - class front_insert_iterator - : public iterator<output_iterator_tag, void, void, void, void> - { - protected: - _Container* container; - - public: - /// A nested typedef for the type of whatever container you used. - typedef _Container container_type; - - /// The only way to create this %iterator is with a container. - explicit front_insert_iterator(_Container& __x) : container(&__x) { } - - /** - * @param value An instance of whatever type - * container_type::const_reference is; presumably a - * reference-to-const T for container<T>. - * @return This %iterator, for chained operations. - * - * This kind of %iterator doesn't really have a "position" in the - * container (you can think of the position as being permanently at - * the front, if you like). Assigning a value to the %iterator will - * always prepend the value to the front of the container. - */ - front_insert_iterator& - operator=(typename _Container::const_reference __value) - { - container->push_front(__value); - return *this; - } - - /// Simply returns *this. - front_insert_iterator& - operator*() - { return *this; } - - /// Simply returns *this. (This %iterator does not "move".) - front_insert_iterator& - operator++() - { return *this; } - - /// Simply returns *this. (This %iterator does not "move".) - front_insert_iterator - operator++(int) - { return *this; } - }; - - /** - * @param x A container of arbitrary type. - * @return An instance of front_insert_iterator working on @p x. - * - * This wrapper function helps in creating front_insert_iterator instances. - * Typing the name of the %iterator requires knowing the precise full - * type of the container, which can be tedious and impedes generic - * programming. Using this function lets you take advantage of automatic - * template parameter deduction, making the compiler match the correct - * types for you. - */ - template<typename _Container> - inline front_insert_iterator<_Container> - front_inserter(_Container& __x) - { return front_insert_iterator<_Container>(__x); } - - /** - * @brief Turns assignment into insertion. - * - * These are output iterators, constructed from a container-of-T. - * Assigning a T to the iterator inserts it in the container at the - * %iterator's position, rather than overwriting the value at that - * position. - * - * (Sequences will actually insert a @e copy of the value before the - * %iterator's position.) - * - * Tip: Using the inserter function to create these iterators can - * save typing. - */ - template<typename _Container> - class insert_iterator - : public iterator<output_iterator_tag, void, void, void, void> - { - protected: - _Container* container; - typename _Container::iterator iter; - - public: - /// A nested typedef for the type of whatever container you used. - typedef _Container container_type; - - /** - * The only way to create this %iterator is with a container and an - * initial position (a normal %iterator into the container). - */ - insert_iterator(_Container& __x, typename _Container::iterator __i) - : container(&__x), iter(__i) {} - - /** - * @param value An instance of whatever type - * container_type::const_reference is; presumably a - * reference-to-const T for container<T>. - * @return This %iterator, for chained operations. - * - * This kind of %iterator maintains its own position in the - * container. Assigning a value to the %iterator will insert the - * value into the container at the place before the %iterator. - * - * The position is maintained such that subsequent assignments will - * insert values immediately after one another. For example, - * @code - * // vector v contains A and Z - * - * insert_iterator i (v, ++v.begin()); - * i = 1; - * i = 2; - * i = 3; - * - * // vector v contains A, 1, 2, 3, and Z - * @endcode - */ - insert_iterator& - operator=(const typename _Container::const_reference __value) - { - iter = container->insert(iter, __value); - ++iter; - return *this; - } - - /// Simply returns *this. - insert_iterator& - operator*() - { return *this; } - - /// Simply returns *this. (This %iterator does not "move".) - insert_iterator& - operator++() - { return *this; } - - /// Simply returns *this. (This %iterator does not "move".) - insert_iterator& - operator++(int) - { return *this; } - }; - - /** - * @param x A container of arbitrary type. - * @return An instance of insert_iterator working on @p x. - * - * This wrapper function helps in creating insert_iterator instances. - * Typing the name of the %iterator requires knowing the precise full - * type of the container, which can be tedious and impedes generic - * programming. Using this function lets you take advantage of automatic - * template parameter deduction, making the compiler match the correct - * types for you. - */ - template<typename _Container, typename _Iterator> - inline insert_iterator<_Container> - inserter(_Container& __x, _Iterator __i) - { - return insert_iterator<_Container>(__x, - typename _Container::iterator(__i)); - } -} // namespace std - -namespace __gnu_cxx -{ - // This iterator adapter is 'normal' in the sense that it does not - // change the semantics of any of the operators of its iterator - // parameter. Its primary purpose is to convert an iterator that is - // not a class, e.g. a pointer, into an iterator that is a class. - // The _Container parameter exists solely so that different containers - // using this template can instantiate different types, even if the - // _Iterator parameter is the same. - using std::iterator_traits; - using std::iterator; - template<typename _Iterator, typename _Container> - class __normal_iterator - { - protected: - _Iterator _M_current; - - public: - typedef typename iterator_traits<_Iterator>::iterator_category - iterator_category; - typedef typename iterator_traits<_Iterator>::value_type value_type; - typedef typename iterator_traits<_Iterator>::difference_type - difference_type; - typedef typename iterator_traits<_Iterator>::reference reference; - typedef typename iterator_traits<_Iterator>::pointer pointer; - - __normal_iterator() : _M_current(_Iterator()) { } - - explicit - __normal_iterator(const _Iterator& __i) : _M_current(__i) { } - - // Allow iterator to const_iterator conversion - template<typename _Iter> - inline __normal_iterator(const __normal_iterator<_Iter, - _Container>& __i) - : _M_current(__i.base()) { } - - // Forward iterator requirements - reference - operator*() const - { return *_M_current; } - - pointer - operator->() const - { return _M_current; } - - __normal_iterator& - operator++() - { - ++_M_current; - return *this; - } - - __normal_iterator - operator++(int) - { return __normal_iterator(_M_current++); } - - // Bidirectional iterator requirements - __normal_iterator& - operator--() - { - --_M_current; - return *this; - } - - __normal_iterator - operator--(int) - { return __normal_iterator(_M_current--); } - - // Random access iterator requirements - reference - operator[](const difference_type& __n) const - { return _M_current[__n]; } - - __normal_iterator& - operator+=(const difference_type& __n) - { _M_current += __n; return *this; } - - __normal_iterator - operator+(const difference_type& __n) const - { return __normal_iterator(_M_current + __n); } - - __normal_iterator& - operator-=(const difference_type& __n) - { _M_current -= __n; return *this; } - - __normal_iterator - operator-(const difference_type& __n) const - { return __normal_iterator(_M_current - __n); } - - const _Iterator& - base() const - { return _M_current; } - }; - - // Note: In what follows, the left- and right-hand-side iterators are - // allowed to vary in types (conceptually in cv-qualification) so that - // comparaison between cv-qualified and non-cv-qualified iterators be - // valid. However, the greedy and unfriendly operators in std::rel_ops - // will make overload resolution ambiguous (when in scope) if we don't - // provide overloads whose operands are of the same type. Can someone - // remind me what generic programming is about? -- Gaby - - // Forward iterator requirements - template<typename _IteratorL, typename _IteratorR, typename _Container> - inline bool - operator==(const __normal_iterator<_IteratorL, _Container>& __lhs, - const __normal_iterator<_IteratorR, _Container>& __rhs) - { return __lhs.base() == __rhs.base(); } - - template<typename _Iterator, typename _Container> - inline bool - operator==(const __normal_iterator<_Iterator, _Container>& __lhs, - const __normal_iterator<_Iterator, _Container>& __rhs) - { return __lhs.base() == __rhs.base(); } - - template<typename _IteratorL, typename _IteratorR, typename _Container> - inline bool - operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs, - const __normal_iterator<_IteratorR, _Container>& __rhs) - { return __lhs.base() != __rhs.base(); } - - template<typename _Iterator, typename _Container> - inline bool - operator!=(const __normal_iterator<_Iterator, _Container>& __lhs, - const __normal_iterator<_Iterator, _Container>& __rhs) - { return __lhs.base() != __rhs.base(); } - - // Random access iterator requirements - template<typename _IteratorL, typename _IteratorR, typename _Container> - inline bool - operator<(const __normal_iterator<_IteratorL, _Container>& __lhs, - const __normal_iterator<_IteratorR, _Container>& __rhs) - { return __lhs.base() < __rhs.base(); } - - template<typename _Iterator, typename _Container> - inline bool - operator<(const __normal_iterator<_Iterator, _Container>& __lhs, - const __normal_iterator<_Iterator, _Container>& __rhs) - { return __lhs.base() < __rhs.base(); } - - template<typename _IteratorL, typename _IteratorR, typename _Container> - inline bool - operator>(const __normal_iterator<_IteratorL, _Container>& __lhs, - const __normal_iterator<_IteratorR, _Container>& __rhs) - { return __lhs.base() > __rhs.base(); } - - template<typename _Iterator, typename _Container> - inline bool - operator>(const __normal_iterator<_Iterator, _Container>& __lhs, - const __normal_iterator<_Iterator, _Container>& __rhs) - { return __lhs.base() > __rhs.base(); } - - template<typename _IteratorL, typename _IteratorR, typename _Container> - inline bool - operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs, - const __normal_iterator<_IteratorR, _Container>& __rhs) - { return __lhs.base() <= __rhs.base(); } - - template<typename _Iterator, typename _Container> - inline bool - operator<=(const __normal_iterator<_Iterator, _Container>& __lhs, - const __normal_iterator<_Iterator, _Container>& __rhs) - { return __lhs.base() <= __rhs.base(); } - - template<typename _IteratorL, typename _IteratorR, typename _Container> - inline bool - operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs, - const __normal_iterator<_IteratorR, _Container>& __rhs) - { return __lhs.base() >= __rhs.base(); } - - template<typename _Iterator, typename _Container> - inline bool - operator>=(const __normal_iterator<_Iterator, _Container>& __lhs, - const __normal_iterator<_Iterator, _Container>& __rhs) - { return __lhs.base() >= __rhs.base(); } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // According to the resolution of DR179 not only the various comparison - // operators but also operator- must accept mixed iterator/const_iterator - // parameters. - template<typename _IteratorL, typename _IteratorR, typename _Container> - inline typename __normal_iterator<_IteratorL, _Container>::difference_type - operator-(const __normal_iterator<_IteratorL, _Container>& __lhs, - const __normal_iterator<_IteratorR, _Container>& __rhs) - { return __lhs.base() - __rhs.base(); } - - template<typename _Iterator, typename _Container> - inline __normal_iterator<_Iterator, _Container> - operator+(typename __normal_iterator<_Iterator, _Container>::difference_type - __n, const __normal_iterator<_Iterator, _Container>& __i) - { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); } -} // namespace __gnu_cxx - -#endif - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_iterator_base_funcs.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_iterator_base_funcs.h deleted file mode 100644 index c514e81a089..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_iterator_base_funcs.h +++ /dev/null @@ -1,179 +0,0 @@ -// Functions used by iterators -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996-1998 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_iterator_base_funcs.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - * - * This file contains all of the general iterator-related utility - * functions, such as distance() and advance(). - */ - -#ifndef _ITERATOR_BASE_FUNCS_H -#define _ITERATOR_BASE_FUNCS_H 1 - -#pragma GCC system_header -#include <bits/concept_check.h> - -namespace std -{ - template<typename _InputIterator> - inline typename iterator_traits<_InputIterator>::difference_type - __distance(_InputIterator __first, _InputIterator __last, - input_iterator_tag) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - - typename iterator_traits<_InputIterator>::difference_type __n = 0; - while (__first != __last) - { - ++__first; - ++__n; - } - return __n; - } - - template<typename _RandomAccessIterator> - inline typename iterator_traits<_RandomAccessIterator>::difference_type - __distance(_RandomAccessIterator __first, _RandomAccessIterator __last, - random_access_iterator_tag) - { - // concept requirements - __glibcxx_function_requires(_RandomAccessIteratorConcept< - _RandomAccessIterator>) - return __last - __first; - } - - /** - * @brief A generalization of pointer arithmetic. - * @param first An input iterator. - * @param last An input iterator. - * @return The distance between them. - * - * Returns @c n such that first + n == last. This requires that @p last - * must be reachable from @p first. Note that @c n may be negative. - * - * For random access iterators, this uses their @c + and @c - operations - * and are constant time. For other %iterator classes they are linear time. - */ - template<typename _InputIterator> - inline typename iterator_traits<_InputIterator>::difference_type - distance(_InputIterator __first, _InputIterator __last) - { - // concept requirements -- taken care of in __distance - return std::__distance(__first, __last, - std::__iterator_category(__first)); - } - - template<typename _InputIterator, typename _Distance> - inline void - __advance(_InputIterator& __i, _Distance __n, input_iterator_tag) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - while (__n--) - ++__i; - } - - template<typename _BidirectionalIterator, typename _Distance> - inline void - __advance(_BidirectionalIterator& __i, _Distance __n, - bidirectional_iterator_tag) - { - // concept requirements - __glibcxx_function_requires(_BidirectionalIteratorConcept< - _BidirectionalIterator>) - if (__n > 0) - while (__n--) - ++__i; - else - while (__n++) - --__i; - } - - template<typename _RandomAccessIterator, typename _Distance> - inline void - __advance(_RandomAccessIterator& __i, _Distance __n, - random_access_iterator_tag) - { - // concept requirements - __glibcxx_function_requires(_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __i += __n; - } - - /** - * @brief A generalization of pointer arithmetic. - * @param i An input iterator. - * @param n The "delta" by which to change @p i. - * @return Nothing. - * - * This increments @p i by @p n. For bidirectional and random access - * iterators, @p n may be negative, in which case @p i is decremented. - * - * For random access iterators, this uses their @c + and @c - operations - * and are constant time. For other %iterator classes they are linear time. - */ - template<typename _InputIterator, typename _Distance> - inline void - advance(_InputIterator& __i, _Distance __n) - { - // concept requirements -- taken care of in __advance - std::__advance(__i, __n, std::__iterator_category(__i)); - } -} // namespace std - -#endif /* _ITERATOR_BASE_FUNCS_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_iterator_base_types.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_iterator_base_types.h deleted file mode 100644 index c3bb1c55727..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_iterator_base_types.h +++ /dev/null @@ -1,170 +0,0 @@ -// Types used in iterator implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996-1998 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_iterator_base_types.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - * - * This file contains all of the general iterator-related utility types, - * such as iterator_traits and struct iterator. - */ - -#ifndef _ITERATOR_BASE_TYPES_H -#define _ITERATOR_BASE_TYPES_H 1 - -#pragma GCC system_header - -namespace std -{ - //@{ - /** - * @defgroup iterator_tags Iterator Tags - * These are empty types, used to distinguish different iterators. The - * distinction is not made by what they contain, but simply by what they - * are. Different underlying algorithms can then be used based on the - * different operations supporetd by different iterator types. - */ - /// Marking input iterators. - struct input_iterator_tag {}; - /// Marking output iterators. - struct output_iterator_tag {}; - /// Forward iterators support a superset of input iterator operations. - struct forward_iterator_tag : public input_iterator_tag {}; - /// Bidirectional iterators support a superset of forward iterator - /// operations. - struct bidirectional_iterator_tag : public forward_iterator_tag {}; - /// Random-access iterators support a superset of bidirectional iterator - /// operations. - struct random_access_iterator_tag : public bidirectional_iterator_tag {}; - //@} - - - /** - * @brief Common %iterator class. - * - * This class does nothing but define nested typedefs. %Iterator classes - * can inherit from this class to save some work. The typedefs are then - * used in specializations and overloading. - * - * In particular, there are no default implementations of requirements - * such as @c operator++ and the like. (How could there be?) - */ - template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t, - typename _Pointer = _Tp*, typename _Reference = _Tp&> - struct iterator - { - /// One of the @link iterator_tags tag types@endlink. - typedef _Category iterator_category; - /// The type "pointed to" by the iterator. - typedef _Tp value_type; - /// Distance between iterators is represented as this type. - typedef _Distance difference_type; - /// This type represents a pointer-to-value_type. - typedef _Pointer pointer; - /// This type represents a reference-to-value_type. - typedef _Reference reference; - }; - - /** - * This class does nothing but define nested typedefs. The general - * version simply "forwards" the nested typedefs from the Iterator - * argument. Specialized versions for pointers and pointers-to-const - * provide tighter, more correct semantics. - */ - template<typename _Iterator> - struct iterator_traits - { - typedef typename _Iterator::iterator_category iterator_category; - typedef typename _Iterator::value_type value_type; - typedef typename _Iterator::difference_type difference_type; - typedef typename _Iterator::pointer pointer; - typedef typename _Iterator::reference reference; - }; - - template<typename _Tp> - struct iterator_traits<_Tp*> - { - typedef random_access_iterator_tag iterator_category; - typedef _Tp value_type; - typedef ptrdiff_t difference_type; - typedef _Tp* pointer; - typedef _Tp& reference; - }; - - template<typename _Tp> - struct iterator_traits<const _Tp*> - { - typedef random_access_iterator_tag iterator_category; - typedef _Tp value_type; - typedef ptrdiff_t difference_type; - typedef const _Tp* pointer; - typedef const _Tp& reference; - }; - - /** - * @if maint - * This function is not a part of the C++ standard but is syntactic - * sugar for internal library use only. - * @endif - */ - template<typename _Iter> - inline typename iterator_traits<_Iter>::iterator_category - __iterator_category(const _Iter&) - { return typename iterator_traits<_Iter>::iterator_category(); } - -} // namespace std - -#endif /* _ITERATOR_BASE_TYPES_H */ - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h deleted file mode 100644 index afb118bb31e..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_list.h +++ /dev/null @@ -1,1255 +0,0 @@ -// List implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_list.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _LIST_H -#define _LIST_H 1 - -#include <bits/concept_check.h> - -namespace _GLIBCXX_STD -{ - // Supporting structures are split into common and templated types; the - // latter publicly inherits from the former in an effort to reduce code - // duplication. This results in some "needless" static_cast'ing later on, - // but it's all safe downcasting. - - /// @if maint Common part of a node in the %list. @endif - struct _List_node_base - { - _List_node_base* _M_next; ///< Self-explanatory - _List_node_base* _M_prev; ///< Self-explanatory - - static void - swap(_List_node_base& __x, _List_node_base& __y); - - void - transfer(_List_node_base * const __first, - _List_node_base * const __last); - - void - reverse(); - - void - hook(_List_node_base * const __position); - - void - unhook(); - }; - - /// @if maint An actual node in the %list. @endif - template<typename _Tp> - struct _List_node : public _List_node_base - { - _Tp _M_data; ///< User's data. - }; - - /** - * @brief A list::iterator. - * - * @if maint - * All the functions are op overloads. - * @endif - */ - template<typename _Tp> - struct _List_iterator - { - typedef _List_iterator<_Tp> _Self; - typedef _List_node<_Tp> _Node; - - typedef ptrdiff_t difference_type; - typedef bidirectional_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Tp* pointer; - typedef _Tp& reference; - - _List_iterator() - : _M_node() { } - - _List_iterator(_List_node_base* __x) - : _M_node(__x) { } - - // Must downcast from List_node_base to _List_node to get to _M_data. - reference - operator*() const - { return static_cast<_Node*>(_M_node)->_M_data; } - - pointer - operator->() const - { return &static_cast<_Node*>(_M_node)->_M_data; } - - _Self& - operator++() - { - _M_node = _M_node->_M_next; - return *this; - } - - _Self - operator++(int) - { - _Self __tmp = *this; - _M_node = _M_node->_M_next; - return __tmp; - } - - _Self& - operator--() - { - _M_node = _M_node->_M_prev; - return *this; - } - - _Self - operator--(int) - { - _Self __tmp = *this; - _M_node = _M_node->_M_prev; - return __tmp; - } - - bool - operator==(const _Self& __x) const - { return _M_node == __x._M_node; } - - bool - operator!=(const _Self& __x) const - { return _M_node != __x._M_node; } - - // The only member points to the %list element. - _List_node_base* _M_node; - }; - - /** - * @brief A list::const_iterator. - * - * @if maint - * All the functions are op overloads. - * @endif - */ - template<typename _Tp> - struct _List_const_iterator - { - typedef _List_const_iterator<_Tp> _Self; - typedef const _List_node<_Tp> _Node; - typedef _List_iterator<_Tp> iterator; - - typedef ptrdiff_t difference_type; - typedef bidirectional_iterator_tag iterator_category; - typedef _Tp value_type; - typedef const _Tp* pointer; - typedef const _Tp& reference; - - _List_const_iterator() - : _M_node() { } - - _List_const_iterator(const _List_node_base* __x) - : _M_node(__x) { } - - _List_const_iterator(const iterator& __x) - : _M_node(__x._M_node) { } - - // Must downcast from List_node_base to _List_node to get to - // _M_data. - reference - operator*() const - { return static_cast<_Node*>(_M_node)->_M_data; } - - pointer - operator->() const - { return &static_cast<_Node*>(_M_node)->_M_data; } - - _Self& - operator++() - { - _M_node = _M_node->_M_next; - return *this; - } - - _Self - operator++(int) - { - _Self __tmp = *this; - _M_node = _M_node->_M_next; - return __tmp; - } - - _Self& - operator--() - { - _M_node = _M_node->_M_prev; - return *this; - } - - _Self - operator--(int) - { - _Self __tmp = *this; - _M_node = _M_node->_M_prev; - return __tmp; - } - - bool - operator==(const _Self& __x) const - { return _M_node == __x._M_node; } - - bool - operator!=(const _Self& __x) const - { return _M_node != __x._M_node; } - - // The only member points to the %list element. - const _List_node_base* _M_node; - }; - - template<typename _Val> - inline bool - operator==(const _List_iterator<_Val>& __x, - const _List_const_iterator<_Val>& __y) - { return __x._M_node == __y._M_node; } - - template<typename _Val> - inline bool - operator!=(const _List_iterator<_Val>& __x, - const _List_const_iterator<_Val>& __y) - { return __x._M_node != __y._M_node; } - - - /** - * @if maint - * See bits/stl_deque.h's _Deque_base for an explanation. - * @endif - */ - template<typename _Tp, typename _Alloc> - class _List_base - { - protected: - // NOTA BENE - // The stored instance is not actually of "allocator_type"'s - // type. Instead we rebind the type to - // Allocator<List_node<Tp>>, which according to [20.1.5]/4 - // should probably be the same. List_node<Tp> is not the same - // size as Tp (it's two pointers larger), and specializations on - // Tp may go unused because List_node<Tp> is being bound - // instead. - // - // We put this to the test in the constructors and in - // get_allocator, where we use conversions between - // allocator_type and _Node_Alloc_type. The conversion is - // required by table 32 in [20.1.5]. - typedef typename _Alloc::template rebind<_List_node<_Tp> >::other - - _Node_Alloc_type; - - struct _List_impl - : public _Node_Alloc_type { - _List_node_base _M_node; - _List_impl (const _Node_Alloc_type& __a) - : _Node_Alloc_type(__a) - { } - }; - - _List_impl _M_impl; - - _List_node<_Tp>* - _M_get_node() - { return _M_impl._Node_Alloc_type::allocate(1); } - - void - _M_put_node(_List_node<_Tp>* __p) - { _M_impl._Node_Alloc_type::deallocate(__p, 1); } - - public: - typedef _Alloc allocator_type; - - allocator_type - get_allocator() const - { return allocator_type(*static_cast<const _Node_Alloc_type*>(&this->_M_impl)); } - - _List_base(const allocator_type& __a) - : _M_impl(__a) - { _M_init(); } - - // This is what actually destroys the list. - ~_List_base() - { _M_clear(); } - - void - _M_clear(); - - void - _M_init() - { - this->_M_impl._M_node._M_next = &this->_M_impl._M_node; - this->_M_impl._M_node._M_prev = &this->_M_impl._M_node; - } - }; - - /** - * @brief A standard container with linear time access to elements, - * and fixed time insertion/deletion at any point in the sequence. - * - * @ingroup Containers - * @ingroup Sequences - * - * Meets the requirements of a <a href="tables.html#65">container</a>, a - * <a href="tables.html#66">reversible container</a>, and a - * <a href="tables.html#67">sequence</a>, including the - * <a href="tables.html#68">optional sequence requirements</a> with the - * %exception of @c at and @c operator[]. - * - * This is a @e doubly @e linked %list. Traversal up and down the - * %list requires linear time, but adding and removing elements (or - * @e nodes) is done in constant time, regardless of where the - * change takes place. Unlike std::vector and std::deque, - * random-access iterators are not provided, so subscripting ( @c - * [] ) access is not allowed. For algorithms which only need - * sequential access, this lack makes no difference. - * - * Also unlike the other standard containers, std::list provides - * specialized algorithms %unique to linked lists, such as - * splicing, sorting, and in-place reversal. - * - * @if maint - * A couple points on memory allocation for list<Tp>: - * - * First, we never actually allocate a Tp, we allocate - * List_node<Tp>'s and trust [20.1.5]/4 to DTRT. This is to ensure - * that after elements from %list<X,Alloc1> are spliced into - * %list<X,Alloc2>, destroying the memory of the second %list is a - * valid operation, i.e., Alloc1 giveth and Alloc2 taketh away. - * - * Second, a %list conceptually represented as - * @code - * A <---> B <---> C <---> D - * @endcode - * is actually circular; a link exists between A and D. The %list - * class holds (as its only data member) a private list::iterator - * pointing to @e D, not to @e A! To get to the head of the %list, - * we start at the tail and move forward by one. When this member - * iterator's next/previous pointers refer to itself, the %list is - * %empty. @endif - */ - template<typename _Tp, typename _Alloc = allocator<_Tp> > - class list : protected _List_base<_Tp, _Alloc> - { - // concept requirements - __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - - typedef _List_base<_Tp, _Alloc> _Base; - - public: - typedef _Tp value_type; - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - typedef _List_iterator<_Tp> iterator; - typedef _List_const_iterator<_Tp> const_iterator; - typedef std::reverse_iterator<const_iterator> const_reverse_iterator; - typedef std::reverse_iterator<iterator> reverse_iterator; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef typename _Base::allocator_type allocator_type; - - protected: - // Note that pointers-to-_Node's can be ctor-converted to - // iterator types. - typedef _List_node<_Tp> _Node; - - /** @if maint - * One data member plus two memory-handling functions. If the - * _Alloc type requires separate instances, then one of those - * will also be included, accumulated from the topmost parent. - * @endif - */ - using _Base::_M_impl; - using _Base::_M_put_node; - using _Base::_M_get_node; - - /** - * @if maint - * @param x An instance of user data. - * - * Allocates space for a new node and constructs a copy of @a x in it. - * @endif - */ - _Node* - _M_create_node(const value_type& __x) - { - _Node* __p = this->_M_get_node(); - try - { - std::_Construct(&__p->_M_data, __x); - } - catch(...) - { - _M_put_node(__p); - __throw_exception_again; - } - return __p; - } - - /** - * @if maint - * Allocates space for a new node and default-constructs a new - * instance of @c value_type in it. - * @endif - */ - _Node* - _M_create_node() - { - _Node* __p = this->_M_get_node(); - try - { - std::_Construct(&__p->_M_data); - } - catch(...) - { - _M_put_node(__p); - __throw_exception_again; - } - return __p; - } - - public: - // [23.2.2.1] construct/copy/destroy - // (assign() and get_allocator() are also listed in this section) - /** - * @brief Default constructor creates no elements. - */ - explicit - list(const allocator_type& __a = allocator_type()) - : _Base(__a) { } - - /** - * @brief Create a %list with copies of an exemplar element. - * @param n The number of elements to initially create. - * @param value An element to copy. - * - * This constructor fills the %list with @a n copies of @a value. - */ - list(size_type __n, const value_type& __value, - const allocator_type& __a = allocator_type()) - : _Base(__a) - { this->insert(begin(), __n, __value); } - - /** - * @brief Create a %list with default elements. - * @param n The number of elements to initially create. - * - * This constructor fills the %list with @a n copies of a - * default-constructed element. - */ - explicit - list(size_type __n) - : _Base(allocator_type()) - { this->insert(begin(), __n, value_type()); } - - /** - * @brief %List copy constructor. - * @param x A %list of identical element and allocator types. - * - * The newly-created %list uses a copy of the allocation object used - * by @a x. - */ - list(const list& __x) - : _Base(__x.get_allocator()) - { this->insert(begin(), __x.begin(), __x.end()); } - - /** - * @brief Builds a %list from a range. - * @param first An input iterator. - * @param last An input iterator. - * - * Create a %list consisting of copies of the elements from - * [@a first,@a last). This is linear in N (where N is - * distance(@a first,@a last)). - * - * @if maint - * We don't need any dispatching tricks here, because insert does all of - * that anyway. - * @endif - */ - template<typename _InputIterator> - list(_InputIterator __first, _InputIterator __last, - const allocator_type& __a = allocator_type()) - : _Base(__a) - { this->insert(begin(), __first, __last); } - - /** - * No explicit dtor needed as the _Base dtor takes care of - * things. The _Base dtor only erases the elements, and note - * that if the elements themselves are pointers, the pointed-to - * memory is not touched in any way. Managing the pointer is - * the user's responsibilty. - */ - - /** - * @brief %List assignment operator. - * @param x A %list of identical element and allocator types. - * - * All the elements of @a x are copied, but unlike the copy - * constructor, the allocator object is not copied. - */ - list& - operator=(const list& __x); - - /** - * @brief Assigns a given value to a %list. - * @param n Number of elements to be assigned. - * @param val Value to be assigned. - * - * This function fills a %list with @a n copies of the given - * value. Note that the assignment completely changes the %list - * and that the resulting %list's size is the same as the number - * of elements assigned. Old data may be lost. - */ - void - assign(size_type __n, const value_type& __val) - { _M_fill_assign(__n, __val); } - - /** - * @brief Assigns a range to a %list. - * @param first An input iterator. - * @param last An input iterator. - * - * This function fills a %list with copies of the elements in the - * range [@a first,@a last). - * - * Note that the assignment completely changes the %list and - * that the resulting %list's size is the same as the number of - * elements assigned. Old data may be lost. - */ - template<typename _InputIterator> - void - assign(_InputIterator __first, _InputIterator __last) - { - // Check whether it's an integral type. If so, it's not an iterator. - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_assign_dispatch(__first, __last, _Integral()); - } - - /// Get a copy of the memory allocation object. - allocator_type - get_allocator() const - { return _Base::get_allocator(); } - - // iterators - /** - * Returns a read/write iterator that points to the first element in the - * %list. Iteration is done in ordinary element order. - */ - iterator - begin() - { return this->_M_impl._M_node._M_next; } - - /** - * Returns a read-only (constant) iterator that points to the - * first element in the %list. Iteration is done in ordinary - * element order. - */ - const_iterator - begin() const - { return this->_M_impl._M_node._M_next; } - - /** - * Returns a read/write iterator that points one past the last - * element in the %list. Iteration is done in ordinary element - * order. - */ - iterator - end() { return &this->_M_impl._M_node; } - - /** - * Returns a read-only (constant) iterator that points one past - * the last element in the %list. Iteration is done in ordinary - * element order. - */ - const_iterator - end() const - { return &this->_M_impl._M_node; } - - /** - * Returns a read/write reverse iterator that points to the last - * element in the %list. Iteration is done in reverse element - * order. - */ - reverse_iterator - rbegin() - { return reverse_iterator(end()); } - - /** - * Returns a read-only (constant) reverse iterator that points to - * the last element in the %list. Iteration is done in reverse - * element order. - */ - const_reverse_iterator - rbegin() const - { return const_reverse_iterator(end()); } - - /** - * Returns a read/write reverse iterator that points to one - * before the first element in the %list. Iteration is done in - * reverse element order. - */ - reverse_iterator - rend() - { return reverse_iterator(begin()); } - - /** - * Returns a read-only (constant) reverse iterator that points to one - * before the first element in the %list. Iteration is done in reverse - * element order. - */ - const_reverse_iterator - rend() const - { return const_reverse_iterator(begin()); } - - // [23.2.2.2] capacity - /** - * Returns true if the %list is empty. (Thus begin() would equal - * end().) - */ - bool - empty() const - { return this->_M_impl._M_node._M_next == &this->_M_impl._M_node; } - - /** Returns the number of elements in the %list. */ - size_type - size() const - { return std::distance(begin(), end()); } - - /** Returns the size() of the largest possible %list. */ - size_type - max_size() const - { return size_type(-1); } - - /** - * @brief Resizes the %list to the specified number of elements. - * @param new_size Number of elements the %list should contain. - * @param x Data with which new elements should be populated. - * - * This function will %resize the %list to the specified number - * of elements. If the number is smaller than the %list's - * current size the %list is truncated, otherwise the %list is - * extended and new elements are populated with given data. - */ - void - resize(size_type __new_size, const value_type& __x); - - /** - * @brief Resizes the %list to the specified number of elements. - * @param new_size Number of elements the %list should contain. - * - * This function will resize the %list to the specified number of - * elements. If the number is smaller than the %list's current - * size the %list is truncated, otherwise the %list is extended - * and new elements are default-constructed. - */ - void - resize(size_type __new_size) - { this->resize(__new_size, value_type()); } - - // element access - /** - * Returns a read/write reference to the data at the first - * element of the %list. - */ - reference - front() - { return *begin(); } - - /** - * Returns a read-only (constant) reference to the data at the first - * element of the %list. - */ - const_reference - front() const - { return *begin(); } - - /** - * Returns a read/write reference to the data at the last element - * of the %list. - */ - reference - back() - { return *(--end()); } - - /** - * Returns a read-only (constant) reference to the data at the last - * element of the %list. - */ - const_reference - back() const - { return *(--end()); } - - // [23.2.2.3] modifiers - /** - * @brief Add data to the front of the %list. - * @param x Data to be added. - * - * This is a typical stack operation. The function creates an - * element at the front of the %list and assigns the given data - * to it. Due to the nature of a %list this operation can be - * done in constant time, and does not invalidate iterators and - * references. - */ - void - push_front(const value_type& __x) - { this->_M_insert(begin(), __x); } - - /** - * @brief Removes first element. - * - * This is a typical stack operation. It shrinks the %list by - * one. Due to the nature of a %list this operation can be done - * in constant time, and only invalidates iterators/references to - * the element being removed. - * - * Note that no data is returned, and if the first element's data - * is needed, it should be retrieved before pop_front() is - * called. - */ - void - pop_front() - { this->_M_erase(begin()); } - - /** - * @brief Add data to the end of the %list. - * @param x Data to be added. - * - * This is a typical stack operation. The function creates an - * element at the end of the %list and assigns the given data to - * it. Due to the nature of a %list this operation can be done - * in constant time, and does not invalidate iterators and - * references. - */ - void - push_back(const value_type& __x) - { this->_M_insert(end(), __x); } - - /** - * @brief Removes last element. - * - * This is a typical stack operation. It shrinks the %list by - * one. Due to the nature of a %list this operation can be done - * in constant time, and only invalidates iterators/references to - * the element being removed. - * - * Note that no data is returned, and if the last element's data - * is needed, it should be retrieved before pop_back() is called. - */ - void - pop_back() - { this->_M_erase(this->_M_impl._M_node._M_prev); } - - /** - * @brief Inserts given value into %list before specified iterator. - * @param position An iterator into the %list. - * @param x Data to be inserted. - * @return An iterator that points to the inserted data. - * - * This function will insert a copy of the given value before - * the specified location. Due to the nature of a %list this - * operation can be done in constant time, and does not - * invalidate iterators and references. - */ - iterator - insert(iterator __position, const value_type& __x); - - /** - * @brief Inserts a number of copies of given data into the %list. - * @param position An iterator into the %list. - * @param n Number of elements to be inserted. - * @param x Data to be inserted. - * - * This function will insert a specified number of copies of the - * given data before the location specified by @a position. - * - * Due to the nature of a %list this operation can be done in - * constant time, and does not invalidate iterators and - * references. - */ - void - insert(iterator __position, size_type __n, const value_type& __x) - { _M_fill_insert(__position, __n, __x); } - - /** - * @brief Inserts a range into the %list. - * @param position An iterator into the %list. - * @param first An input iterator. - * @param last An input iterator. - * - * This function will insert copies of the data in the range [@a - * first,@a last) into the %list before the location specified by - * @a position. - * - * Due to the nature of a %list this operation can be done in - * constant time, and does not invalidate iterators and - * references. - */ - template<typename _InputIterator> - void - insert(iterator __position, _InputIterator __first, - _InputIterator __last) - { - // Check whether it's an integral type. If so, it's not an iterator. - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_insert_dispatch(__position, __first, __last, _Integral()); - } - - /** - * @brief Remove element at given position. - * @param position Iterator pointing to element to be erased. - * @return An iterator pointing to the next element (or end()). - * - * This function will erase the element at the given position and thus - * shorten the %list by one. - * - * Due to the nature of a %list this operation can be done in - * constant time, and only invalidates iterators/references to - * the element being removed. The user is also cautioned that - * this function only erases the element, and that if the element - * is itself a pointer, the pointed-to memory is not touched in - * any way. Managing the pointer is the user's responsibilty. - */ - iterator - erase(iterator __position); - - /** - * @brief Remove a range of elements. - * @param first Iterator pointing to the first element to be erased. - * @param last Iterator pointing to one past the last element to be - * erased. - * @return An iterator pointing to the element pointed to by @a last - * prior to erasing (or end()). - * - * This function will erase the elements in the range @a - * [first,last) and shorten the %list accordingly. - * - * Due to the nature of a %list this operation can be done in - * constant time, and only invalidates iterators/references to - * the element being removed. The user is also cautioned that - * this function only erases the elements, and that if the - * elements themselves are pointers, the pointed-to memory is not - * touched in any way. Managing the pointer is the user's - * responsibilty. - */ - iterator - erase(iterator __first, iterator __last) - { - while (__first != __last) - __first = erase(__first); - return __last; - } - - /** - * @brief Swaps data with another %list. - * @param x A %list of the same element and allocator types. - * - * This exchanges the elements between two lists in constant - * time. Note that the global std::swap() function is - * specialized such that std::swap(l1,l2) will feed to this - * function. - */ - void - swap(list& __x) - { _List_node_base::swap(this->_M_impl._M_node,__x._M_impl._M_node); } - - /** - * Erases all the elements. Note that this function only erases - * the elements, and that if the elements themselves are - * pointers, the pointed-to memory is not touched in any way. - * Managing the pointer is the user's responsibilty. - */ - void - clear() - { - _Base::_M_clear(); - _Base::_M_init(); - } - - // [23.2.2.4] list operations - /** - * @brief Insert contents of another %list. - * @param position Iterator referencing the element to insert before. - * @param x Source list. - * - * The elements of @a x are inserted in constant time in front of - * the element referenced by @a position. @a x becomes an empty - * list. - */ - void - splice(iterator __position, list& __x) - { - if (!__x.empty()) - this->_M_transfer(__position, __x.begin(), __x.end()); - } - - /** - * @brief Insert element from another %list. - * @param position Iterator referencing the element to insert before. - * @param x Source list. - * @param i Iterator referencing the element to move. - * - * Removes the element in list @a x referenced by @a i and - * inserts it into the current list before @a position. - */ - void - splice(iterator __position, list&, iterator __i) - { - iterator __j = __i; - ++__j; - if (__position == __i || __position == __j) - return; - this->_M_transfer(__position, __i, __j); - } - - /** - * @brief Insert range from another %list. - * @param position Iterator referencing the element to insert before. - * @param x Source list. - * @param first Iterator referencing the start of range in x. - * @param last Iterator referencing the end of range in x. - * - * Removes elements in the range [first,last) and inserts them - * before @a position in constant time. - * - * Undefined if @a position is in [first,last). - */ - void - splice(iterator __position, list&, iterator __first, iterator __last) - { - if (__first != __last) - this->_M_transfer(__position, __first, __last); - } - - /** - * @brief Remove all elements equal to value. - * @param value The value to remove. - * - * Removes every element in the list equal to @a value. - * Remaining elements stay in list order. Note that this - * function only erases the elements, and that if the elements - * themselves are pointers, the pointed-to memory is not - * touched in any way. Managing the pointer is the user's - * responsibilty. - */ - void - remove(const _Tp& __value); - - /** - * @brief Remove all elements satisfying a predicate. - * @param Predicate Unary predicate function or object. - * - * Removes every element in the list for which the predicate - * returns true. Remaining elements stay in list order. Note - * that this function only erases the elements, and that if the - * elements themselves are pointers, the pointed-to memory is - * not touched in any way. Managing the pointer is the user's - * responsibilty. - */ - template<typename _Predicate> - void - remove_if(_Predicate); - - /** - * @brief Remove consecutive duplicate elements. - * - * For each consecutive set of elements with the same value, - * remove all but the first one. Remaining elements stay in - * list order. Note that this function only erases the - * elements, and that if the elements themselves are pointers, - * the pointed-to memory is not touched in any way. Managing - * the pointer is the user's responsibilty. - */ - void - unique(); - - /** - * @brief Remove consecutive elements satisfying a predicate. - * @param BinaryPredicate Binary predicate function or object. - * - * For each consecutive set of elements [first,last) that - * satisfy predicate(first,i) where i is an iterator in - * [first,last), remove all but the first one. Remaining - * elements stay in list order. Note that this function only - * erases the elements, and that if the elements themselves are - * pointers, the pointed-to memory is not touched in any way. - * Managing the pointer is the user's responsibilty. - */ - template<typename _BinaryPredicate> - void - unique(_BinaryPredicate); - - /** - * @brief Merge sorted lists. - * @param x Sorted list to merge. - * - * Assumes that both @a x and this list are sorted according to - * operator<(). Merges elements of @a x into this list in - * sorted order, leaving @a x empty when complete. Elements in - * this list precede elements in @a x that are equal. - */ - void - merge(list& __x); - - /** - * @brief Merge sorted lists according to comparison function. - * @param x Sorted list to merge. - * @param StrictWeakOrdering Comparison function definining - * sort order. - * - * Assumes that both @a x and this list are sorted according to - * StrictWeakOrdering. Merges elements of @a x into this list - * in sorted order, leaving @a x empty when complete. Elements - * in this list precede elements in @a x that are equivalent - * according to StrictWeakOrdering(). - */ - template<typename _StrictWeakOrdering> - void - merge(list&, _StrictWeakOrdering); - - /** - * @brief Reverse the elements in list. - * - * Reverse the order of elements in the list in linear time. - */ - void - reverse() - { this->_M_impl._M_node.reverse(); } - - /** - * @brief Sort the elements. - * - * Sorts the elements of this list in NlogN time. Equivalent - * elements remain in list order. - */ - void - sort(); - - /** - * @brief Sort the elements according to comparison function. - * - * Sorts the elements of this list in NlogN time. Equivalent - * elements remain in list order. - */ - template<typename _StrictWeakOrdering> - void - sort(_StrictWeakOrdering); - - protected: - // Internal assign functions follow. - - // Called by the range assign to implement [23.1.1]/9 - template<typename _Integer> - void - _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) - { - _M_fill_assign(static_cast<size_type>(__n), - static_cast<value_type>(__val)); - } - - // Called by the range assign to implement [23.1.1]/9 - template<typename _InputIterator> - void - _M_assign_dispatch(_InputIterator __first, _InputIterator __last, - __false_type); - - // Called by assign(n,t), and the range assign when it turns out - // to be the same thing. - void - _M_fill_assign(size_type __n, const value_type& __val); - - - // Internal insert functions follow. - - // Called by the range insert to implement [23.1.1]/9 - template<typename _Integer> - void - _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x, - __true_type) - { - _M_fill_insert(__pos, static_cast<size_type>(__n), - static_cast<value_type>(__x)); - } - - // Called by the range insert to implement [23.1.1]/9 - template<typename _InputIterator> - void - _M_insert_dispatch(iterator __pos, - _InputIterator __first, _InputIterator __last, - __false_type) - { - for ( ; __first != __last; ++__first) - _M_insert(__pos, *__first); - } - - // Called by insert(p,n,x), and the range insert when it turns out - // to be the same thing. - void - _M_fill_insert(iterator __pos, size_type __n, const value_type& __x) - { - for ( ; __n > 0; --__n) - _M_insert(__pos, __x); - } - - - // Moves the elements from [first,last) before position. - void - _M_transfer(iterator __position, iterator __first, iterator __last) - { __position._M_node->transfer(__first._M_node,__last._M_node); } - - // Inserts new element at position given and with value given. - void - _M_insert(iterator __position, const value_type& __x) - { - _Node* __tmp = _M_create_node(__x); - __tmp->hook(__position._M_node); - } - - // Erases element at position given. - void - _M_erase(iterator __position) - { - __position._M_node->unhook(); - _Node* __n = static_cast<_Node*>(__position._M_node); - std::_Destroy(&__n->_M_data); - _M_put_node(__n); - } - }; - - /** - * @brief List equality comparison. - * @param x A %list. - * @param y A %list of the same type as @a x. - * @return True iff the size and elements of the lists are equal. - * - * This is an equivalence relation. It is linear in the size of - * the lists. Lists are considered equivalent if their sizes are - * equal, and if corresponding elements compare equal. - */ - template<typename _Tp, typename _Alloc> - inline bool - operator==(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) - { - typedef typename list<_Tp,_Alloc>::const_iterator const_iterator; - const_iterator __end1 = __x.end(); - const_iterator __end2 = __y.end(); - - const_iterator __i1 = __x.begin(); - const_iterator __i2 = __y.begin(); - while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2) - { - ++__i1; - ++__i2; - } - return __i1 == __end1 && __i2 == __end2; - } - - /** - * @brief List ordering relation. - * @param x A %list. - * @param y A %list of the same type as @a x. - * @return True iff @a x is lexicographically less than @a y. - * - * This is a total ordering relation. It is linear in the size of the - * lists. The elements must be comparable with @c <. - * - * See std::lexicographical_compare() for how the determination is made. - */ - template<typename _Tp, typename _Alloc> - inline bool - operator<(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) - { return std::lexicographical_compare(__x.begin(), __x.end(), - __y.begin(), __y.end()); } - - /// Based on operator== - template<typename _Tp, typename _Alloc> - inline bool - operator!=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) - { return !(__x == __y); } - - /// Based on operator< - template<typename _Tp, typename _Alloc> - inline bool - operator>(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) - { return __y < __x; } - - /// Based on operator< - template<typename _Tp, typename _Alloc> - inline bool - operator<=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) - { return !(__y < __x); } - - /// Based on operator< - template<typename _Tp, typename _Alloc> - inline bool - operator>=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) - { return !(__x < __y); } - - /// See std::list::swap(). - template<typename _Tp, typename _Alloc> - inline void - swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y) - { __x.swap(__y); } -} // namespace std - -#endif /* _LIST_H */ - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h deleted file mode 100644 index 8535ae5f268..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_map.h +++ /dev/null @@ -1,694 +0,0 @@ -// Map implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_map.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _MAP_H -#define _MAP_H 1 - -#include <bits/concept_check.h> - -namespace _GLIBCXX_STD -{ - /** - * @brief A standard container made up of (key,value) pairs, which can be - * retrieved based on a key, in logarithmic time. - * - * @ingroup Containers - * @ingroup Assoc_containers - * - * Meets the requirements of a <a href="tables.html#65">container</a>, a - * <a href="tables.html#66">reversible container</a>, and an - * <a href="tables.html#69">associative container</a> (using unique keys). - * For a @c map<Key,T> the key_type is Key, the mapped_type is T, and the - * value_type is std::pair<const Key,T>. - * - * Maps support bidirectional iterators. - * - * @if maint - * The private tree data is declared exactly the same way for map and - * multimap; the distinction is made entirely in how the tree functions are - * called (*_unique versus *_equal, same as the standard). - * @endif - */ - template <typename _Key, typename _Tp, typename _Compare = less<_Key>, - typename _Alloc = allocator<pair<const _Key, _Tp> > > - class map - { - // concept requirements - __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - __glibcxx_class_requires4(_Compare, bool, _Key, _Key, - _BinaryFunctionConcept) - - public: - typedef _Key key_type; - typedef _Tp mapped_type; - typedef pair<const _Key, _Tp> value_type; - typedef _Compare key_compare; - - class value_compare - : public binary_function<value_type, value_type, bool> - { - friend class map<_Key,_Tp,_Compare,_Alloc>; - protected: - _Compare comp; - - value_compare(_Compare __c) - : comp(__c) { } - - public: - bool operator()(const value_type& __x, const value_type& __y) const - { return comp(__x.first, __y.first); } - }; - - private: - /// @if maint This turns a red-black tree into a [multi]map. @endif - typedef _Rb_tree<key_type, value_type, - _Select1st<value_type>, key_compare, _Alloc> _Rep_type; - /// @if maint The actual tree structure. @endif - _Rep_type _M_t; - - public: - // many of these are specified differently in ISO, but the following are - // "functionally equivalent" - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - typedef typename _Rep_type::allocator_type allocator_type; - typedef typename _Rep_type::iterator iterator; - typedef typename _Rep_type::const_iterator const_iterator; - typedef typename _Rep_type::size_type size_type; - typedef typename _Rep_type::difference_type difference_type; - typedef typename _Rep_type::reverse_iterator reverse_iterator; - typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; - - // [23.3.1.1] construct/copy/destroy - // (get_allocator() is normally listed in this section, but seems to have - // been accidentally omitted in the printed standard) - /** - * @brief Default constructor creates no elements. - */ - map() - : _M_t(_Compare(), allocator_type()) { } - - // for some reason this was made a separate function - /** - * @brief Default constructor creates no elements. - */ - explicit - map(const _Compare& __comp, const allocator_type& __a = allocator_type()) - : _M_t(__comp, __a) { } - - /** - * @brief Map copy constructor. - * @param x A %map of identical element and allocator types. - * - * The newly-created %map uses a copy of the allocation object used - * by @a x. - */ - map(const map& __x) - : _M_t(__x._M_t) { } - - /** - * @brief Builds a %map from a range. - * @param first An input iterator. - * @param last An input iterator. - * - * Create a %map consisting of copies of the elements from [first,last). - * This is linear in N if the range is already sorted, and NlogN - * otherwise (where N is distance(first,last)). - */ - template <typename _InputIterator> - map(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) - { _M_t.insert_unique(__first, __last); } - - /** - * @brief Builds a %map from a range. - * @param first An input iterator. - * @param last An input iterator. - * @param comp A comparison functor. - * @param a An allocator object. - * - * Create a %map consisting of copies of the elements from [first,last). - * This is linear in N if the range is already sorted, and NlogN - * otherwise (where N is distance(first,last)). - */ - template <typename _InputIterator> - map(_InputIterator __first, _InputIterator __last, - const _Compare& __comp, const allocator_type& __a = allocator_type()) - : _M_t(__comp, __a) - { _M_t.insert_unique(__first, __last); } - - // FIXME There is no dtor declared, but we should have something generated - // by Doxygen. I don't know what tags to add to this paragraph to make - // that happen: - /** - * The dtor only erases the elements, and note that if the elements - * themselves are pointers, the pointed-to memory is not touched in any - * way. Managing the pointer is the user's responsibilty. - */ - - /** - * @brief Map assignment operator. - * @param x A %map of identical element and allocator types. - * - * All the elements of @a x are copied, but unlike the copy constructor, - * the allocator object is not copied. - */ - map& - operator=(const map& __x) - { - _M_t = __x._M_t; - return *this; - } - - /// Get a copy of the memory allocation object. - allocator_type - get_allocator() const - { return _M_t.get_allocator(); } - - // iterators - /** - * Returns a read/write iterator that points to the first pair in the - * %map. - * Iteration is done in ascending order according to the keys. - */ - iterator - begin() - { return _M_t.begin(); } - - /** - * Returns a read-only (constant) iterator that points to the first pair - * in the %map. Iteration is done in ascending order according to the - * keys. - */ - const_iterator - begin() const - { return _M_t.begin(); } - - /** - * Returns a read/write iterator that points one past the last pair in - * the %map. Iteration is done in ascending order according to the keys. - */ - iterator - end() - { return _M_t.end(); } - - /** - * Returns a read-only (constant) iterator that points one past the last - * pair in the %map. Iteration is done in ascending order according to - * the keys. - */ - const_iterator - end() const - { return _M_t.end(); } - - /** - * Returns a read/write reverse iterator that points to the last pair in - * the %map. Iteration is done in descending order according to the - * keys. - */ - reverse_iterator - rbegin() - { return _M_t.rbegin(); } - - /** - * Returns a read-only (constant) reverse iterator that points to the - * last pair in the %map. Iteration is done in descending order - * according to the keys. - */ - const_reverse_iterator - rbegin() const - { return _M_t.rbegin(); } - - /** - * Returns a read/write reverse iterator that points to one before the - * first pair in the %map. Iteration is done in descending order - * according to the keys. - */ - reverse_iterator - rend() - { return _M_t.rend(); } - - /** - * Returns a read-only (constant) reverse iterator that points to one - * before the first pair in the %map. Iteration is done in descending - * order according to the keys. - */ - const_reverse_iterator - rend() const - { return _M_t.rend(); } - - // capacity - /** Returns true if the %map is empty. (Thus begin() would equal - * end().) - */ - bool - empty() const - { return _M_t.empty(); } - - /** Returns the size of the %map. */ - size_type - size() const - { return _M_t.size(); } - - /** Returns the maximum size of the %map. */ - size_type - max_size() const - { return _M_t.max_size(); } - - // [23.3.1.2] element access - /** - * @brief Subscript ( @c [] ) access to %map data. - * @param k The key for which data should be retrieved. - * @return A reference to the data of the (key,data) %pair. - * - * Allows for easy lookup with the subscript ( @c [] ) operator. Returns - * data associated with the key specified in subscript. If the key does - * not exist, a pair with that key is created using default values, which - * is then returned. - * - * Lookup requires logarithmic time. - */ - mapped_type& - operator[](const key_type& __k) - { - // concept requirements - __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>) - - iterator __i = lower_bound(__k); - // __i->first is greater than or equivalent to __k. - if (__i == end() || key_comp()(__k, (*__i).first)) - __i = insert(__i, value_type(__k, mapped_type())); - return (*__i).second; - } - - // modifiers - /** - * @brief Attempts to insert a std::pair into the %map. - * @param x Pair to be inserted (see std::make_pair for easy creation of - * pairs). - * @return A pair, of which the first element is an iterator that points - * to the possibly inserted pair, and the second is a bool that - * is true if the pair was actually inserted. - * - * This function attempts to insert a (key, value) %pair into the %map. - * A %map relies on unique keys and thus a %pair is only inserted if its - * first element (the key) is not already present in the %map. - * - * Insertion requires logarithmic time. - */ - pair<iterator,bool> - insert(const value_type& __x) - { return _M_t.insert_unique(__x); } - - /** - * @brief Attempts to insert a std::pair into the %map. - * @param position An iterator that serves as a hint as to where the - * pair should be inserted. - * @param x Pair to be inserted (see std::make_pair for easy creation of - * pairs). - * @return An iterator that points to the element with key of @a x (may - * or may not be the %pair passed in). - * - * This function is not concerned about whether the insertion took place, - * and thus does not return a boolean like the single-argument - * insert() does. Note that the first parameter is only a hint and can - * potentially improve the performance of the insertion process. A bad - * hint would cause no gains in efficiency. - * - * See http://gcc.gnu.org/onlinedocs/libstdc++/23_containers/howto.html#4 - * for more on "hinting". - * - * Insertion requires logarithmic time (if the hint is not taken). - */ - iterator - insert(iterator position, const value_type& __x) - { return _M_t.insert_unique(position, __x); } - - /** - * @brief A template function that attemps to insert a range of elements. - * @param first Iterator pointing to the start of the range to be - * inserted. - * @param last Iterator pointing to the end of the range. - * - * Complexity similar to that of the range constructor. - */ - template <typename _InputIterator> - void - insert(_InputIterator __first, _InputIterator __last) - { _M_t.insert_unique(__first, __last); } - - /** - * @brief Erases an element from a %map. - * @param position An iterator pointing to the element to be erased. - * - * This function erases an element, pointed to by the given iterator, - * from a %map. Note that this function only erases the element, and - * that if the element is itself a pointer, the pointed-to memory is not - * touched in any way. Managing the pointer is the user's responsibilty. - */ - void - erase(iterator __position) - { _M_t.erase(__position); } - - /** - * @brief Erases elements according to the provided key. - * @param x Key of element to be erased. - * @return The number of elements erased. - * - * This function erases all the elements located by the given key from - * a %map. - * Note that this function only erases the element, and that if - * the element is itself a pointer, the pointed-to memory is not touched - * in any way. Managing the pointer is the user's responsibilty. - */ - size_type - erase(const key_type& __x) - { return _M_t.erase(__x); } - - /** - * @brief Erases a [first,last) range of elements from a %map. - * @param first Iterator pointing to the start of the range to be - * erased. - * @param last Iterator pointing to the end of the range to be erased. - * - * This function erases a sequence of elements from a %map. - * Note that this function only erases the element, and that if - * the element is itself a pointer, the pointed-to memory is not touched - * in any way. Managing the pointer is the user's responsibilty. - */ - void - erase(iterator __first, iterator __last) - { _M_t.erase(__first, __last); } - - /** - * @brief Swaps data with another %map. - * @param x A %map of the same element and allocator types. - * - * This exchanges the elements between two maps in constant time. - * (It is only swapping a pointer, an integer, and an instance of - * the @c Compare type (which itself is often stateless and empty), so it - * should be quite fast.) - * Note that the global std::swap() function is specialized such that - * std::swap(m1,m2) will feed to this function. - */ - void - swap(map& __x) - { _M_t.swap(__x._M_t); } - - /** - * Erases all elements in a %map. Note that this function only erases - * the elements, and that if the elements themselves are pointers, the - * pointed-to memory is not touched in any way. Managing the pointer is - * the user's responsibilty. - */ - void - clear() - { _M_t.clear(); } - - // observers - /** - * Returns the key comparison object out of which the %map was - * constructed. - */ - key_compare - key_comp() const - { return _M_t.key_comp(); } - - /** - * Returns a value comparison object, built from the key comparison - * object out of which the %map was constructed. - */ - value_compare - value_comp() const - { return value_compare(_M_t.key_comp()); } - - // [23.3.1.3] map operations - /** - * @brief Tries to locate an element in a %map. - * @param x Key of (key, value) %pair to be located. - * @return Iterator pointing to sought-after element, or end() if not - * found. - * - * This function takes a key and tries to locate the element with which - * the key matches. If successful the function returns an iterator - * pointing to the sought after %pair. If unsuccessful it returns the - * past-the-end ( @c end() ) iterator. - */ - iterator - find(const key_type& __x) - { return _M_t.find(__x); } - - /** - * @brief Tries to locate an element in a %map. - * @param x Key of (key, value) %pair to be located. - * @return Read-only (constant) iterator pointing to sought-after - * element, or end() if not found. - * - * This function takes a key and tries to locate the element with which - * the key matches. If successful the function returns a constant - * iterator pointing to the sought after %pair. If unsuccessful it - * returns the past-the-end ( @c end() ) iterator. - */ - const_iterator - find(const key_type& __x) const - { return _M_t.find(__x); } - - /** - * @brief Finds the number of elements with given key. - * @param x Key of (key, value) pairs to be located. - * @return Number of elements with specified key. - * - * This function only makes sense for multimaps; for map the result will - * either be 0 (not present) or 1 (present). - */ - size_type - count(const key_type& __x) const - { return _M_t.find(__x) == _M_t.end() ? 0 : 1; } - - /** - * @brief Finds the beginning of a subsequence matching given key. - * @param x Key of (key, value) pair to be located. - * @return Iterator pointing to first element equal to or greater - * than key, or end(). - * - * This function returns the first element of a subsequence of elements - * that matches the given key. If unsuccessful it returns an iterator - * pointing to the first element that has a greater value than given key - * or end() if no such element exists. - */ - iterator - lower_bound(const key_type& __x) - { return _M_t.lower_bound(__x); } - - /** - * @brief Finds the beginning of a subsequence matching given key. - * @param x Key of (key, value) pair to be located. - * @return Read-only (constant) iterator pointing to first element - * equal to or greater than key, or end(). - * - * This function returns the first element of a subsequence of elements - * that matches the given key. If unsuccessful it returns an iterator - * pointing to the first element that has a greater value than given key - * or end() if no such element exists. - */ - const_iterator - lower_bound(const key_type& __x) const - { return _M_t.lower_bound(__x); } - - /** - * @brief Finds the end of a subsequence matching given key. - * @param x Key of (key, value) pair to be located. - * @return Iterator pointing to the first element - * greater than key, or end(). - */ - iterator - upper_bound(const key_type& __x) - { return _M_t.upper_bound(__x); } - - /** - * @brief Finds the end of a subsequence matching given key. - * @param x Key of (key, value) pair to be located. - * @return Read-only (constant) iterator pointing to first iterator - * greater than key, or end(). - */ - const_iterator - upper_bound(const key_type& __x) const - { return _M_t.upper_bound(__x); } - - /** - * @brief Finds a subsequence matching given key. - * @param x Key of (key, value) pairs to be located. - * @return Pair of iterators that possibly points to the subsequence - * matching given key. - * - * This function is equivalent to - * @code - * std::make_pair(c.lower_bound(val), - * c.upper_bound(val)) - * @endcode - * (but is faster than making the calls separately). - * - * This function probably only makes sense for multimaps. - */ - pair<iterator,iterator> - equal_range(const key_type& __x) - { return _M_t.equal_range(__x); } - - /** - * @brief Finds a subsequence matching given key. - * @param x Key of (key, value) pairs to be located. - * @return Pair of read-only (constant) iterators that possibly points - * to the subsequence matching given key. - * - * This function is equivalent to - * @code - * std::make_pair(c.lower_bound(val), - * c.upper_bound(val)) - * @endcode - * (but is faster than making the calls separately). - * - * This function probably only makes sense for multimaps. - */ - pair<const_iterator,const_iterator> - equal_range(const key_type& __x) const - { return _M_t.equal_range(__x); } - - template <typename _K1, typename _T1, typename _C1, typename _A1> - friend bool - operator== (const map<_K1,_T1,_C1,_A1>&, - const map<_K1,_T1,_C1,_A1>&); - - template <typename _K1, typename _T1, typename _C1, typename _A1> - friend bool - operator< (const map<_K1,_T1,_C1,_A1>&, - const map<_K1,_T1,_C1,_A1>&); - }; - - /** - * @brief Map equality comparison. - * @param x A %map. - * @param y A %map of the same type as @a x. - * @return True iff the size and elements of the maps are equal. - * - * This is an equivalence relation. It is linear in the size of the - * maps. Maps are considered equivalent if their sizes are equal, - * and if corresponding elements compare equal. - */ - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator==(const map<_Key,_Tp,_Compare,_Alloc>& __x, - const map<_Key,_Tp,_Compare,_Alloc>& __y) - { return __x._M_t == __y._M_t; } - - /** - * @brief Map ordering relation. - * @param x A %map. - * @param y A %map of the same type as @a x. - * @return True iff @a x is lexicographically less than @a y. - * - * This is a total ordering relation. It is linear in the size of the - * maps. The elements must be comparable with @c <. - * - * See std::lexicographical_compare() for how the determination is made. - */ - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator<(const map<_Key,_Tp,_Compare,_Alloc>& __x, - const map<_Key,_Tp,_Compare,_Alloc>& __y) - { return __x._M_t < __y._M_t; } - - /// Based on operator== - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator!=(const map<_Key,_Tp,_Compare,_Alloc>& __x, - const map<_Key,_Tp,_Compare,_Alloc>& __y) - { return !(__x == __y); } - - /// Based on operator< - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator>(const map<_Key,_Tp,_Compare,_Alloc>& __x, - const map<_Key,_Tp,_Compare,_Alloc>& __y) - { return __y < __x; } - - /// Based on operator< - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator<=(const map<_Key,_Tp,_Compare,_Alloc>& __x, - const map<_Key,_Tp,_Compare,_Alloc>& __y) - { return !(__y < __x); } - - /// Based on operator< - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator>=(const map<_Key,_Tp,_Compare,_Alloc>& __x, - const map<_Key,_Tp,_Compare,_Alloc>& __y) - { return !(__x < __y); } - - /// See std::map::swap(). - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline void - swap(map<_Key,_Tp,_Compare,_Alloc>& __x, map<_Key,_Tp,_Compare,_Alloc>& __y) - { __x.swap(__y); } -} // namespace std - -#endif /* _MAP_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_multimap.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_multimap.h deleted file mode 100644 index e080f9aaba7..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_multimap.h +++ /dev/null @@ -1,677 +0,0 @@ -// Multimap implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_multimap.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _MULTIMAP_H -#define _MULTIMAP_H 1 - -#include <bits/concept_check.h> - -namespace _GLIBCXX_STD -{ - // Forward declaration of operators < and ==, needed for friend declaration. - - template <typename _Key, typename _Tp, - typename _Compare = less<_Key>, - typename _Alloc = allocator<pair<const _Key, _Tp> > > - class multimap; - - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator==(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, - const multimap<_Key,_Tp,_Compare,_Alloc>& __y); - - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, - const multimap<_Key,_Tp,_Compare,_Alloc>& __y); - - /** - * @brief A standard container made up of (key,value) pairs, which can be - * retrieved based on a key, in logarithmic time. - * - * @ingroup Containers - * @ingroup Assoc_containers - * - * Meets the requirements of a <a href="tables.html#65">container</a>, a - * <a href="tables.html#66">reversible container</a>, and an - * <a href="tables.html#69">associative container</a> (using equivalent - * keys). For a @c multimap<Key,T> the key_type is Key, the mapped_type - * is T, and the value_type is std::pair<const Key,T>. - * - * Multimaps support bidirectional iterators. - * - * @if maint - * The private tree data is declared exactly the same way for map and - * multimap; the distinction is made entirely in how the tree functions are - * called (*_unique versus *_equal, same as the standard). - * @endif - */ - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - class multimap - { - // concept requirements - __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - __glibcxx_class_requires4(_Compare, bool, _Key, _Key, - _BinaryFunctionConcept) - - public: - typedef _Key key_type; - typedef _Tp mapped_type; - typedef pair<const _Key, _Tp> value_type; - typedef _Compare key_compare; - - class value_compare - : public binary_function<value_type, value_type, bool> - { - friend class multimap<_Key,_Tp,_Compare,_Alloc>; - protected: - _Compare comp; - - value_compare(_Compare __c) - : comp(__c) { } - - public: - bool operator()(const value_type& __x, const value_type& __y) const - { return comp(__x.first, __y.first); } - }; - - private: - /// @if maint This turns a red-black tree into a [multi]map. @endif - typedef _Rb_tree<key_type, value_type, - _Select1st<value_type>, key_compare, _Alloc> _Rep_type; - /// @if maint The actual tree structure. @endif - _Rep_type _M_t; - - public: - // many of these are specified differently in ISO, but the following are - // "functionally equivalent" - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - typedef typename _Rep_type::allocator_type allocator_type; - typedef typename _Rep_type::iterator iterator; - typedef typename _Rep_type::const_iterator const_iterator; - typedef typename _Rep_type::size_type size_type; - typedef typename _Rep_type::difference_type difference_type; - typedef typename _Rep_type::reverse_iterator reverse_iterator; - typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; - - // [23.3.2] construct/copy/destroy - // (get_allocator() is also listed in this section) - /** - * @brief Default constructor creates no elements. - */ - multimap() - : _M_t(_Compare(), allocator_type()) { } - - // for some reason this was made a separate function - /** - * @brief Default constructor creates no elements. - */ - explicit - multimap(const _Compare& __comp, - const allocator_type& __a = allocator_type()) - : _M_t(__comp, __a) { } - - /** - * @brief %Multimap copy constructor. - * @param x A %multimap of identical element and allocator types. - * - * The newly-created %multimap uses a copy of the allocation object used - * by @a x. - */ - multimap(const multimap& __x) - : _M_t(__x._M_t) { } - - /** - * @brief Builds a %multimap from a range. - * @param first An input iterator. - * @param last An input iterator. - * - * Create a %multimap consisting of copies of the elements from - * [first,last). This is linear in N if the range is already sorted, - * and NlogN otherwise (where N is distance(first,last)). - */ - template <typename _InputIterator> - multimap(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) - { _M_t.insert_equal(__first, __last); } - - /** - * @brief Builds a %multimap from a range. - * @param first An input iterator. - * @param last An input iterator. - * @param comp A comparison functor. - * @param a An allocator object. - * - * Create a %multimap consisting of copies of the elements from - * [first,last). This is linear in N if the range is already sorted, - * and NlogN otherwise (where N is distance(first,last)). - */ - template <typename _InputIterator> - multimap(_InputIterator __first, _InputIterator __last, - const _Compare& __comp, - const allocator_type& __a = allocator_type()) - : _M_t(__comp, __a) - { _M_t.insert_equal(__first, __last); } - - // FIXME There is no dtor declared, but we should have something generated - // by Doxygen. I don't know what tags to add to this paragraph to make - // that happen: - /** - * The dtor only erases the elements, and note that if the elements - * themselves are pointers, the pointed-to memory is not touched in any - * way. Managing the pointer is the user's responsibilty. - */ - - /** - * @brief %Multimap assignment operator. - * @param x A %multimap of identical element and allocator types. - * - * All the elements of @a x are copied, but unlike the copy constructor, - * the allocator object is not copied. - */ - multimap& - operator=(const multimap& __x) - { - _M_t = __x._M_t; - return *this; - } - - /// Get a copy of the memory allocation object. - allocator_type - get_allocator() const - { return _M_t.get_allocator(); } - - // iterators - /** - * Returns a read/write iterator that points to the first pair in the - * %multimap. Iteration is done in ascending order according to the - * keys. - */ - iterator - begin() - { return _M_t.begin(); } - - /** - * Returns a read-only (constant) iterator that points to the first pair - * in the %multimap. Iteration is done in ascending order according to - * the keys. - */ - const_iterator - begin() const - { return _M_t.begin(); } - - /** - * Returns a read/write iterator that points one past the last pair in - * the %multimap. Iteration is done in ascending order according to the - * keys. - */ - iterator - end() - { return _M_t.end(); } - - /** - * Returns a read-only (constant) iterator that points one past the last - * pair in the %multimap. Iteration is done in ascending order according - * to the keys. - */ - const_iterator - end() const - { return _M_t.end(); } - - /** - * Returns a read/write reverse iterator that points to the last pair in - * the %multimap. Iteration is done in descending order according to the - * keys. - */ - reverse_iterator - rbegin() - { return _M_t.rbegin(); } - - /** - * Returns a read-only (constant) reverse iterator that points to the - * last pair in the %multimap. Iteration is done in descending order - * according to the keys. - */ - const_reverse_iterator - rbegin() const - { return _M_t.rbegin(); } - - /** - * Returns a read/write reverse iterator that points to one before the - * first pair in the %multimap. Iteration is done in descending order - * according to the keys. - */ - reverse_iterator - rend() - { return _M_t.rend(); } - - /** - * Returns a read-only (constant) reverse iterator that points to one - * before the first pair in the %multimap. Iteration is done in - * descending order according to the keys. - */ - const_reverse_iterator - rend() const - { return _M_t.rend(); } - - // capacity - /** Returns true if the %multimap is empty. */ - bool - empty() const - { return _M_t.empty(); } - - /** Returns the size of the %multimap. */ - size_type - size() const - { return _M_t.size(); } - - /** Returns the maximum size of the %multimap. */ - size_type - max_size() const - { return _M_t.max_size(); } - - // modifiers - /** - * @brief Inserts a std::pair into the %multimap. - * @param x Pair to be inserted (see std::make_pair for easy creation - * of pairs). - * @return An iterator that points to the inserted (key,value) pair. - * - * This function inserts a (key, value) pair into the %multimap. - * Contrary to a std::map the %multimap does not rely on unique keys and - * thus multiple pairs with the same key can be inserted. - * - * Insertion requires logarithmic time. - */ - iterator - insert(const value_type& __x) - { return _M_t.insert_equal(__x); } - - /** - * @brief Inserts a std::pair into the %multimap. - * @param position An iterator that serves as a hint as to where the - * pair should be inserted. - * @param x Pair to be inserted (see std::make_pair for easy creation - * of pairs). - * @return An iterator that points to the inserted (key,value) pair. - * - * This function inserts a (key, value) pair into the %multimap. - * Contrary to a std::map the %multimap does not rely on unique keys and - * thus multiple pairs with the same key can be inserted. - * Note that the first parameter is only a hint and can potentially - * improve the performance of the insertion process. A bad hint would - * cause no gains in efficiency. - * - * See http://gcc.gnu.org/onlinedocs/libstdc++/23_containers/howto.html#4 - * for more on "hinting". - * - * Insertion requires logarithmic time (if the hint is not taken). - */ - iterator - insert(iterator __position, const value_type& __x) - { return _M_t.insert_equal(__position, __x); } - - /** - * @brief A template function that attemps to insert a range of elements. - * @param first Iterator pointing to the start of the range to be - * inserted. - * @param last Iterator pointing to the end of the range. - * - * Complexity similar to that of the range constructor. - */ - template <typename _InputIterator> - void - insert(_InputIterator __first, _InputIterator __last) - { _M_t.insert_equal(__first, __last); } - - /** - * @brief Erases an element from a %multimap. - * @param position An iterator pointing to the element to be erased. - * - * This function erases an element, pointed to by the given iterator, - * from a %multimap. Note that this function only erases the element, - * and that if the element is itself a pointer, the pointed-to memory is - * not touched in any way. Managing the pointer is the user's - * responsibilty. - */ - void - erase(iterator __position) - { _M_t.erase(__position); } - - /** - * @brief Erases elements according to the provided key. - * @param x Key of element to be erased. - * @return The number of elements erased. - * - * This function erases all elements located by the given key from a - * %multimap. - * Note that this function only erases the element, and that if - * the element is itself a pointer, the pointed-to memory is not touched - * in any way. Managing the pointer is the user's responsibilty. - */ - size_type - erase(const key_type& __x) - { return _M_t.erase(__x); } - - /** - * @brief Erases a [first,last) range of elements from a %multimap. - * @param first Iterator pointing to the start of the range to be - * erased. - * @param last Iterator pointing to the end of the range to be erased. - * - * This function erases a sequence of elements from a %multimap. - * Note that this function only erases the elements, and that if - * the elements themselves are pointers, the pointed-to memory is not - * touched in any way. Managing the pointer is the user's responsibilty. - */ - void - erase(iterator __first, iterator __last) - { _M_t.erase(__first, __last); } - - /** - * @brief Swaps data with another %multimap. - * @param x A %multimap of the same element and allocator types. - * - * This exchanges the elements between two multimaps in constant time. - * (It is only swapping a pointer, an integer, and an instance of - * the @c Compare type (which itself is often stateless and empty), so it - * should be quite fast.) - * Note that the global std::swap() function is specialized such that - * std::swap(m1,m2) will feed to this function. - */ - void - swap(multimap& __x) - { _M_t.swap(__x._M_t); } - - /** - * Erases all elements in a %multimap. Note that this function only - * erases the elements, and that if the elements themselves are pointers, - * the pointed-to memory is not touched in any way. Managing the pointer - * is the user's responsibilty. - */ - void - clear() - { _M_t.clear(); } - - // observers - /** - * Returns the key comparison object out of which the %multimap - * was constructed. - */ - key_compare - key_comp() const - { return _M_t.key_comp(); } - - /** - * Returns a value comparison object, built from the key comparison - * object out of which the %multimap was constructed. - */ - value_compare - value_comp() const - { return value_compare(_M_t.key_comp()); } - - // multimap operations - /** - * @brief Tries to locate an element in a %multimap. - * @param x Key of (key, value) pair to be located. - * @return Iterator pointing to sought-after element, - * or end() if not found. - * - * This function takes a key and tries to locate the element with which - * the key matches. If successful the function returns an iterator - * pointing to the sought after %pair. If unsuccessful it returns the - * past-the-end ( @c end() ) iterator. - */ - iterator - find(const key_type& __x) - { return _M_t.find(__x); } - - /** - * @brief Tries to locate an element in a %multimap. - * @param x Key of (key, value) pair to be located. - * @return Read-only (constant) iterator pointing to sought-after - * element, or end() if not found. - * - * This function takes a key and tries to locate the element with which - * the key matches. If successful the function returns a constant - * iterator pointing to the sought after %pair. If unsuccessful it - * returns the past-the-end ( @c end() ) iterator. - */ - const_iterator - find(const key_type& __x) const - { return _M_t.find(__x); } - - /** - * @brief Finds the number of elements with given key. - * @param x Key of (key, value) pairs to be located. - * @return Number of elements with specified key. - */ - size_type - count(const key_type& __x) const - { return _M_t.count(__x); } - - /** - * @brief Finds the beginning of a subsequence matching given key. - * @param x Key of (key, value) pair to be located. - * @return Iterator pointing to first element equal to or greater - * than key, or end(). - * - * This function returns the first element of a subsequence of elements - * that matches the given key. If unsuccessful it returns an iterator - * pointing to the first element that has a greater value than given key - * or end() if no such element exists. - */ - iterator - lower_bound(const key_type& __x) - { return _M_t.lower_bound(__x); } - - /** - * @brief Finds the beginning of a subsequence matching given key. - * @param x Key of (key, value) pair to be located. - * @return Read-only (constant) iterator pointing to first element - * equal to or greater than key, or end(). - * - * This function returns the first element of a subsequence of elements - * that matches the given key. If unsuccessful the iterator will point - * to the next greatest element or, if no such greater element exists, to - * end(). - */ - const_iterator - lower_bound(const key_type& __x) const - { return _M_t.lower_bound(__x); } - - /** - * @brief Finds the end of a subsequence matching given key. - * @param x Key of (key, value) pair to be located. - * @return Iterator pointing to the first element - * greater than key, or end(). - */ - iterator - upper_bound(const key_type& __x) - { return _M_t.upper_bound(__x); } - - /** - * @brief Finds the end of a subsequence matching given key. - * @param x Key of (key, value) pair to be located. - * @return Read-only (constant) iterator pointing to first iterator - * greater than key, or end(). - */ - const_iterator - upper_bound(const key_type& __x) const - { return _M_t.upper_bound(__x); } - - /** - * @brief Finds a subsequence matching given key. - * @param x Key of (key, value) pairs to be located. - * @return Pair of iterators that possibly points to the subsequence - * matching given key. - * - * This function is equivalent to - * @code - * std::make_pair(c.lower_bound(val), - * c.upper_bound(val)) - * @endcode - * (but is faster than making the calls separately). - */ - pair<iterator,iterator> - equal_range(const key_type& __x) - { return _M_t.equal_range(__x); } - - /** - * @brief Finds a subsequence matching given key. - * @param x Key of (key, value) pairs to be located. - * @return Pair of read-only (constant) iterators that possibly points - * to the subsequence matching given key. - * - * This function is equivalent to - * @code - * std::make_pair(c.lower_bound(val), - * c.upper_bound(val)) - * @endcode - * (but is faster than making the calls separately). - */ - pair<const_iterator,const_iterator> - equal_range(const key_type& __x) const - { return _M_t.equal_range(__x); } - - template <typename _K1, typename _T1, typename _C1, typename _A1> - friend bool - operator== (const multimap<_K1,_T1,_C1,_A1>&, - const multimap<_K1,_T1,_C1,_A1>&); - - template <typename _K1, typename _T1, typename _C1, typename _A1> - friend bool - operator< (const multimap<_K1,_T1,_C1,_A1>&, - const multimap<_K1,_T1,_C1,_A1>&); - }; - - /** - * @brief Multimap equality comparison. - * @param x A %multimap. - * @param y A %multimap of the same type as @a x. - * @return True iff the size and elements of the maps are equal. - * - * This is an equivalence relation. It is linear in the size of the - * multimaps. Multimaps are considered equivalent if their sizes are equal, - * and if corresponding elements compare equal. - */ - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator==(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, - const multimap<_Key,_Tp,_Compare,_Alloc>& __y) - { return __x._M_t == __y._M_t; } - - /** - * @brief Multimap ordering relation. - * @param x A %multimap. - * @param y A %multimap of the same type as @a x. - * @return True iff @a x is lexicographically less than @a y. - * - * This is a total ordering relation. It is linear in the size of the - * multimaps. The elements must be comparable with @c <. - * - * See std::lexicographical_compare() for how the determination is made. - */ - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, - const multimap<_Key,_Tp,_Compare,_Alloc>& __y) - { return __x._M_t < __y._M_t; } - - /// Based on operator== - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator!=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, - const multimap<_Key,_Tp,_Compare,_Alloc>& __y) - { return !(__x == __y); } - - /// Based on operator< - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator>(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, - const multimap<_Key,_Tp,_Compare,_Alloc>& __y) - { return __y < __x; } - - /// Based on operator< - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator<=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, - const multimap<_Key,_Tp,_Compare,_Alloc>& __y) - { return !(__y < __x); } - - /// Based on operator< - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline bool - operator>=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, - const multimap<_Key,_Tp,_Compare,_Alloc>& __y) - { return !(__x < __y); } - - /// See std::multimap::swap(). - template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> - inline void - swap(multimap<_Key,_Tp,_Compare,_Alloc>& __x, - multimap<_Key,_Tp,_Compare,_Alloc>& __y) - { __x.swap(__y); } -} // namespace std - -#endif /* _MULTIMAP_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_multiset.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_multiset.h deleted file mode 100644 index c82dee68e4e..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_multiset.h +++ /dev/null @@ -1,585 +0,0 @@ -// Multiset implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_multiset.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _MULTISET_H -#define _MULTISET_H 1 - -#include <bits/concept_check.h> - -namespace _GLIBCXX_STD -{ - - // Forward declaration of operators < and ==, needed for friend declaration. - template <class _Key, class _Compare = less<_Key>, - class _Alloc = allocator<_Key> > - class multiset; - - template <class _Key, class _Compare, class _Alloc> - inline bool - operator==(const multiset<_Key,_Compare,_Alloc>& __x, - const multiset<_Key,_Compare,_Alloc>& __y); - - template <class _Key, class _Compare, class _Alloc> - inline bool - operator<(const multiset<_Key,_Compare,_Alloc>& __x, - const multiset<_Key,_Compare,_Alloc>& __y); - - /** - * @brief A standard container made up of elements, which can be retrieved - * in logarithmic time. - * - * @ingroup Containers - * @ingroup Assoc_containers - * - * Meets the requirements of a <a href="tables.html#65">container</a>, a - * <a href="tables.html#66">reversible container</a>, and an - * <a href="tables.html#69">associative container</a> (using equivalent - * keys). For a @c multiset<Key> the key_type and value_type are Key. - * - * Multisets support bidirectional iterators. - * - * @if maint - * The private tree data is declared exactly the same way for set and - * multiset; the distinction is made entirely in how the tree functions are - * called (*_unique versus *_equal, same as the standard). - * @endif - */ - template <class _Key, class _Compare, class _Alloc> - class multiset - { - // concept requirements - __glibcxx_class_requires(_Key, _SGIAssignableConcept) - __glibcxx_class_requires4(_Compare, bool, _Key, _Key, - _BinaryFunctionConcept) - - public: - // typedefs: - typedef _Key key_type; - typedef _Key value_type; - typedef _Compare key_compare; - typedef _Compare value_compare; - - private: - /// @if maint This turns a red-black tree into a [multi]set. @endif - typedef _Rb_tree<key_type, value_type, - _Identity<value_type>, key_compare, _Alloc> _Rep_type; - /// @if maint The actual tree structure. @endif - _Rep_type _M_t; - - public: - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR 103. set::iterator is required to be modifiable, - // but this allows modification of keys. - typedef typename _Rep_type::const_iterator iterator; - typedef typename _Rep_type::const_iterator const_iterator; - typedef typename _Rep_type::const_reverse_iterator reverse_iterator; - typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; - typedef typename _Rep_type::size_type size_type; - typedef typename _Rep_type::difference_type difference_type; - typedef typename _Rep_type::allocator_type allocator_type; - - // allocation/deallocation - - /** - * @brief Default constructor creates no elements. - */ - multiset() - : _M_t(_Compare(), allocator_type()) { } - - explicit - multiset(const _Compare& __comp, - const allocator_type& __a = allocator_type()) - : _M_t(__comp, __a) { } - - /** - * @brief Builds a %multiset from a range. - * @param first An input iterator. - * @param last An input iterator. - * - * Create a %multiset consisting of copies of the elements from - * [first,last). This is linear in N if the range is already sorted, - * and NlogN otherwise (where N is distance(first,last)). - */ - template <class _InputIterator> - multiset(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) - { _M_t.insert_equal(__first, __last); } - - /** - * @brief Builds a %multiset from a range. - * @param first An input iterator. - * @param last An input iterator. - * @param comp A comparison functor. - * @param a An allocator object. - * - * Create a %multiset consisting of copies of the elements from - * [first,last). This is linear in N if the range is already sorted, - * and NlogN otherwise (where N is distance(first,last)). - */ - template <class _InputIterator> - multiset(_InputIterator __first, _InputIterator __last, - const _Compare& __comp, - const allocator_type& __a = allocator_type()) - : _M_t(__comp, __a) - { _M_t.insert_equal(__first, __last); } - - /** - * @brief %Multiset copy constructor. - * @param x A %multiset of identical element and allocator types. - * - * The newly-created %multiset uses a copy of the allocation object used - * by @a x. - */ - multiset(const multiset<_Key,_Compare,_Alloc>& __x) - : _M_t(__x._M_t) { } - - /** - * @brief %Multiset assignment operator. - * @param x A %multiset of identical element and allocator types. - * - * All the elements of @a x are copied, but unlike the copy constructor, - * the allocator object is not copied. - */ - multiset<_Key,_Compare,_Alloc>& - operator=(const multiset<_Key,_Compare,_Alloc>& __x) - { - _M_t = __x._M_t; - return *this; - } - - // accessors: - - /// Returns the comparison object. - key_compare - key_comp() const - { return _M_t.key_comp(); } - /// Returns the comparison object. - value_compare - value_comp() const - { return _M_t.key_comp(); } - /// Returns the memory allocation object. - allocator_type - get_allocator() const - { return _M_t.get_allocator(); } - - /** - * Returns a read/write iterator that points to the first element in the - * %multiset. Iteration is done in ascending order according to the - * keys. - */ - iterator - begin() const - { return _M_t.begin(); } - - /** - * Returns a read/write iterator that points one past the last element in - * the %multiset. Iteration is done in ascending order according to the - * keys. - */ - iterator - end() const - { return _M_t.end(); } - - /** - * Returns a read/write reverse iterator that points to the last element - * in the %multiset. Iteration is done in descending order according to - * the keys. - */ - reverse_iterator - rbegin() const - { return _M_t.rbegin(); } - - /** - * Returns a read/write reverse iterator that points to the last element - * in the %multiset. Iteration is done in descending order according to - * the keys. - */ - reverse_iterator - rend() const - { return _M_t.rend(); } - - /// Returns true if the %set is empty. - bool - empty() const - { return _M_t.empty(); } - - /// Returns the size of the %set. - size_type - size() const - { return _M_t.size(); } - - /// Returns the maximum size of the %set. - size_type - max_size() const - { return _M_t.max_size(); } - - /** - * @brief Swaps data with another %multiset. - * @param x A %multiset of the same element and allocator types. - * - * This exchanges the elements between two multisets in constant time. - * (It is only swapping a pointer, an integer, and an instance of the @c - * Compare type (which itself is often stateless and empty), so it should - * be quite fast.) - * Note that the global std::swap() function is specialized such that - * std::swap(s1,s2) will feed to this function. - */ - void - swap(multiset<_Key,_Compare,_Alloc>& __x) - { _M_t.swap(__x._M_t); } - - // insert/erase - /** - * @brief Inserts an element into the %multiset. - * @param x Element to be inserted. - * @return An iterator that points to the inserted element. - * - * This function inserts an element into the %multiset. Contrary - * to a std::set the %multiset does not rely on unique keys and thus - * multiple copies of the same element can be inserted. - * - * Insertion requires logarithmic time. - */ - iterator - insert(const value_type& __x) - { return _M_t.insert_equal(__x); } - - /** - * @brief Inserts an element into the %multiset. - * @param position An iterator that serves as a hint as to where the - * element should be inserted. - * @param x Element to be inserted. - * @return An iterator that points to the inserted element. - * - * This function inserts an element into the %multiset. Contrary - * to a std::set the %multiset does not rely on unique keys and thus - * multiple copies of the same element can be inserted. - * - * Note that the first parameter is only a hint and can potentially - * improve the performance of the insertion process. A bad hint would - * cause no gains in efficiency. - * - * See http://gcc.gnu.org/onlinedocs/libstdc++/23_containers/howto.html#4 - * for more on "hinting". - * - * Insertion requires logarithmic time (if the hint is not taken). - */ - iterator - insert(iterator __position, const value_type& __x) - { - typedef typename _Rep_type::iterator _Rep_iterator; - return _M_t.insert_equal((_Rep_iterator&)__position, __x); - } - - /** - * @brief A template function that attemps to insert a range of elements. - * @param first Iterator pointing to the start of the range to be - * inserted. - * @param last Iterator pointing to the end of the range. - * - * Complexity similar to that of the range constructor. - */ - template <class _InputIterator> - void - insert(_InputIterator __first, _InputIterator __last) - { _M_t.insert_equal(__first, __last); } - - /** - * @brief Erases an element from a %multiset. - * @param position An iterator pointing to the element to be erased. - * - * This function erases an element, pointed to by the given iterator, - * from a %multiset. Note that this function only erases the element, - * and that if the element is itself a pointer, the pointed-to memory is - * not touched in any way. Managing the pointer is the user's - * responsibilty. - */ - void - erase(iterator __position) - { - typedef typename _Rep_type::iterator _Rep_iterator; - _M_t.erase((_Rep_iterator&)__position); - } - - /** - * @brief Erases elements according to the provided key. - * @param x Key of element to be erased. - * @return The number of elements erased. - * - * This function erases all elements located by the given key from a - * %multiset. - * Note that this function only erases the element, and that if - * the element is itself a pointer, the pointed-to memory is not touched - * in any way. Managing the pointer is the user's responsibilty. - */ - size_type - erase(const key_type& __x) - { return _M_t.erase(__x); } - - /** - * @brief Erases a [first,last) range of elements from a %multiset. - * @param first Iterator pointing to the start of the range to be - * erased. - * @param last Iterator pointing to the end of the range to be erased. - * - * This function erases a sequence of elements from a %multiset. - * Note that this function only erases the elements, and that if - * the elements themselves are pointers, the pointed-to memory is not - * touched in any way. Managing the pointer is the user's responsibilty. - */ - void - erase(iterator __first, iterator __last) - { - typedef typename _Rep_type::iterator _Rep_iterator; - _M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last); - } - - /** - * Erases all elements in a %multiset. Note that this function only - * erases the elements, and that if the elements themselves are pointers, - * the pointed-to memory is not touched in any way. Managing the pointer - * is the user's responsibilty. - */ - void - clear() - { _M_t.clear(); } - - // multiset operations: - - /** - * @brief Finds the number of elements with given key. - * @param x Key of elements to be located. - * @return Number of elements with specified key. - */ - size_type - count(const key_type& __x) const - { return _M_t.count(__x); } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 214. set::find() missing const overload - //@{ - /** - * @brief Tries to locate an element in a %set. - * @param x Element to be located. - * @return Iterator pointing to sought-after element, or end() if not - * found. - * - * This function takes a key and tries to locate the element with which - * the key matches. If successful the function returns an iterator - * pointing to the sought after element. If unsuccessful it returns the - * past-the-end ( @c end() ) iterator. - */ - iterator - find(const key_type& __x) - { return _M_t.find(__x); } - - const_iterator - find(const key_type& __x) const - { return _M_t.find(__x); } - //@} - - //@{ - /** - * @brief Finds the beginning of a subsequence matching given key. - * @param x Key to be located. - * @return Iterator pointing to first element equal to or greater - * than key, or end(). - * - * This function returns the first element of a subsequence of elements - * that matches the given key. If unsuccessful it returns an iterator - * pointing to the first element that has a greater value than given key - * or end() if no such element exists. - */ - iterator - lower_bound(const key_type& __x) - { return _M_t.lower_bound(__x); } - - const_iterator - lower_bound(const key_type& __x) const - { return _M_t.lower_bound(__x); } - //@} - - //@{ - /** - * @brief Finds the end of a subsequence matching given key. - * @param x Key to be located. - * @return Iterator pointing to the first element - * greater than key, or end(). - */ - iterator - upper_bound(const key_type& __x) - { return _M_t.upper_bound(__x); } - - const_iterator - upper_bound(const key_type& __x) const - { return _M_t.upper_bound(__x); } - //@} - - //@{ - /** - * @brief Finds a subsequence matching given key. - * @param x Key to be located. - * @return Pair of iterators that possibly points to the subsequence - * matching given key. - * - * This function is equivalent to - * @code - * std::make_pair(c.lower_bound(val), - * c.upper_bound(val)) - * @endcode - * (but is faster than making the calls separately). - * - * This function probably only makes sense for multisets. - */ - pair<iterator,iterator> - equal_range(const key_type& __x) - { return _M_t.equal_range(__x); } - - pair<const_iterator,const_iterator> - equal_range(const key_type& __x) const - { return _M_t.equal_range(__x); } - - template <class _K1, class _C1, class _A1> - friend bool - operator== (const multiset<_K1,_C1,_A1>&, - const multiset<_K1,_C1,_A1>&); - - template <class _K1, class _C1, class _A1> - friend bool - operator< (const multiset<_K1,_C1,_A1>&, - const multiset<_K1,_C1,_A1>&); - }; - - /** - * @brief Multiset equality comparison. - * @param x A %multiset. - * @param y A %multiset of the same type as @a x. - * @return True iff the size and elements of the multisets are equal. - * - * This is an equivalence relation. It is linear in the size of the - * multisets. - * Multisets are considered equivalent if their sizes are equal, and if - * corresponding elements compare equal. - */ - template <class _Key, class _Compare, class _Alloc> - inline bool - operator==(const multiset<_Key,_Compare,_Alloc>& __x, - const multiset<_Key,_Compare,_Alloc>& __y) - { return __x._M_t == __y._M_t; } - - /** - * @brief Multiset ordering relation. - * @param x A %multiset. - * @param y A %multiset of the same type as @a x. - * @return True iff @a x is lexicographically less than @a y. - * - * This is a total ordering relation. It is linear in the size of the - * maps. The elements must be comparable with @c <. - * - * See std::lexicographical_compare() for how the determination is made. - */ - template <class _Key, class _Compare, class _Alloc> - inline bool - operator<(const multiset<_Key,_Compare,_Alloc>& __x, - const multiset<_Key,_Compare,_Alloc>& __y) - { return __x._M_t < __y._M_t; } - - /// Returns !(x == y). - template <class _Key, class _Compare, class _Alloc> - inline bool - operator!=(const multiset<_Key,_Compare,_Alloc>& __x, - const multiset<_Key,_Compare,_Alloc>& __y) - { return !(__x == __y); } - - /// Returns y < x. - template <class _Key, class _Compare, class _Alloc> - inline bool - operator>(const multiset<_Key,_Compare,_Alloc>& __x, - const multiset<_Key,_Compare,_Alloc>& __y) - { return __y < __x; } - - /// Returns !(y < x) - template <class _Key, class _Compare, class _Alloc> - inline bool - operator<=(const multiset<_Key,_Compare,_Alloc>& __x, - const multiset<_Key,_Compare,_Alloc>& __y) - { return !(__y < __x); } - - /// Returns !(x < y) - template <class _Key, class _Compare, class _Alloc> - inline bool - operator>=(const multiset<_Key,_Compare,_Alloc>& __x, - const multiset<_Key,_Compare,_Alloc>& __y) - { return !(__x < __y); } - - /// See std::multiset::swap(). - template <class _Key, class _Compare, class _Alloc> - inline void - swap(multiset<_Key,_Compare,_Alloc>& __x, - multiset<_Key,_Compare,_Alloc>& __y) - { __x.swap(__y); } - -} // namespace std - -#endif /* _MULTISET_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_numeric.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_numeric.h deleted file mode 100644 index 58762a40a7d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_numeric.h +++ /dev/null @@ -1,326 +0,0 @@ -// Numeric functions implementation -*- C++ -*- - -// Copyright (C) 2001, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_numeric.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _STL_NUMERIC_H -#define _STL_NUMERIC_H 1 - -#include <debug/debug.h> - -namespace std -{ - - /** - * @brief Accumulate values in a range. - * - * Accumulates the values in the range [first,last) using operator+(). The - * initial value is @a init. The values are processed in order. - * - * @param first Start of range. - * @param last End of range. - * @param init Starting value to add other values to. - * @return The final sum. - */ - template<typename _InputIterator, typename _Tp> - _Tp - accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first) - __init = __init + *__first; - return __init; - } - - /** - * @brief Accumulate values in a range with operation. - * - * Accumulates the values in the range [first,last) using the function - * object @a binary_op. The initial value is @a init. The values are - * processed in order. - * - * @param first Start of range. - * @param last End of range. - * @param init Starting value to add other values to. - * @param binary_op Function object to accumulate with. - * @return The final sum. - */ - template<typename _InputIterator, typename _Tp, typename _BinaryOperation> - _Tp - accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, - _BinaryOperation __binary_op) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first) - __init = __binary_op(__init, *__first); - return __init; - } - - /** - * @brief Compute inner product of two ranges. - * - * Starting with an initial value of @a init, multiplies successive - * elements from the two ranges and adds each product into the accumulated - * value using operator+(). The values in the ranges are processed in - * order. - * - * @param first1 Start of range 1. - * @param last1 End of range 1. - * @param first2 Start of range 2. - * @param init Starting value to add other values to. - * @return The final inner product. - */ - template<typename _InputIterator1, typename _InputIterator2, typename _Tp> - _Tp - inner_product(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _Tp __init) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_requires_valid_range(__first1, __last1); - - for ( ; __first1 != __last1; ++__first1, ++__first2) - __init = __init + (*__first1 * *__first2); - return __init; - } - - /** - * @brief Compute inner product of two ranges. - * - * Starting with an initial value of @a init, applies @a binary_op2 to - * successive elements from the two ranges and accumulates each result into - * the accumulated value using @a binary_op1. The values in the ranges are - * processed in order. - * - * @param first1 Start of range 1. - * @param last1 End of range 1. - * @param first2 Start of range 2. - * @param init Starting value to add other values to. - * @param binary_op1 Function object to accumulate with. - * @param binary_op2 Function object to apply to pairs of input values. - * @return The final inner product. - */ - template<typename _InputIterator1, typename _InputIterator2, typename _Tp, - typename _BinaryOperation1, typename _BinaryOperation2> - _Tp - inner_product(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _Tp __init, - _BinaryOperation1 __binary_op1, - _BinaryOperation2 __binary_op2) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_requires_valid_range(__first1, __last1); - - for ( ; __first1 != __last1; ++__first1, ++__first2) - __init = __binary_op1(__init, __binary_op2(*__first1, *__first2)); - return __init; - } - - /** - * @brief Return list of partial sums - * - * Accumulates the values in the range [first,last) using operator+(). - * As each successive input value is added into the total, that partial sum - * is written to @a result. Therefore, the first value in result is the - * first value of the input, the second value in result is the sum of the - * first and second input values, and so on. - * - * @param first Start of input range. - * @param last End of input range. - * @param result Output to write sums to. - * @return Iterator pointing just beyond the values written to result. - */ - template<typename _InputIterator, typename _OutputIterator> - _OutputIterator - partial_sum(_InputIterator __first, _InputIterator __last, - _OutputIterator __result) - { - typedef typename iterator_traits<_InputIterator>::value_type _ValueType; - - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) return __result; - *__result = *__first; - _ValueType __value = *__first; - while (++__first != __last) { - __value = __value + *__first; - *++__result = __value; - } - return ++__result; - } - - /** - * @brief Return list of partial sums - * - * Accumulates the values in the range [first,last) using operator+(). - * As each successive input value is added into the total, that partial sum - * is written to @a result. Therefore, the first value in result is the - * first value of the input, the second value in result is the sum of the - * first and second input values, and so on. - * - * @param first Start of input range. - * @param last End of input range. - * @param result Output to write sums to. - * @return Iterator pointing just beyond the values written to result. - */ - template<typename _InputIterator, typename _OutputIterator, typename _BinaryOperation> - _OutputIterator - partial_sum(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, _BinaryOperation __binary_op) - { - typedef typename iterator_traits<_InputIterator>::value_type _ValueType; - - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) return __result; - *__result = *__first; - _ValueType __value = *__first; - while (++__first != __last) { - __value = __binary_op(__value, *__first); - *++__result = __value; - } - return ++__result; - } - - /** - * @brief Return differences between adjacent values. - * - * Computes the difference between adjacent values in the range - * [first,last) using operator-() and writes the result to @a result. - * - * @param first Start of input range. - * @param last End of input range. - * @param result Output to write sums to. - * @return Iterator pointing just beyond the values written to result. - */ - template<typename _InputIterator, typename _OutputIterator> - _OutputIterator - adjacent_difference(_InputIterator __first, - _InputIterator __last, _OutputIterator __result) - { - typedef typename iterator_traits<_InputIterator>::value_type _ValueType; - - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) return __result; - *__result = *__first; - _ValueType __value = *__first; - while (++__first != __last) { - _ValueType __tmp = *__first; - *++__result = __tmp - __value; - __value = __tmp; - } - return ++__result; - } - - /** - * @brief Return differences between adjacent values. - * - * Computes the difference between adjacent values in the range - * [first,last) using the function object @a binary_op and writes the - * result to @a result. - * - * @param first Start of input range. - * @param last End of input range. - * @param result Output to write sums to. - * @return Iterator pointing just beyond the values written to result. - */ - template<typename _InputIterator, typename _OutputIterator, typename _BinaryOperation> - _OutputIterator - adjacent_difference(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, _BinaryOperation __binary_op) - { - typedef typename iterator_traits<_InputIterator>::value_type _ValueType; - - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) return __result; - *__result = *__first; - _ValueType __value = *__first; - while (++__first != __last) { - _ValueType __tmp = *__first; - *++__result = __binary_op(__tmp, __value); - __value = __tmp; - } - return ++__result; - } - -} // namespace std - -#endif /* _STL_NUMERIC_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_pair.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_pair.h deleted file mode 100644 index d5146bb5943..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_pair.h +++ /dev/null @@ -1,147 +0,0 @@ -// Pair implementation -*- C++ -*- - -// Copyright (C) 2001, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_pair.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _PAIR_H -#define _PAIR_H 1 - -namespace std -{ - /// pair holds two objects of arbitrary type. - template<class _T1, class _T2> - struct pair - { - typedef _T1 first_type; ///< @c first_type is the first bound type - typedef _T2 second_type; ///< @c second_type is the second bound type - - _T1 first; ///< @c first is a copy of the first object - _T2 second; ///< @c second is a copy of the second object - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 265. std::pair::pair() effects overly restrictive - /** The default constructor creates @c first and @c second using their - * respective default constructors. */ - pair() - : first(), second() { } - - /** Two objects may be passed to a @c pair constructor to be copied. */ - pair(const _T1& __a, const _T2& __b) - : first(__a), second(__b) { } - - /** There is also a templated copy ctor for the @c pair class itself. */ - template<class _U1, class _U2> - pair(const pair<_U1, _U2>& __p) - : first(__p.first), second(__p.second) { } - }; - - /// Two pairs of the same type are equal iff their members are equal. - template<class _T1, class _T2> - inline bool - operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) - { return __x.first == __y.first && __x.second == __y.second; } - - /// <http://gcc.gnu.org/onlinedocs/libstdc++/20_util/howto.html#pairlt> - template<class _T1, class _T2> - inline bool - operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) - { return __x.first < __y.first - || (!(__y.first < __x.first) && __x.second < __y.second); } - - /// Uses @c operator== to find the result. - template<class _T1, class _T2> - inline bool - operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) - { return !(__x == __y); } - - /// Uses @c operator< to find the result. - template<class _T1, class _T2> - inline bool - operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) - { return __y < __x; } - - /// Uses @c operator< to find the result. - template<class _T1, class _T2> - inline bool - operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) - { return !(__y < __x); } - - /// Uses @c operator< to find the result. - template<class _T1, class _T2> - inline bool - operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) - { return !(__x < __y); } - - /** - * @brief A convenience wrapper for creating a pair from two objects. - * @param x The first object. - * @param y The second object. - * @return A newly-constructed pair<> object of the appropriate type. - * - * The standard requires that the objects be passed by reference-to-const, - * but LWG issue #181 says they should be passed by const value. We follow - * the LWG by default. - */ - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 181. make_pair() unintended behavior - template<class _T1, class _T2> - inline pair<_T1, _T2> - make_pair(_T1 __x, _T2 __y) { return pair<_T1, _T2>(__x, __y); } -} // namespace std - -#endif /* _PAIR_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_queue.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_queue.h deleted file mode 100644 index 3583547dbb4..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_queue.h +++ /dev/null @@ -1,472 +0,0 @@ -// Queue implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_queue.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _QUEUE_H -#define _QUEUE_H 1 - -#include <bits/concept_check.h> -#include <debug/debug.h> - -namespace std -{ - // Forward declarations of operators < and ==, needed for friend declaration. - template<typename _Tp, typename _Sequence = deque<_Tp> > - class queue; - - template<typename _Tp, typename _Seq> - inline bool - operator==(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&); - - template<typename _Tp, typename _Seq> - inline bool - operator<(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&); - - /** - * @brief A standard container giving FIFO behavior. - * - * @ingroup Containers - * @ingroup Sequences - * - * Meets many of the requirements of a - * <a href="tables.html#65">container</a>, - * but does not define anything to do with iterators. Very few of the - * other standard container interfaces are defined. - * - * This is not a true container, but an @e adaptor. It holds another - * container, and provides a wrapper interface to that container. The - * wrapper is what enforces strict first-in-first-out %queue behavior. - * - * The second template parameter defines the type of the underlying - * sequence/container. It defaults to std::deque, but it can be any type - * that supports @c front, @c back, @c push_back, and @c pop_front, - * such as std::list or an appropriate user-defined type. - * - * Members not found in "normal" containers are @c container_type, - * which is a typedef for the second Sequence parameter, and @c push and - * @c pop, which are standard %queue/FIFO operations. - */ - template<typename _Tp, typename _Sequence> - class queue - { - // concept requirements - typedef typename _Sequence::value_type _Sequence_value_type; - __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - __glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept) - __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept) - __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) - - template<typename _Tp1, typename _Seq1> - friend bool - operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&); - - template<typename _Tp1, typename _Seq1> - friend bool - operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&); - - public: - typedef typename _Sequence::value_type value_type; - typedef typename _Sequence::reference reference; - typedef typename _Sequence::const_reference const_reference; - typedef typename _Sequence::size_type size_type; - typedef _Sequence container_type; - - protected: - /** - * 'c' is the underlying container. Maintainers wondering why - * this isn't uglified as per style guidelines should note that - * this name is specified in the standard, [23.2.3.1]. (Why? - * Presumably for the same reason that it's protected instead - * of private: to allow derivation. But none of the other - * containers allow for derivation. Odd.) - */ - _Sequence c; - - public: - /** - * @brief Default constructor creates no elements. - */ - explicit - queue(const _Sequence& __c = _Sequence()) : c(__c) {} - - /** - * Returns true if the %queue is empty. - */ - bool - empty() const - { return c.empty(); } - - /** Returns the number of elements in the %queue. */ - size_type - size() const - { return c.size(); } - - /** - * Returns a read/write reference to the data at the first - * element of the %queue. - */ - reference - front() - { - __glibcxx_requires_nonempty(); - return c.front(); - } - - /** - * Returns a read-only (constant) reference to the data at the first - * element of the %queue. - */ - const_reference - front() const - { - __glibcxx_requires_nonempty(); - return c.front(); - } - - /** - * Returns a read/write reference to the data at the last - * element of the %queue. - */ - reference - back() - { - __glibcxx_requires_nonempty(); - return c.back(); - } - - /** - * Returns a read-only (constant) reference to the data at the last - * element of the %queue. - */ - const_reference - back() const - { - __glibcxx_requires_nonempty(); - return c.back(); - } - - /** - * @brief Add data to the end of the %queue. - * @param x Data to be added. - * - * This is a typical %queue operation. The function creates an - * element at the end of the %queue and assigns the given data - * to it. The time complexity of the operation depends on the - * underlying sequence. - */ - void - push(const value_type& __x) - { c.push_back(__x); } - - /** - * @brief Removes first element. - * - * This is a typical %queue operation. It shrinks the %queue by one. - * The time complexity of the operation depends on the underlying - * sequence. - * - * Note that no data is returned, and if the first element's - * data is needed, it should be retrieved before pop() is - * called. - */ - void - pop() - { - __glibcxx_requires_nonempty(); - c.pop_front(); - } - }; - - - /** - * @brief Queue equality comparison. - * @param x A %queue. - * @param y A %queue of the same type as @a x. - * @return True iff the size and elements of the queues are equal. - * - * This is an equivalence relation. Complexity and semantics depend on the - * underlying sequence type, but the expected rules are: this relation is - * linear in the size of the sequences, and queues are considered equivalent - * if their sequences compare equal. - */ - template<typename _Tp, typename _Sequence> - inline bool - operator==(const queue<_Tp,_Sequence>& __x, - const queue<_Tp,_Sequence>& __y) - { return __x.c == __y.c; } - - /** - * @brief Queue ordering relation. - * @param x A %queue. - * @param y A %queue of the same type as @a x. - * @return True iff @a x is lexicographically less than @a y. - * - * This is an total ordering relation. Complexity and semantics - * depend on the underlying sequence type, but the expected rules - * are: this relation is linear in the size of the sequences, the - * elements must be comparable with @c <, and - * std::lexicographical_compare() is usually used to make the - * determination. - */ - template<typename _Tp, typename _Sequence> - inline bool - operator<(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y) - { return __x.c < __y.c; } - - /// Based on operator== - template<typename _Tp, typename _Sequence> - inline bool - operator!=(const queue<_Tp,_Sequence>& __x, - const queue<_Tp,_Sequence>& __y) - { return !(__x == __y); } - - /// Based on operator< - template<typename _Tp, typename _Sequence> - inline bool - operator>(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y) - { return __y < __x; } - - /// Based on operator< - template<typename _Tp, typename _Sequence> - inline bool - operator<=(const queue<_Tp,_Sequence>& __x, - const queue<_Tp,_Sequence>& __y) - { return !(__y < __x); } - - /// Based on operator< - template<typename _Tp, typename _Sequence> - inline bool - operator>=(const queue<_Tp,_Sequence>& __x, - const queue<_Tp,_Sequence>& __y) - { return !(__x < __y); } - - /** - * @brief A standard container automatically sorting its contents. - * - * @ingroup Containers - * @ingroup Sequences - * - * This is not a true container, but an @e adaptor. It holds - * another container, and provides a wrapper interface to that - * container. The wrapper is what enforces sorting and - * first-in-first-out %queue behavior. Very few of the standard - * container/sequence interface requirements are met (e.g., - * iterators). - * - * The second template parameter defines the type of the underlying - * sequence/container. It defaults to std::vector, but it can be - * any type that supports @c front(), @c push_back, @c pop_back, - * and random-access iterators, such as std::deque or an - * appropriate user-defined type. - * - * The third template parameter supplies the means of making - * priority comparisons. It defaults to @c less<value_type> but - * can be anything defining a strict weak ordering. - * - * Members not found in "normal" containers are @c container_type, - * which is a typedef for the second Sequence parameter, and @c - * push, @c pop, and @c top, which are standard %queue/FIFO - * operations. - * - * @note No equality/comparison operators are provided for - * %priority_queue. - * - * @note Sorting of the elements takes place as they are added to, - * and removed from, the %priority_queue using the - * %priority_queue's member functions. If you access the elements - * by other means, and change their data such that the sorting - * order would be different, the %priority_queue will not re-sort - * the elements for you. (How could it know to do so?) - */ - template<typename _Tp, typename _Sequence = vector<_Tp>, - typename _Compare = less<typename _Sequence::value_type> > - class priority_queue - { - // concept requirements - typedef typename _Sequence::value_type _Sequence_value_type; - __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - __glibcxx_class_requires(_Sequence, _SequenceConcept) - __glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept) - __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) - __glibcxx_class_requires4(_Compare, bool, _Tp,_Tp,_BinaryFunctionConcept) - - public: - typedef typename _Sequence::value_type value_type; - typedef typename _Sequence::reference reference; - typedef typename _Sequence::const_reference const_reference; - typedef typename _Sequence::size_type size_type; - typedef _Sequence container_type; - - protected: - // See queue::c for notes on these names. - _Sequence c; - _Compare comp; - - public: - /** - * @brief Default constructor creates no elements. - */ - explicit - priority_queue(const _Compare& __x = _Compare(), - const _Sequence& __s = _Sequence()) - : c(__s), comp(__x) - { std::make_heap(c.begin(), c.end(), comp); } - - /** - * @brief Builds a %queue from a range. - * @param first An input iterator. - * @param last An input iterator. - * @param x A comparison functor describing a strict weak ordering. - * @param s An initial sequence with which to start. - * - * Begins by copying @a s, inserting a copy of the elements - * from @a [first,last) into the copy of @a s, then ordering - * the copy according to @a x. - * - * For more information on function objects, see the - * documentation on @link s20_3_1_base functor base - * classes@endlink. - */ - template<typename _InputIterator> - priority_queue(_InputIterator __first, _InputIterator __last, - const _Compare& __x = _Compare(), - const _Sequence& __s = _Sequence()) - : c(__s), comp(__x) - { - __glibcxx_requires_valid_range(__first, __last); - c.insert(c.end(), __first, __last); - std::make_heap(c.begin(), c.end(), comp); - } - - /** - * Returns true if the %queue is empty. - */ - bool - empty() const { return c.empty(); } - - /** Returns the number of elements in the %queue. */ - size_type - size() const { return c.size(); } - - /** - * Returns a read-only (constant) reference to the data at the first - * element of the %queue. - */ - const_reference - top() const - { - __glibcxx_requires_nonempty(); - return c.front(); - } - - /** - * @brief Add data to the %queue. - * @param x Data to be added. - * - * This is a typical %queue operation. - * The time complexity of the operation depends on the underlying - * sequence. - */ - void - push(const value_type& __x) - { - try - { - c.push_back(__x); - std::push_heap(c.begin(), c.end(), comp); - } - catch(...) - { - c.clear(); - __throw_exception_again; - } - } - - /** - * @brief Removes first element. - * - * This is a typical %queue operation. It shrinks the %queue - * by one. The time complexity of the operation depends on the - * underlying sequence. - * - * Note that no data is returned, and if the first element's - * data is needed, it should be retrieved before pop() is - * called. - */ - void - pop() - { - __glibcxx_requires_nonempty(); - try - { - std::pop_heap(c.begin(), c.end(), comp); - c.pop_back(); - } - catch(...) - { - c.clear(); - __throw_exception_again; - } - } - }; - - // No equality/comparison operators are provided for priority_queue. -} // namespace std - -#endif /* _QUEUE_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_raw_storage_iter.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_raw_storage_iter.h deleted file mode 100644 index 732142e1e6b..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_raw_storage_iter.h +++ /dev/null @@ -1,113 +0,0 @@ -// -*- C++ -*- - -// Copyright (C) 2001, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_raw_storage_iter.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _STL_RAW_STORAGE_ITERATOR_H -#define _STL_RAW_STORAGE_ITERATOR_H 1 - -namespace std -{ - /** - * This iterator class lets algorithms store their results into - * uninitialized memory. - */ - template <class _ForwardIterator, class _Tp> - class raw_storage_iterator - : public iterator<output_iterator_tag, void, void, void, void> - { - protected: - _ForwardIterator _M_iter; - - public: - explicit - raw_storage_iterator(_ForwardIterator __x) - : _M_iter(__x) {} - - raw_storage_iterator& - operator*() { return *this; } - - raw_storage_iterator& - operator=(const _Tp& __element) - { - std::_Construct(&*_M_iter, __element); - return *this; - } - - raw_storage_iterator<_ForwardIterator, _Tp>& - operator++() - { - ++_M_iter; - return *this; - } - - raw_storage_iterator<_ForwardIterator, _Tp> - operator++(int) - { - raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this; - ++_M_iter; - return __tmp; - } - }; -} // namespace std - -#endif - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_relops.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_relops.h deleted file mode 100644 index 3e9f060f287..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_relops.h +++ /dev/null @@ -1,137 +0,0 @@ -// std::rel_ops implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * Copyright (c) 1996,1997 - * Silicon Graphics - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -/** @file stl_relops.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - * - * @if maint - * Inclusion of this file has been removed from - * all of the other STL headers for safety reasons, except std_utility.h. - * For more information, see the thread of about twenty messages starting - * with http://gcc.gnu.org/ml/libstdc++/2001-01/msg00223.html , or the - * FAQ at http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#4_4 . - * - * Short summary: the rel_ops operators should be avoided for the present. - * @endif - */ - -#ifndef _STL_RELOPS_H -#define _STL_RELOPS_H 1 - -namespace std -{ - namespace rel_ops - { - /** @namespace std::rel_ops - * @brief The generated relational operators are sequestered here. - */ - - /** - * @brief Defines @c != for arbitrary types, in terms of @c ==. - * @param x A thing. - * @param y Another thing. - * @return x != y - * - * This function uses @c == to determine its result. - */ - template <class _Tp> - inline bool - operator!=(const _Tp& __x, const _Tp& __y) - { return !(__x == __y); } - - /** - * @brief Defines @c > for arbitrary types, in terms of @c <. - * @param x A thing. - * @param y Another thing. - * @return x > y - * - * This function uses @c < to determine its result. - */ - template <class _Tp> - inline bool - operator>(const _Tp& __x, const _Tp& __y) - { return __y < __x; } - - /** - * @brief Defines @c <= for arbitrary types, in terms of @c <. - * @param x A thing. - * @param y Another thing. - * @return x <= y - * - * This function uses @c < to determine its result. - */ - template <class _Tp> - inline bool - operator<=(const _Tp& __x, const _Tp& __y) - { return !(__y < __x); } - - /** - * @brief Defines @c >= for arbitrary types, in terms of @c <. - * @param x A thing. - * @param y Another thing. - * @return x >= y - * - * This function uses @c < to determine its result. - */ - template <class _Tp> - inline bool - operator>=(const _Tp& __x, const _Tp& __y) - { return !(__x < __y); } - - } // namespace rel_ops -} // namespace std - -#endif /* _STL_RELOPS_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_set.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_set.h deleted file mode 100644 index bb28bddc7af..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_set.h +++ /dev/null @@ -1,593 +0,0 @@ -// Set implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_set.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _SET_H -#define _SET_H 1 - -#include <bits/concept_check.h> - -namespace _GLIBCXX_STD -{ - // Forward declarations of operators < and ==, needed for friend declaration. - template<class _Key, class _Compare = less<_Key>, - class _Alloc = allocator<_Key> > - class set; - - template<class _Key, class _Compare, class _Alloc> - inline bool - operator==(const set<_Key,_Compare,_Alloc>& __x, - const set<_Key,_Compare,_Alloc>& __y); - - template<class _Key, class _Compare, class _Alloc> - inline bool - operator<(const set<_Key,_Compare,_Alloc>& __x, - const set<_Key,_Compare,_Alloc>& __y); - - /** - * @brief A standard container made up of unique keys, which can be - * retrieved in logarithmic time. - * - * @ingroup Containers - * @ingroup Assoc_containers - * - * Meets the requirements of a <a href="tables.html#65">container</a>, a - * <a href="tables.html#66">reversible container</a>, and an - * <a href="tables.html#69">associative container</a> (using unique keys). - * - * Sets support bidirectional iterators. - * - * @param Key Type of key objects. - * @param Compare Comparison function object type, defaults to less<Key>. - * @param Alloc Allocator type, defaults to allocator<Key>. - * - * @if maint - * The private tree data is declared exactly the same way for set and - * multiset; the distinction is made entirely in how the tree functions are - * called (*_unique versus *_equal, same as the standard). - * @endif - */ - template<class _Key, class _Compare, class _Alloc> - class set - { - // concept requirements - __glibcxx_class_requires(_Key, _SGIAssignableConcept) - __glibcxx_class_requires4(_Compare, bool, _Key, _Key, - _BinaryFunctionConcept) - - public: - // typedefs: - //@{ - /// Public typedefs. - typedef _Key key_type; - typedef _Key value_type; - typedef _Compare key_compare; - typedef _Compare value_compare; - //@} - - private: - typedef _Rb_tree<key_type, value_type, - _Identity<value_type>, key_compare, _Alloc> _Rep_type; - _Rep_type _M_t; // red-black tree representing set - public: - //@{ - /// Iterator-related typedefs. - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // DR 103. set::iterator is required to be modifiable, - // but this allows modification of keys. - typedef typename _Rep_type::const_iterator iterator; - typedef typename _Rep_type::const_iterator const_iterator; - typedef typename _Rep_type::const_reverse_iterator reverse_iterator; - typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; - typedef typename _Rep_type::size_type size_type; - typedef typename _Rep_type::difference_type difference_type; - typedef typename _Rep_type::allocator_type allocator_type; - //@} - - // allocation/deallocation - /// Default constructor creates no elements. - set() - : _M_t(_Compare(), allocator_type()) {} - - /** - * @brief Default constructor creates no elements. - * - * @param comp Comparator to use. - * @param a Allocator to use. - */ - explicit set(const _Compare& __comp, - const allocator_type& __a = allocator_type()) - : _M_t(__comp, __a) {} - - /** - * @brief Builds a %set from a range. - * @param first An input iterator. - * @param last An input iterator. - * - * Create a %set consisting of copies of the elements from [first,last). - * This is linear in N if the range is already sorted, and NlogN - * otherwise (where N is distance(first,last)). - */ - template<class _InputIterator> - set(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) - { _M_t.insert_unique(__first, __last); } - - /** - * @brief Builds a %set from a range. - * @param first An input iterator. - * @param last An input iterator. - * @param comp A comparison functor. - * @param a An allocator object. - * - * Create a %set consisting of copies of the elements from [first,last). - * This is linear in N if the range is already sorted, and NlogN - * otherwise (where N is distance(first,last)). - */ - template<class _InputIterator> - set(_InputIterator __first, _InputIterator __last, - const _Compare& __comp, - const allocator_type& __a = allocator_type()) - : _M_t(__comp, __a) - { _M_t.insert_unique(__first, __last); } - - /** - * @brief Set copy constructor. - * @param x A %set of identical element and allocator types. - * - * The newly-created %set uses a copy of the allocation object used - * by @a x. - */ - set(const set<_Key,_Compare,_Alloc>& __x) - : _M_t(__x._M_t) { } - - /** - * @brief Set assignment operator. - * @param x A %set of identical element and allocator types. - * - * All the elements of @a x are copied, but unlike the copy constructor, - * the allocator object is not copied. - */ - set<_Key,_Compare,_Alloc>& - operator=(const set<_Key, _Compare, _Alloc>& __x) - { - _M_t = __x._M_t; - return *this; - } - - // accessors: - - /// Returns the comparison object with which the %set was constructed. - key_compare - key_comp() const - { return _M_t.key_comp(); } - /// Returns the comparison object with which the %set was constructed. - value_compare - value_comp() const - { return _M_t.key_comp(); } - /// Returns the allocator object with which the %set was constructed. - allocator_type - get_allocator() const - { return _M_t.get_allocator(); } - - /** - * Returns a read/write iterator that points to the first element in the - * %set. Iteration is done in ascending order according to the keys. - */ - iterator - begin() const - { return _M_t.begin(); } - - /** - * Returns a read/write iterator that points one past the last element in - * the %set. Iteration is done in ascending order according to the keys. - */ - iterator - end() const - { return _M_t.end(); } - - /** - * Returns a read/write reverse iterator that points to the last element - * in the %set. Iteration is done in descending order according to the - * keys. - */ - reverse_iterator - rbegin() const - { return _M_t.rbegin(); } - - /** - * Returns a read-only (constant) reverse iterator that points to the - * last pair in the %map. Iteration is done in descending order - * according to the keys. - */ - reverse_iterator - rend() const - { return _M_t.rend(); } - - /// Returns true if the %set is empty. - bool - empty() const - { return _M_t.empty(); } - - /// Returns the size of the %set. - size_type - size() const - { return _M_t.size(); } - - /// Returns the maximum size of the %set. - size_type - max_size() const - { return _M_t.max_size(); } - - /** - * @brief Swaps data with another %set. - * @param x A %set of the same element and allocator types. - * - * This exchanges the elements between two sets in constant time. - * (It is only swapping a pointer, an integer, and an instance of - * the @c Compare type (which itself is often stateless and empty), so it - * should be quite fast.) - * Note that the global std::swap() function is specialized such that - * std::swap(s1,s2) will feed to this function. - */ - void - swap(set<_Key,_Compare,_Alloc>& __x) - { _M_t.swap(__x._M_t); } - - // insert/erase - /** - * @brief Attempts to insert an element into the %set. - * @param x Element to be inserted. - * @return A pair, of which the first element is an iterator that points - * to the possibly inserted element, and the second is a bool - * that is true if the element was actually inserted. - * - * This function attempts to insert an element into the %set. A %set - * relies on unique keys and thus an element is only inserted if it is - * not already present in the %set. - * - * Insertion requires logarithmic time. - */ - pair<iterator,bool> - insert(const value_type& __x) - { - pair<typename _Rep_type::iterator, bool> __p = _M_t.insert_unique(__x); - return pair<iterator, bool>(__p.first, __p.second); - } - - /** - * @brief Attempts to insert an element into the %set. - * @param position An iterator that serves as a hint as to where the - * element should be inserted. - * @param x Element to be inserted. - * @return An iterator that points to the element with key of @a x (may - * or may not be the element passed in). - * - * This function is not concerned about whether the insertion took place, - * and thus does not return a boolean like the single-argument insert() - * does. Note that the first parameter is only a hint and can - * potentially improve the performance of the insertion process. A bad - * hint would cause no gains in efficiency. - * - * See http://gcc.gnu.org/onlinedocs/libstdc++/23_containers/howto.html#4 - * for more on "hinting". - * - * Insertion requires logarithmic time (if the hint is not taken). - */ - iterator - insert(iterator __position, const value_type& __x) - { - typedef typename _Rep_type::iterator _Rep_iterator; - return _M_t.insert_unique((_Rep_iterator&)__position, __x); - } - - /** - * @brief A template function that attemps to insert a range of elements. - * @param first Iterator pointing to the start of the range to be - * inserted. - * @param last Iterator pointing to the end of the range. - * - * Complexity similar to that of the range constructor. - */ - template<class _InputIterator> - void - insert(_InputIterator __first, _InputIterator __last) - { _M_t.insert_unique(__first, __last); } - - /** - * @brief Erases an element from a %set. - * @param position An iterator pointing to the element to be erased. - * - * This function erases an element, pointed to by the given iterator, - * from a %set. Note that this function only erases the element, and - * that if the element is itself a pointer, the pointed-to memory is not - * touched in any way. Managing the pointer is the user's responsibilty. - */ - void - erase(iterator __position) - { - typedef typename _Rep_type::iterator _Rep_iterator; - _M_t.erase((_Rep_iterator&)__position); - } - - /** - * @brief Erases elements according to the provided key. - * @param x Key of element to be erased. - * @return The number of elements erased. - * - * This function erases all the elements located by the given key from - * a %set. - * Note that this function only erases the element, and that if - * the element is itself a pointer, the pointed-to memory is not touched - * in any way. Managing the pointer is the user's responsibilty. - */ - size_type - erase(const key_type& __x) { return _M_t.erase(__x); } - - /** - * @brief Erases a [first,last) range of elements from a %set. - * @param first Iterator pointing to the start of the range to be - * erased. - * @param last Iterator pointing to the end of the range to be erased. - * - * This function erases a sequence of elements from a %set. - * Note that this function only erases the element, and that if - * the element is itself a pointer, the pointed-to memory is not touched - * in any way. Managing the pointer is the user's responsibilty. - */ - void - erase(iterator __first, iterator __last) - { - typedef typename _Rep_type::iterator _Rep_iterator; - _M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last); - } - - /** - * Erases all elements in a %set. Note that this function only erases - * the elements, and that if the elements themselves are pointers, the - * pointed-to memory is not touched in any way. Managing the pointer is - * the user's responsibilty. - */ - void - clear() - { _M_t.clear(); } - - // set operations: - - /** - * @brief Finds the number of elements. - * @param x Element to located. - * @return Number of elements with specified key. - * - * This function only makes sense for multisets; for set the result will - * either be 0 (not present) or 1 (present). - */ - size_type - count(const key_type& __x) const - { return _M_t.find(__x) == _M_t.end() ? 0 : 1; } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 214. set::find() missing const overload - //@{ - /** - * @brief Tries to locate an element in a %set. - * @param x Element to be located. - * @return Iterator pointing to sought-after element, or end() if not - * found. - * - * This function takes a key and tries to locate the element with which - * the key matches. If successful the function returns an iterator - * pointing to the sought after element. If unsuccessful it returns the - * past-the-end ( @c end() ) iterator. - */ - iterator - find(const key_type& __x) - { return _M_t.find(__x); } - - const_iterator - find(const key_type& __x) const - { return _M_t.find(__x); } - //@} - - //@{ - /** - * @brief Finds the beginning of a subsequence matching given key. - * @param x Key to be located. - * @return Iterator pointing to first element equal to or greater - * than key, or end(). - * - * This function returns the first element of a subsequence of elements - * that matches the given key. If unsuccessful it returns an iterator - * pointing to the first element that has a greater value than given key - * or end() if no such element exists. - */ - iterator - lower_bound(const key_type& __x) - { return _M_t.lower_bound(__x); } - - const_iterator - lower_bound(const key_type& __x) const - { return _M_t.lower_bound(__x); } - //@} - - //@{ - /** - * @brief Finds the end of a subsequence matching given key. - * @param x Key to be located. - * @return Iterator pointing to the first element - * greater than key, or end(). - */ - iterator - upper_bound(const key_type& __x) - { return _M_t.upper_bound(__x); } - - const_iterator - upper_bound(const key_type& __x) const - { return _M_t.upper_bound(__x); } - //@} - - //@{ - /** - * @brief Finds a subsequence matching given key. - * @param x Key to be located. - * @return Pair of iterators that possibly points to the subsequence - * matching given key. - * - * This function is equivalent to - * @code - * std::make_pair(c.lower_bound(val), - * c.upper_bound(val)) - * @endcode - * (but is faster than making the calls separately). - * - * This function probably only makes sense for multisets. - */ - pair<iterator,iterator> - equal_range(const key_type& __x) - { return _M_t.equal_range(__x); } - - pair<const_iterator,const_iterator> - equal_range(const key_type& __x) const - { return _M_t.equal_range(__x); } - //@} - - template<class _K1, class _C1, class _A1> - friend bool - operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&); - - template<class _K1, class _C1, class _A1> - friend bool - operator< (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&); - }; - - - /** - * @brief Set equality comparison. - * @param x A %set. - * @param y A %set of the same type as @a x. - * @return True iff the size and elements of the sets are equal. - * - * This is an equivalence relation. It is linear in the size of the sets. - * Sets are considered equivalent if their sizes are equal, and if - * corresponding elements compare equal. - */ - template<class _Key, class _Compare, class _Alloc> - inline bool - operator==(const set<_Key,_Compare,_Alloc>& __x, - const set<_Key,_Compare,_Alloc>& __y) - { return __x._M_t == __y._M_t; } - - /** - * @brief Set ordering relation. - * @param x A %set. - * @param y A %set of the same type as @a x. - * @return True iff @a x is lexicographically less than @a y. - * - * This is a total ordering relation. It is linear in the size of the - * maps. The elements must be comparable with @c <. - * - * See std::lexicographical_compare() for how the determination is made. - */ - template<class _Key, class _Compare, class _Alloc> - inline bool - operator<(const set<_Key,_Compare,_Alloc>& __x, - const set<_Key,_Compare,_Alloc>& __y) - { return __x._M_t < __y._M_t; } - - /// Returns !(x == y). - template<class _Key, class _Compare, class _Alloc> - inline bool - operator!=(const set<_Key,_Compare,_Alloc>& __x, - const set<_Key,_Compare,_Alloc>& __y) - { return !(__x == __y); } - - /// Returns y < x. - template<class _Key, class _Compare, class _Alloc> - inline bool - operator>(const set<_Key,_Compare,_Alloc>& __x, - const set<_Key,_Compare,_Alloc>& __y) - { return __y < __x; } - - /// Returns !(y < x) - template<class _Key, class _Compare, class _Alloc> - inline bool - operator<=(const set<_Key,_Compare,_Alloc>& __x, - const set<_Key,_Compare,_Alloc>& __y) - { return !(__y < __x); } - - /// Returns !(x < y) - template<class _Key, class _Compare, class _Alloc> - inline bool - operator>=(const set<_Key,_Compare,_Alloc>& __x, - const set<_Key,_Compare,_Alloc>& __y) - { return !(__x < __y); } - - /// See std::set::swap(). - template<class _Key, class _Compare, class _Alloc> - inline void - swap(set<_Key,_Compare,_Alloc>& __x, set<_Key,_Compare,_Alloc>& __y) - { __x.swap(__y); } - -} // namespace std - -#endif /* _SET_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_stack.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_stack.h deleted file mode 100644 index ada50ee350e..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_stack.h +++ /dev/null @@ -1,272 +0,0 @@ -// Stack implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_stack.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _STACK_H -#define _STACK_H 1 - -#include <bits/concept_check.h> -#include <debug/debug.h> - -namespace std -{ - // Forward declarations of operators == and <, needed for friend - // declaration. - template<typename _Tp, typename _Sequence = deque<_Tp> > - class stack; - - template<typename _Tp, typename _Seq> - inline bool - operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y); - - template<typename _Tp, typename _Seq> - inline bool - operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y); - - /** - * @brief A standard container giving FILO behavior. - * - * @ingroup Containers - * @ingroup Sequences - * - * Meets many of the requirements of a - * <a href="tables.html#65">container</a>, - * but does not define anything to do with iterators. Very few of the - * other standard container interfaces are defined. - * - * This is not a true container, but an @e adaptor. It holds - * another container, and provides a wrapper interface to that - * container. The wrapper is what enforces strict - * first-in-last-out %stack behavior. - * - * The second template parameter defines the type of the underlying - * sequence/container. It defaults to std::deque, but it can be - * any type that supports @c back, @c push_back, and @c pop_front, - * such as std::list, std::vector, or an appropriate user-defined - * type. - * - * Members not found in "normal" containers are @c container_type, - * which is a typedef for the second Sequence parameter, and @c - * push, @c pop, and @c top, which are standard %stack/FILO - * operations. - */ - template<typename _Tp, typename _Sequence> - class stack - { - // concept requirements - typedef typename _Sequence::value_type _Sequence_value_type; - __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept) - __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) - - template<typename _Tp1, typename _Seq1> - friend bool - operator==(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&); - - template<typename _Tp1, typename _Seq1> - friend bool - operator<(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&); - - public: - typedef typename _Sequence::value_type value_type; - typedef typename _Sequence::reference reference; - typedef typename _Sequence::const_reference const_reference; - typedef typename _Sequence::size_type size_type; - typedef _Sequence container_type; - - protected: - // See queue::c for notes on this name. - _Sequence c; - - public: - // XXX removed old def ctor, added def arg to this one to match 14882 - /** - * @brief Default constructor creates no elements. - */ - explicit - stack(const _Sequence& __c = _Sequence()) - : c(__c) {} - - /** - * Returns true if the %stack is empty. - */ - bool - empty() const - { return c.empty(); } - - /** Returns the number of elements in the %stack. */ - size_type - size() const - { return c.size(); } - - /** - * Returns a read/write reference to the data at the first - * element of the %stack. - */ - reference - top() - { - __glibcxx_requires_nonempty(); - return c.back(); - } - - /** - * Returns a read-only (constant) reference to the data at the first - * element of the %stack. - */ - const_reference - top() const - { - __glibcxx_requires_nonempty(); - return c.back(); - } - - /** - * @brief Add data to the top of the %stack. - * @param x Data to be added. - * - * This is a typical %stack operation. The function creates an - * element at the top of the %stack and assigns the given data - * to it. The time complexity of the operation depends on the - * underlying sequence. - */ - void - push(const value_type& __x) - { c.push_back(__x); } - - /** - * @brief Removes first element. - * - * This is a typical %stack operation. It shrinks the %stack - * by one. The time complexity of the operation depends on the - * underlying sequence. - * - * Note that no data is returned, and if the first element's - * data is needed, it should be retrieved before pop() is - * called. - */ - void - pop() - { - __glibcxx_requires_nonempty(); - c.pop_back(); - } - }; - - /** - * @brief Stack equality comparison. - * @param x A %stack. - * @param y A %stack of the same type as @a x. - * @return True iff the size and elements of the stacks are equal. - * - * This is an equivalence relation. Complexity and semantics - * depend on the underlying sequence type, but the expected rules - * are: this relation is linear in the size of the sequences, and - * stacks are considered equivalent if their sequences compare - * equal. - */ - template<typename _Tp, typename _Seq> - inline bool - operator==(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) - { return __x.c == __y.c; } - - /** - * @brief Stack ordering relation. - * @param x A %stack. - * @param y A %stack of the same type as @a x. - * @return True iff @a x is lexicographically less than @a y. - * - * This is an total ordering relation. Complexity and semantics - * depend on the underlying sequence type, but the expected rules - * are: this relation is linear in the size of the sequences, the - * elements must be comparable with @c <, and - * std::lexicographical_compare() is usually used to make the - * determination. - */ - template<typename _Tp, typename _Seq> - inline bool - operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) - { return __x.c < __y.c; } - - /// Based on operator== - template<typename _Tp, typename _Seq> - inline bool - operator!=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) - { return !(__x == __y); } - - /// Based on operator< - template<typename _Tp, typename _Seq> - inline bool - operator>(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) - { return __y < __x; } - - /// Based on operator< - template<typename _Tp, typename _Seq> - inline bool - operator<=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) - { return !(__y < __x); } - - /// Based on operator< - template<typename _Tp, typename _Seq> - inline bool - operator>=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) - { return !(__x < __y); } -} // namespace std - -#endif /* _STACK_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tempbuf.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tempbuf.h deleted file mode 100644 index 399cffb3311..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tempbuf.h +++ /dev/null @@ -1,171 +0,0 @@ -// Temporary buffer implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_tempbuf.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _TEMPBUF_H -#define _TEMPBUF_H 1 - -#include <memory> - -namespace std -{ - /** - * @if maint - * This class is used in two places: stl_algo.h and ext/memory, - * where it is wrapped as the temporary_buffer class. See - * temporary_buffer docs for more notes. - * @endif - */ - template<typename _ForwardIterator, typename _Tp> - class _Temporary_buffer - { - // concept requirements - __glibcxx_class_requires(_ForwardIterator, _ForwardIteratorConcept) - - public: - typedef _Tp value_type; - typedef value_type* pointer; - typedef pointer iterator; - typedef ptrdiff_t size_type; - - protected: - size_type _M_original_len; - size_type _M_len; - pointer _M_buffer; - - void - _M_initialize_buffer(const _Tp&, __true_type) { } - - void - _M_initialize_buffer(const _Tp& val, __false_type) - { std::uninitialized_fill_n(_M_buffer, _M_len, val); } - - public: - /// As per Table mumble. - size_type - size() const - { return _M_len; } - - /// Returns the size requested by the constructor; may be >size(). - size_type - requested_size() const - { return _M_original_len; } - - /// As per Table mumble. - iterator - begin() - { return _M_buffer; } - - /// As per Table mumble. - iterator - end() - { return _M_buffer + _M_len; } - - /** - * Constructs a temporary buffer of a size somewhere between - * zero and the size of the given range. - */ - _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last); - - ~_Temporary_buffer() - { - std::_Destroy(_M_buffer, _M_buffer + _M_len); - std::return_temporary_buffer(_M_buffer); - } - - private: - // Disable copy constructor and assignment operator. - _Temporary_buffer(const _Temporary_buffer&); - - void - operator=(const _Temporary_buffer&); - }; - - - template<typename _ForwardIterator, typename _Tp> - _Temporary_buffer<_ForwardIterator, _Tp>:: - _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) - : _M_original_len(std::distance(__first, __last)), - _M_len(0), _M_buffer(0) - { - // Workaround for a __type_traits bug in the pre-7.3 compiler. - typedef typename __type_traits<_Tp>::has_trivial_default_constructor - _Trivial; - - try - { - pair<pointer, size_type> __p(get_temporary_buffer< - value_type>(_M_original_len)); - _M_buffer = __p.first; - _M_len = __p.second; - if (_M_len > 0) - _M_initialize_buffer(*__first, _Trivial()); - } - catch(...) - { - std::return_temporary_buffer(_M_buffer); - _M_buffer = 0; - _M_len = 0; - __throw_exception_again; - } - } -} // namespace std - -#endif /* _TEMPBUF_H */ - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_threads.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_threads.h deleted file mode 100644 index 04baf0a08f9..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_threads.h +++ /dev/null @@ -1,150 +0,0 @@ -// Threading support -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1997-1999 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_threads.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _STL_THREADS_H -#define _STL_THREADS_H 1 - -#include <cstddef> - -// The only supported threading model is GCC's own gthr.h abstraction -// layer. -#include "bits/gthr.h" - -namespace __gnu_internal -{ -#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) - extern __gthread_mutex_t _GLIBCXX_mutex; - extern __gthread_mutex_t *_GLIBCXX_mutex_address; - extern __gthread_once_t _GLIBCXX_once; - extern void _GLIBCXX_mutex_init(void); - extern void _GLIBCXX_mutex_address_init(void); -#endif -} // namespace __gnu_internal - -namespace __gnu_cxx -{ - // Locking class. Note that this class *does not have a - // constructor*. It must be initialized either statically, with - // __STL_MUTEX_INITIALIZER, or dynamically, by explicitly calling - // the _M_initialize member function. (This is similar to the ways - // that a pthreads mutex can be initialized.) There are explicit - // member functions for acquiring and releasing the lock. - - // There is no constructor because static initialization is - // essential for some uses, and only a class aggregate (see section - // 8.5.1 of the C++ standard) can be initialized that way. That - // means we must have no constructors, no base classes, no virtual - // functions, and no private or protected members. - struct _STL_mutex_lock - { - // The class must be statically initialized with __STL_MUTEX_INITIALIZER. -#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) - volatile int _M_init_flag; - __gthread_once_t _M_once; -#endif - __gthread_mutex_t _M_lock; - - void - _M_initialize() - { -#ifdef __GTHREAD_MUTEX_INIT - // There should be no code in this path given the usage rules above. -#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION) - if (_M_init_flag) return; - if (__gthread_once(&__gnu_internal::_GLIBCXX_once, - __gnu_internal::_GLIBCXX_mutex_init) != 0 - && __gthread_active_p()) - abort (); - __gthread_mutex_lock(&__gnu_internal::_GLIBCXX_mutex); - if (!_M_init_flag) - { - // Even though we have a global lock, we use __gthread_once to be - // absolutely certain the _M_lock mutex is only initialized once on - // multiprocessor systems. - __gnu_internal::_GLIBCXX_mutex_address = &_M_lock; - if (__gthread_once(&_M_once, - __gnu_internal::_GLIBCXX_mutex_address_init) != 0 - && __gthread_active_p()) - abort(); - _M_init_flag = 1; - } - __gthread_mutex_unlock(&__gnu_internal::_GLIBCXX_mutex); -#endif - } - - void - _M_acquire_lock() - { -#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) - if (!_M_init_flag) _M_initialize(); -#endif - __gthread_mutex_lock(&_M_lock); - } - - void - _M_release_lock() - { -#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) - if (!_M_init_flag) _M_initialize(); -#endif - __gthread_mutex_unlock(&_M_lock); - } - }; - -#ifdef __GTHREAD_MUTEX_INIT -#define __STL_MUTEX_INITIALIZER = { __GTHREAD_MUTEX_INIT } -#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION) -#ifdef __GTHREAD_MUTEX_INIT_DEFAULT -#define __STL_MUTEX_INITIALIZER \ - = { 0, __GTHREAD_ONCE_INIT, __GTHREAD_MUTEX_INIT_DEFAULT } -#else -#define __STL_MUTEX_INITIALIZER = { 0, __GTHREAD_ONCE_INIT } -#endif -#endif -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h deleted file mode 100644 index cea16f12d25..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_tree.h +++ /dev/null @@ -1,1283 +0,0 @@ -// RB tree implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - */ - -/** @file stl_tree.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _TREE_H -#define _TREE_H 1 - -#include <bits/stl_algobase.h> -#include <bits/allocator.h> -#include <bits/stl_construct.h> -#include <bits/stl_function.h> -#include <bits/cpp_type_traits.h> - -namespace std -{ - // Red-black tree class, designed for use in implementing STL - // associative containers (set, multiset, map, and multimap). The - // insertion and deletion algorithms are based on those in Cormen, - // Leiserson, and Rivest, Introduction to Algorithms (MIT Press, - // 1990), except that - // - // (1) the header cell is maintained with links not only to the root - // but also to the leftmost node of the tree, to enable constant - // time begin(), and to the rightmost node of the tree, to enable - // linear time performance when used with the generic set algorithms - // (set_union, etc.) - // - // (2) when a node being deleted has two children its successor node - // is relinked into its place, rather than copied, so that the only - // iterators invalidated are those referring to the deleted node. - - enum _Rb_tree_color { _S_red = false, _S_black = true }; - - struct _Rb_tree_node_base - { - typedef _Rb_tree_node_base* _Base_ptr; - typedef const _Rb_tree_node_base* _Const_Base_ptr; - - _Rb_tree_color _M_color; - _Base_ptr _M_parent; - _Base_ptr _M_left; - _Base_ptr _M_right; - - static _Base_ptr - _S_minimum(_Base_ptr __x) - { - while (__x->_M_left != 0) __x = __x->_M_left; - return __x; - } - - static _Const_Base_ptr - _S_minimum(_Const_Base_ptr __x) - { - while (__x->_M_left != 0) __x = __x->_M_left; - return __x; - } - - static _Base_ptr - _S_maximum(_Base_ptr __x) - { - while (__x->_M_right != 0) __x = __x->_M_right; - return __x; - } - - static _Const_Base_ptr - _S_maximum(_Const_Base_ptr __x) - { - while (__x->_M_right != 0) __x = __x->_M_right; - return __x; - } - }; - - template<typename _Val> - struct _Rb_tree_node : public _Rb_tree_node_base - { - typedef _Rb_tree_node<_Val>* _Link_type; - _Val _M_value_field; - }; - - _Rb_tree_node_base* - _Rb_tree_increment(_Rb_tree_node_base* __x); - - const _Rb_tree_node_base* - _Rb_tree_increment(const _Rb_tree_node_base* __x); - - _Rb_tree_node_base* - _Rb_tree_decrement(_Rb_tree_node_base* __x); - - const _Rb_tree_node_base* - _Rb_tree_decrement(const _Rb_tree_node_base* __x); - - template<typename _Tp> - struct _Rb_tree_iterator - { - typedef _Tp value_type; - typedef _Tp& reference; - typedef _Tp* pointer; - - typedef bidirectional_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; - - typedef _Rb_tree_iterator<_Tp> _Self; - typedef _Rb_tree_node_base::_Base_ptr _Base_ptr; - typedef _Rb_tree_node<_Tp>* _Link_type; - - _Rb_tree_iterator() - : _M_node() { } - - _Rb_tree_iterator(_Link_type __x) - : _M_node(__x) { } - - reference - operator*() const - { return static_cast<_Link_type>(_M_node)->_M_value_field; } - - pointer - operator->() const - { return &static_cast<_Link_type>(_M_node)->_M_value_field; } - - _Self& - operator++() - { - _M_node = _Rb_tree_increment(_M_node); - return *this; - } - - _Self - operator++(int) - { - _Self __tmp = *this; - _M_node = _Rb_tree_increment(_M_node); - return __tmp; - } - - _Self& - operator--() - { - _M_node = _Rb_tree_decrement(_M_node); - return *this; - } - - _Self - operator--(int) - { - _Self __tmp = *this; - _M_node = _Rb_tree_decrement(_M_node); - return __tmp; - } - - bool - operator==(const _Self& __x) const - { return _M_node == __x._M_node; } - - bool - operator!=(const _Self& __x) const - { return _M_node != __x._M_node; } - - _Base_ptr _M_node; - }; - - template<typename _Tp> - struct _Rb_tree_const_iterator - { - typedef _Tp value_type; - typedef const _Tp& reference; - typedef const _Tp* pointer; - - typedef _Rb_tree_iterator<_Tp> iterator; - - typedef bidirectional_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; - - typedef _Rb_tree_const_iterator<_Tp> _Self; - typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr; - typedef const _Rb_tree_node<_Tp>* _Link_type; - - _Rb_tree_const_iterator() - : _M_node() { } - - _Rb_tree_const_iterator(_Link_type __x) - : _M_node(__x) { } - - _Rb_tree_const_iterator(const iterator& __it) - : _M_node(__it._M_node) { } - - reference - operator*() const - { return static_cast<_Link_type>(_M_node)->_M_value_field; } - - pointer - operator->() const - { return &static_cast<_Link_type>(_M_node)->_M_value_field; } - - _Self& - operator++() - { - _M_node = _Rb_tree_increment(_M_node); - return *this; - } - - _Self - operator++(int) - { - _Self __tmp = *this; - _M_node = _Rb_tree_increment(_M_node); - return __tmp; - } - - _Self& - operator--() - { - _M_node = _Rb_tree_decrement(_M_node); - return *this; - } - - _Self - operator--(int) - { - _Self __tmp = *this; - _M_node = _Rb_tree_decrement(_M_node); - return __tmp; - } - - bool - operator==(const _Self& __x) const - { return _M_node == __x._M_node; } - - bool - operator!=(const _Self& __x) const - { return _M_node != __x._M_node; } - - _Base_ptr _M_node; - }; - - template<typename _Val> - inline bool - operator==(const _Rb_tree_iterator<_Val>& __x, - const _Rb_tree_const_iterator<_Val>& __y) - { return __x._M_node == __y._M_node; } - - template<typename _Val> - inline bool - operator!=(const _Rb_tree_iterator<_Val>& __x, - const _Rb_tree_const_iterator<_Val>& __y) - { return __x._M_node != __y._M_node; } - - void - _Rb_tree_rotate_left(_Rb_tree_node_base* const __x, - _Rb_tree_node_base*& __root); - - void - _Rb_tree_rotate_right(_Rb_tree_node_base* const __x, - _Rb_tree_node_base*& __root); - - void - _Rb_tree_insert_and_rebalance(const bool __insert_left, - _Rb_tree_node_base* __x, - _Rb_tree_node_base* __p, - _Rb_tree_node_base& __header); - - _Rb_tree_node_base* - _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z, - _Rb_tree_node_base& __header); - - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc = allocator<_Val> > - class _Rb_tree - { - typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other - _Node_allocator; - - protected: - typedef _Rb_tree_node_base* _Base_ptr; - typedef const _Rb_tree_node_base* _Const_Base_ptr; - typedef _Rb_tree_node<_Val> _Rb_tree_node; - - public: - typedef _Key key_type; - typedef _Val value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef _Rb_tree_node* _Link_type; - typedef const _Rb_tree_node* _Const_Link_type; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef _Alloc allocator_type; - - allocator_type - get_allocator() const - { return *static_cast<const _Node_allocator*>(&this->_M_impl); } - - protected: - _Rb_tree_node* - _M_get_node() - { return _M_impl._Node_allocator::allocate(1); } - - void - _M_put_node(_Rb_tree_node* __p) - { _M_impl._Node_allocator::deallocate(__p, 1); } - - _Link_type - _M_create_node(const value_type& __x) - { - _Link_type __tmp = _M_get_node(); - try - { std::_Construct(&__tmp->_M_value_field, __x); } - catch(...) - { - _M_put_node(__tmp); - __throw_exception_again; - } - return __tmp; - } - - _Link_type - _M_clone_node(_Const_Link_type __x) - { - _Link_type __tmp = _M_create_node(__x->_M_value_field); - __tmp->_M_color = __x->_M_color; - __tmp->_M_left = 0; - __tmp->_M_right = 0; - return __tmp; - } - - void - destroy_node(_Link_type __p) - { - std::_Destroy(&__p->_M_value_field); - _M_put_node(__p); - } - - protected: - template<typename _Key_compare, - bool _Is_pod_comparator = std::__is_pod<_Key_compare>::_M_type> - struct _Rb_tree_impl : public _Node_allocator - { - _Key_compare _M_key_compare; - _Rb_tree_node_base _M_header; - size_type _M_node_count; // Keeps track of size of tree. - - _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(), - const _Key_compare& __comp = _Key_compare()) - : _Node_allocator(__a), _M_key_compare(__comp), _M_node_count(0) - { - this->_M_header._M_color = _S_red; - this->_M_header._M_parent = 0; - this->_M_header._M_left = &this->_M_header; - this->_M_header._M_right = &this->_M_header; - } - }; - - // Specialization for _Comparison types that are not capable of - // being base classes / super classes. - template<typename _Key_compare> - struct _Rb_tree_impl<_Key_compare, true> : public _Node_allocator - { - _Key_compare _M_key_compare; - _Rb_tree_node_base _M_header; - size_type _M_node_count; // Keeps track of size of tree. - - _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(), - const _Key_compare& __comp = _Key_compare()) - : _Node_allocator(__a), _M_key_compare(__comp), _M_node_count(0) - { - this->_M_header._M_color = _S_red; - this->_M_header._M_parent = 0; - this->_M_header._M_left = &this->_M_header; - this->_M_header._M_right = &this->_M_header; - } - }; - - _Rb_tree_impl<_Compare> _M_impl; - - protected: - _Base_ptr& - _M_root() - { return this->_M_impl._M_header._M_parent; } - - _Const_Base_ptr - _M_root() const - { return this->_M_impl._M_header._M_parent; } - - _Base_ptr& - _M_leftmost() - { return this->_M_impl._M_header._M_left; } - - _Const_Base_ptr - _M_leftmost() const - { return this->_M_impl._M_header._M_left; } - - _Base_ptr& - _M_rightmost() - { return this->_M_impl._M_header._M_right; } - - _Const_Base_ptr - _M_rightmost() const - { return this->_M_impl._M_header._M_right; } - - _Link_type - _M_begin() - { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); } - - _Const_Link_type - _M_begin() const - { return static_cast<_Const_Link_type>(this->_M_impl._M_header._M_parent); } - - _Link_type - _M_end() - { return static_cast<_Link_type>(&this->_M_impl._M_header); } - - _Const_Link_type - _M_end() const - { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); } - - static const_reference - _S_value(_Const_Link_type __x) - { return __x->_M_value_field; } - - static const _Key& - _S_key(_Const_Link_type __x) - { return _KeyOfValue()(_S_value(__x)); } - - static _Link_type - _S_left(_Base_ptr __x) - { return static_cast<_Link_type>(__x->_M_left); } - - static _Const_Link_type - _S_left(_Const_Base_ptr __x) - { return static_cast<_Const_Link_type>(__x->_M_left); } - - static _Link_type - _S_right(_Base_ptr __x) - { return static_cast<_Link_type>(__x->_M_right); } - - static _Const_Link_type - _S_right(_Const_Base_ptr __x) - { return static_cast<_Const_Link_type>(__x->_M_right); } - - static const_reference - _S_value(_Const_Base_ptr __x) - { return static_cast<_Const_Link_type>(__x)->_M_value_field; } - - static const _Key& - _S_key(_Const_Base_ptr __x) - { return _KeyOfValue()(_S_value(__x)); } - - static _Base_ptr - _S_minimum(_Base_ptr __x) - { return _Rb_tree_node_base::_S_minimum(__x); } - - static _Const_Base_ptr - _S_minimum(_Const_Base_ptr __x) - { return _Rb_tree_node_base::_S_minimum(__x); } - - static _Base_ptr - _S_maximum(_Base_ptr __x) - { return _Rb_tree_node_base::_S_maximum(__x); } - - static _Const_Base_ptr - _S_maximum(_Const_Base_ptr __x) - { return _Rb_tree_node_base::_S_maximum(__x); } - - public: - typedef _Rb_tree_iterator<value_type> iterator; - typedef _Rb_tree_const_iterator<value_type> const_iterator; - - typedef std::reverse_iterator<iterator> reverse_iterator; - typedef std::reverse_iterator<const_iterator> const_reverse_iterator; - - private: - iterator - _M_insert(_Base_ptr __x, _Base_ptr __y, const value_type& __v); - - _Link_type - _M_copy(_Const_Link_type __x, _Link_type __p); - - void - _M_erase(_Link_type __x); - - public: - // allocation/deallocation - _Rb_tree() - { } - - _Rb_tree(const _Compare& __comp) - : _M_impl(allocator_type(), __comp) - { } - - _Rb_tree(const _Compare& __comp, const allocator_type& __a) - : _M_impl(__a, __comp) - { } - - _Rb_tree(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x) - : _M_impl(__x.get_allocator(), __x._M_impl._M_key_compare) - { - if (__x._M_root() != 0) - { - _M_root() = _M_copy(__x._M_begin(), _M_end()); - _M_leftmost() = _S_minimum(_M_root()); - _M_rightmost() = _S_maximum(_M_root()); - _M_impl._M_node_count = __x._M_impl._M_node_count; - } - } - - ~_Rb_tree() - { _M_erase(_M_begin()); } - - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& - operator=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x); - - // Accessors. - _Compare - key_comp() const - { return _M_impl._M_key_compare; } - - iterator - begin() - { return static_cast<_Link_type>(this->_M_impl._M_header._M_left); } - - const_iterator - begin() const - { return static_cast<_Const_Link_type>(this->_M_impl._M_header._M_left); } - - iterator - end() - { return static_cast<_Link_type>(&this->_M_impl._M_header); } - - const_iterator - end() const - { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); } - - reverse_iterator - rbegin() - { return reverse_iterator(end()); } - - const_reverse_iterator - rbegin() const - { return const_reverse_iterator(end()); } - - reverse_iterator - rend() - { return reverse_iterator(begin()); } - - const_reverse_iterator - rend() const - { return const_reverse_iterator(begin()); } - - bool - empty() const - { return _M_impl._M_node_count == 0; } - - size_type - size() const - { return _M_impl._M_node_count; } - - size_type - max_size() const - { return size_type(-1); } - - void - swap(_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __t); - - // Insert/erase. - pair<iterator,bool> - insert_unique(const value_type& __x); - - iterator - insert_equal(const value_type& __x); - - iterator - insert_unique(iterator __position, const value_type& __x); - - iterator - insert_equal(iterator __position, const value_type& __x); - - template<typename _InputIterator> - void - insert_unique(_InputIterator __first, _InputIterator __last); - - template<typename _InputIterator> - void - insert_equal(_InputIterator __first, _InputIterator __last); - - void - erase(iterator __position); - - size_type - erase(const key_type& __x); - - void - erase(iterator __first, iterator __last); - - void - erase(const key_type* __first, const key_type* __last); - - void - clear() - { - _M_erase(_M_begin()); - _M_leftmost() = _M_end(); - _M_root() = 0; - _M_rightmost() = _M_end(); - _M_impl._M_node_count = 0; - } - - // Set operations. - iterator - find(const key_type& __x); - - const_iterator - find(const key_type& __x) const; - - size_type - count(const key_type& __x) const; - - iterator - lower_bound(const key_type& __x); - - const_iterator - lower_bound(const key_type& __x) const; - - iterator - upper_bound(const key_type& __x); - - const_iterator - upper_bound(const key_type& __x) const; - - pair<iterator,iterator> - equal_range(const key_type& __x); - - pair<const_iterator, const_iterator> - equal_range(const key_type& __x) const; - - // Debugging. - bool - __rb_verify() const; - }; - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - inline bool - operator==(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, - const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) - { - return __x.size() == __y.size() - && std::equal(__x.begin(), __x.end(), __y.begin()); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - inline bool - operator<(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, - const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) - { - return std::lexicographical_compare(__x.begin(), __x.end(), - __y.begin(), __y.end()); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - inline bool - operator!=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, - const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) - { return !(__x == __y); } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - inline bool - operator>(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, - const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) - { return __y < __x; } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - inline bool - operator<=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, - const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) - { return !(__y < __x); } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - inline bool - operator>=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, - const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) - { return !(__x < __y); } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - inline void - swap(_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) - { __x.swap(__y); } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - operator=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x) - { - if (this != &__x) - { - // Note that _Key may be a constant type. - clear(); - _M_impl._M_key_compare = __x._M_impl._M_key_compare; - if (__x._M_root() != 0) - { - _M_root() = _M_copy(__x._M_begin(), _M_end()); - _M_leftmost() = _S_minimum(_M_root()); - _M_rightmost() = _S_maximum(_M_root()); - _M_impl._M_node_count = __x._M_impl._M_node_count; - } - } - return *this; - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - _M_insert(_Base_ptr __x, _Base_ptr __p, const _Val& __v) - { - _Link_type __z = _M_create_node(__v); - bool __insert_left; - - __insert_left = __x != 0 || __p == _M_end() - || _M_impl._M_key_compare(_KeyOfValue()(__v), - _S_key(__p)); - - _Rb_tree_insert_and_rebalance(__insert_left, __z, __p, - this->_M_impl._M_header); - ++_M_impl._M_node_count; - return iterator(__z); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - insert_equal(const _Val& __v) - { - _Link_type __x = _M_begin(); - _Link_type __y = _M_end(); - while (__x != 0) - { - __y = __x; - __x = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x)) ? - _S_left(__x) : _S_right(__x); - } - return _M_insert(__x, __y, __v); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - void - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - swap(_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __t) - { - if (_M_root() == 0) - { - if (__t._M_root() != 0) - { - _M_root() = __t._M_root(); - _M_leftmost() = __t._M_leftmost(); - _M_rightmost() = __t._M_rightmost(); - _M_root()->_M_parent = _M_end(); - - __t._M_root() = 0; - __t._M_leftmost() = __t._M_end(); - __t._M_rightmost() = __t._M_end(); - } - } - else if (__t._M_root() == 0) - { - __t._M_root() = _M_root(); - __t._M_leftmost() = _M_leftmost(); - __t._M_rightmost() = _M_rightmost(); - __t._M_root()->_M_parent = __t._M_end(); - - _M_root() = 0; - _M_leftmost() = _M_end(); - _M_rightmost() = _M_end(); - } - else - { - std::swap(_M_root(),__t._M_root()); - std::swap(_M_leftmost(),__t._M_leftmost()); - std::swap(_M_rightmost(),__t._M_rightmost()); - - _M_root()->_M_parent = _M_end(); - __t._M_root()->_M_parent = __t._M_end(); - } - // No need to swap header's color as it does not change. - std::swap(this->_M_impl._M_node_count, __t._M_impl._M_node_count); - std::swap(this->_M_impl._M_key_compare, __t._M_impl._M_key_compare); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - pair<typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator, - bool> - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - insert_unique(const _Val& __v) - { - _Link_type __x = _M_begin(); - _Link_type __y = _M_end(); - bool __comp = true; - while (__x != 0) - { - __y = __x; - __comp = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x)); - __x = __comp ? _S_left(__x) : _S_right(__x); - } - iterator __j = iterator(__y); - if (__comp) - if (__j == begin()) - return pair<iterator,bool>(_M_insert(__x, __y, __v), true); - else - --__j; - if (_M_impl._M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v))) - return pair<iterator,bool>(_M_insert(__x, __y, __v), true); - return pair<iterator,bool>(__j, false); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator - _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: - insert_unique(iterator __position, const _Val& __v) - { - if (__position._M_node == _M_leftmost()) - { - // begin() - if (size() > 0 - && _M_impl._M_key_compare(_KeyOfValue()(__v), - _S_key(__position._M_node))) - return _M_insert(__position._M_node, __position._M_node, __v); - // First argument just needs to be non-null. - else - return insert_unique(__v).first; - } - else if (__position._M_node == _M_end()) - { - // end() - if (_M_impl._M_key_compare(_S_key(_M_rightmost()), - _KeyOfValue()(__v))) - return _M_insert(0, _M_rightmost(), __v); - else - return insert_unique(__v).first; - } - else - { - iterator __before = __position; - --__before; - if (_M_impl._M_key_compare(_S_key(__before._M_node), - _KeyOfValue()(__v)) - && _M_impl._M_key_compare(_KeyOfValue()(__v), - _S_key(__position._M_node))) - { - if (_S_right(__before._M_node) == 0) - return _M_insert(0, __before._M_node, __v); - else - return _M_insert(__position._M_node, __position._M_node, __v); - // First argument just needs to be non-null. - } - else - return insert_unique(__v).first; - } - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - insert_equal(iterator __position, const _Val& __v) - { - if (__position._M_node == _M_leftmost()) - { - // begin() - if (size() > 0 - && !_M_impl._M_key_compare(_S_key(__position._M_node), - _KeyOfValue()(__v))) - return _M_insert(__position._M_node, __position._M_node, __v); - // first argument just needs to be non-null - else - return insert_equal(__v); - } - else if (__position._M_node == _M_end()) - { - // end() - if (!_M_impl._M_key_compare(_KeyOfValue()(__v), - _S_key(_M_rightmost()))) - return _M_insert(0, _M_rightmost(), __v); - else - return insert_equal(__v); - } - else - { - iterator __before = __position; - --__before; - if (!_M_impl._M_key_compare(_KeyOfValue()(__v), - _S_key(__before._M_node)) - && !_M_impl._M_key_compare(_S_key(__position._M_node), - _KeyOfValue()(__v))) - { - if (_S_right(__before._M_node) == 0) - return _M_insert(0, __before._M_node, __v); - else - return _M_insert(__position._M_node, __position._M_node, __v); - // First argument just needs to be non-null. - } - else - return insert_equal(__v); - } - } - - template<typename _Key, typename _Val, typename _KoV, - typename _Cmp, typename _Alloc> - template<class _II> - void - _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>:: - insert_equal(_II __first, _II __last) - { - for ( ; __first != __last; ++__first) - insert_equal(*__first); - } - - template<typename _Key, typename _Val, typename _KoV, - typename _Cmp, typename _Alloc> - template<class _II> - void - _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>:: - insert_unique(_II __first, _II __last) - { - for ( ; __first != __last; ++__first) - insert_unique(*__first); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - inline void - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::erase(iterator __position) - { - _Link_type __y = - static_cast<_Link_type>(_Rb_tree_rebalance_for_erase(__position._M_node, - this->_M_impl._M_header)); - destroy_node(__y); - --_M_impl._M_node_count; - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::size_type - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::erase(const _Key& __x) - { - pair<iterator,iterator> __p = equal_range(__x); - size_type __n = std::distance(__p.first, __p.second); - erase(__p.first, __p.second); - return __n; - } - - template<typename _Key, typename _Val, typename _KoV, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type - _Rb_tree<_Key,_Val,_KoV,_Compare,_Alloc>:: - _M_copy(_Const_Link_type __x, _Link_type __p) - { - // Structural copy. __x and __p must be non-null. - _Link_type __top = _M_clone_node(__x); - __top->_M_parent = __p; - - try - { - if (__x->_M_right) - __top->_M_right = _M_copy(_S_right(__x), __top); - __p = __top; - __x = _S_left(__x); - - while (__x != 0) - { - _Link_type __y = _M_clone_node(__x); - __p->_M_left = __y; - __y->_M_parent = __p; - if (__x->_M_right) - __y->_M_right = _M_copy(_S_right(__x), __y); - __p = __y; - __x = _S_left(__x); - } - } - catch(...) - { - _M_erase(__top); - __throw_exception_again; - } - return __top; - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - void - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::_M_erase(_Link_type __x) - { - // Erase without rebalancing. - while (__x != 0) - { - _M_erase(_S_right(__x)); - _Link_type __y = _S_left(__x); - destroy_node(__x); - __x = __y; - } - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - void - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - erase(iterator __first, iterator __last) - { - if (__first == begin() && __last == end()) - clear(); - else - while (__first != __last) erase(__first++); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - void - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - erase(const _Key* __first, const _Key* __last) - { - while (__first != __last) - erase(*__first++); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::find(const _Key& __k) - { - _Link_type __x = _M_begin(); // Current node. - _Link_type __y = _M_end(); // Last node which is not less than __k. - - while (__x != 0) - if (!_M_impl._M_key_compare(_S_key(__x), __k)) - __y = __x, __x = _S_left(__x); - else - __x = _S_right(__x); - - iterator __j = iterator(__y); - return (__j == end() - || _M_impl._M_key_compare(__k, _S_key(__j._M_node))) ? end() : __j; - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::const_iterator - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - find(const _Key& __k) const - { - _Const_Link_type __x = _M_begin(); // Current node. - _Const_Link_type __y = _M_end(); // Last node which is not less than __k. - - while (__x != 0) - { - if (!_M_impl._M_key_compare(_S_key(__x), __k)) - __y = __x, __x = _S_left(__x); - else - __x = _S_right(__x); - } - const_iterator __j = const_iterator(__y); - return (__j == end() - || _M_impl._M_key_compare(__k, _S_key(__j._M_node))) ? end() : __j; - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::size_type - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - count(const _Key& __k) const - { - pair<const_iterator, const_iterator> __p = equal_range(__k); - const size_type __n = std::distance(__p.first, __p.second); - return __n; - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - lower_bound(const _Key& __k) - { - _Link_type __x = _M_begin(); // Current node. - _Link_type __y = _M_end(); // Last node which is not less than __k. - - while (__x != 0) - if (!_M_impl._M_key_compare(_S_key(__x), __k)) - __y = __x, __x = _S_left(__x); - else - __x = _S_right(__x); - - return iterator(__y); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::const_iterator - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - lower_bound(const _Key& __k) const - { - _Const_Link_type __x = _M_begin(); // Current node. - _Const_Link_type __y = _M_end(); // Last node which is not less than __k. - - while (__x != 0) - if (!_M_impl._M_key_compare(_S_key(__x), __k)) - __y = __x, __x = _S_left(__x); - else - __x = _S_right(__x); - - return const_iterator(__y); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - upper_bound(const _Key& __k) - { - _Link_type __x = _M_begin(); // Current node. - _Link_type __y = _M_end(); // Last node which is greater than __k. - - while (__x != 0) - if (_M_impl._M_key_compare(__k, _S_key(__x))) - __y = __x, __x = _S_left(__x); - else - __x = _S_right(__x); - - return iterator(__y); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::const_iterator - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - upper_bound(const _Key& __k) const - { - _Const_Link_type __x = _M_begin(); // Current node. - _Const_Link_type __y = _M_end(); // Last node which is greater than __k. - - while (__x != 0) - if (_M_impl._M_key_compare(__k, _S_key(__x))) - __y = __x, __x = _S_left(__x); - else - __x = _S_right(__x); - - return const_iterator(__y); - } - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - inline - pair<typename _Rb_tree<_Key,_Val,_KeyOfValue, - _Compare,_Alloc>::iterator, - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator> - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - equal_range(const _Key& __k) - { return pair<iterator, iterator>(lower_bound(__k), upper_bound(__k)); } - - template<typename _Key, typename _Val, typename _KoV, - typename _Compare, typename _Alloc> - inline - pair<typename _Rb_tree<_Key, _Val, _KoV, - _Compare, _Alloc>::const_iterator, - typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::const_iterator> - _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>:: - equal_range(const _Key& __k) const - { return pair<const_iterator, const_iterator>(lower_bound(__k), - upper_bound(__k)); } - - unsigned int - _Rb_tree_black_count(const _Rb_tree_node_base* __node, - const _Rb_tree_node_base* __root); - - template<typename _Key, typename _Val, typename _KeyOfValue, - typename _Compare, typename _Alloc> - bool - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const - { - if (_M_impl._M_node_count == 0 || begin() == end()) - return _M_impl._M_node_count == 0 && begin() == end() - && this->_M_impl._M_header._M_left == _M_end() - && this->_M_impl._M_header._M_right == _M_end(); - - unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root()); - for (const_iterator __it = begin(); __it != end(); ++__it) - { - _Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node); - _Const_Link_type __L = _S_left(__x); - _Const_Link_type __R = _S_right(__x); - - if (__x->_M_color == _S_red) - if ((__L && __L->_M_color == _S_red) - || (__R && __R->_M_color == _S_red)) - return false; - - if (__L && _M_impl._M_key_compare(_S_key(__x), _S_key(__L))) - return false; - if (__R && _M_impl._M_key_compare(_S_key(__R), _S_key(__x))) - return false; - - if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len) - return false; - } - - if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root())) - return false; - if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root())) - return false; - return true; - } -} // namespace std - -#endif - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h deleted file mode 100644 index f4f8d187f64..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h +++ /dev/null @@ -1,297 +0,0 @@ -// Raw memory manipulators -*- C++ -*- - -// Copyright (C) 2001, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_uninitialized.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _STL_UNINITIALIZED_H -#define _STL_UNINITIALIZED_H 1 - -#include <cstring> - -namespace std -{ - // uninitialized_copy - template<typename _InputIterator, typename _ForwardIterator> - inline _ForwardIterator - __uninitialized_copy_aux(_InputIterator __first, _InputIterator __last, - _ForwardIterator __result, - __true_type) - { return std::copy(__first, __last, __result); } - - template<typename _InputIterator, typename _ForwardIterator> - inline _ForwardIterator - __uninitialized_copy_aux(_InputIterator __first, _InputIterator __last, - _ForwardIterator __result, - __false_type) - { - _ForwardIterator __cur = __result; - try - { - for ( ; __first != __last; ++__first, ++__cur) - std::_Construct(&*__cur, *__first); - return __cur; - } - catch(...) - { - std::_Destroy(__result, __cur); - __throw_exception_again; - } - } - - /** - * @brief Copies the range [first,last) into result. - * @param first An input iterator. - * @param last An input iterator. - * @param result An output iterator. - * @return result + (first - last) - * - * Like copy(), but does not require an initialized output range. - */ - template<typename _InputIterator, typename _ForwardIterator> - inline _ForwardIterator - uninitialized_copy(_InputIterator __first, _InputIterator __last, - _ForwardIterator __result) - { - typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; - typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; - return std::__uninitialized_copy_aux(__first, __last, __result, - _Is_POD()); - } - - inline char* - uninitialized_copy(const char* __first, const char* __last, char* __result) - { - std::memmove(__result, __first, __last - __first); - return __result + (__last - __first); - } - - inline wchar_t* - uninitialized_copy(const wchar_t* __first, const wchar_t* __last, - wchar_t* __result) - { - std::memmove(__result, __first, sizeof(wchar_t) * (__last - __first)); - return __result + (__last - __first); - } - - // Valid if copy construction is equivalent to assignment, and if the - // destructor is trivial. - template<typename _ForwardIterator, typename _Tp> - inline void - __uninitialized_fill_aux(_ForwardIterator __first, - _ForwardIterator __last, - const _Tp& __x, __true_type) - { std::fill(__first, __last, __x); } - - template<typename _ForwardIterator, typename _Tp> - void - __uninitialized_fill_aux(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __x, __false_type) - { - _ForwardIterator __cur = __first; - try - { - for ( ; __cur != __last; ++__cur) - std::_Construct(&*__cur, __x); - } - catch(...) - { - std::_Destroy(__first, __cur); - __throw_exception_again; - } - } - - /** - * @brief Copies the value x into the range [first,last). - * @param first An input iterator. - * @param last An input iterator. - * @param x The source value. - * @return Nothing. - * - * Like fill(), but does not require an initialized output range. - */ - template<typename _ForwardIterator, typename _Tp> - inline void - uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last, - const _Tp& __x) - { - typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; - typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; - std::__uninitialized_fill_aux(__first, __last, __x, _Is_POD()); - } - - // Valid if copy construction is equivalent to assignment, and if the - // destructor is trivial. - template<typename _ForwardIterator, typename _Size, typename _Tp> - inline _ForwardIterator - __uninitialized_fill_n_aux(_ForwardIterator __first, _Size __n, - const _Tp& __x, __true_type) - { return std::fill_n(__first, __n, __x); } - - template<typename _ForwardIterator, typename _Size, typename _Tp> - _ForwardIterator - __uninitialized_fill_n_aux(_ForwardIterator __first, _Size __n, - const _Tp& __x, __false_type) - { - _ForwardIterator __cur = __first; - try - { - for ( ; __n > 0; --__n, ++__cur) - std::_Construct(&*__cur, __x); - return __cur; - } - catch(...) - { - std::_Destroy(__first, __cur); - __throw_exception_again; - } - } - - /** - * @brief Copies the value x into the range [first,first+n). - * @param first An input iterator. - * @param n The number of copies to make. - * @param x The source value. - * @return first+n - * - * Like fill_n(), but does not require an initialized output range. - */ - template<typename _ForwardIterator, typename _Size, typename _Tp> - inline _ForwardIterator - uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) - { - typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; - typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; - return std::__uninitialized_fill_n_aux(__first, __n, __x, _Is_POD()); - } - - // Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill, - // __uninitialized_fill_copy. - - // __uninitialized_copy_copy - // Copies [first1, last1) into [result, result + (last1 - first1)), and - // copies [first2, last2) into - // [result, result + (last1 - first1) + (last2 - first2)). - - template<typename _InputIterator1, typename _InputIterator2, - typename _ForwardIterator> - inline _ForwardIterator - __uninitialized_copy_copy(_InputIterator1 __first1, - _InputIterator1 __last1, - _InputIterator2 __first2, - _InputIterator2 __last2, - _ForwardIterator __result) - { - _ForwardIterator __mid = std::uninitialized_copy(__first1, __last1, - __result); - try - { - return std::uninitialized_copy(__first2, __last2, __mid); - } - catch(...) - { - std::_Destroy(__result, __mid); - __throw_exception_again; - } - } - - // __uninitialized_fill_copy - // Fills [result, mid) with x, and copies [first, last) into - // [mid, mid + (last - first)). - template<typename _ForwardIterator, typename _Tp, typename _InputIterator> - inline _ForwardIterator - __uninitialized_fill_copy(_ForwardIterator __result, _ForwardIterator __mid, - const _Tp& __x, _InputIterator __first, - _InputIterator __last) - { - std::uninitialized_fill(__result, __mid, __x); - try - { - return std::uninitialized_copy(__first, __last, __mid); - } - catch(...) - { - std::_Destroy(__result, __mid); - __throw_exception_again; - } - } - - // __uninitialized_copy_fill - // Copies [first1, last1) into [first2, first2 + (last1 - first1)), and - // fills [first2 + (last1 - first1), last2) with x. - template<typename _InputIterator, typename _ForwardIterator, typename _Tp> - inline void - __uninitialized_copy_fill(_InputIterator __first1, _InputIterator __last1, - _ForwardIterator __first2, - _ForwardIterator __last2, const _Tp& __x) - { - _ForwardIterator __mid2 = std::uninitialized_copy(__first1, __last1, - __first2); - try - { - std::uninitialized_fill(__mid2, __last2, __x); - } - catch(...) - { - std::_Destroy(__first2, __mid2); - __throw_exception_again; - } - } - -} // namespace std - -#endif /* _STL_UNINITIALIZED_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h deleted file mode 100644 index fee413dc6f0..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h +++ /dev/null @@ -1,932 +0,0 @@ -// Vector implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stl_vector.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _VECTOR_H -#define _VECTOR_H 1 - -#include <bits/stl_iterator_base_funcs.h> -#include <bits/functexcept.h> -#include <bits/concept_check.h> - -namespace _GLIBCXX_STD -{ - /** - * @if maint - * See bits/stl_deque.h's _Deque_base for an explanation. - * @endif - */ - template<typename _Tp, typename _Alloc> - struct _Vector_base - { - struct _Vector_impl - : public _Alloc { - _Tp* _M_start; - _Tp* _M_finish; - _Tp* _M_end_of_storage; - _Vector_impl (_Alloc const& __a) - : _Alloc(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0) - { } - }; - - public: - typedef _Alloc allocator_type; - - allocator_type - get_allocator() const { return *static_cast<const _Alloc*>(&this->_M_impl); } - - _Vector_base(const allocator_type& __a) : _M_impl(__a) - { } - - _Vector_base(size_t __n, const allocator_type& __a) - : _M_impl(__a) - { - this->_M_impl._M_start = this->_M_allocate(__n); - this->_M_impl._M_finish = this->_M_impl._M_start; - this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; - } - - ~_Vector_base() - { _M_deallocate(this->_M_impl._M_start, - this->_M_impl._M_end_of_storage - this->_M_impl._M_start); } - - public: - _Vector_impl _M_impl; - - _Tp* - _M_allocate(size_t __n) { return _M_impl.allocate(__n); } - - void - _M_deallocate(_Tp* __p, size_t __n) - { if (__p) _M_impl.deallocate(__p, __n); } - }; - - - /** - * @brief A standard container which offers fixed time access to - * individual elements in any order. - * - * @ingroup Containers - * @ingroup Sequences - * - * Meets the requirements of a <a href="tables.html#65">container</a>, a - * <a href="tables.html#66">reversible container</a>, and a - * <a href="tables.html#67">sequence</a>, including the - * <a href="tables.html#68">optional sequence requirements</a> with the - * %exception of @c push_front and @c pop_front. - * - * In some terminology a %vector can be described as a dynamic - * C-style array, it offers fast and efficient access to individual - * elements in any order and saves the user from worrying about - * memory and size allocation. Subscripting ( @c [] ) access is - * also provided as with C-style arrays. - */ - template<typename _Tp, typename _Alloc = allocator<_Tp> > - class vector : protected _Vector_base<_Tp, _Alloc> - { - // Concept requirements. - __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - - typedef _Vector_base<_Tp, _Alloc> _Base; - typedef vector<_Tp, _Alloc> vector_type; - - public: - typedef _Tp value_type; - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - typedef __gnu_cxx::__normal_iterator<pointer, vector_type> iterator; - typedef __gnu_cxx::__normal_iterator<const_pointer, vector_type> - const_iterator; - typedef std::reverse_iterator<const_iterator> const_reverse_iterator; - typedef std::reverse_iterator<iterator> reverse_iterator; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef typename _Base::allocator_type allocator_type; - - protected: - /** @if maint - * These two functions and three data members are all from the - * base class. They should be pretty self-explanatory, as - * %vector uses a simple contiguous allocation scheme. @endif - */ - using _Base::_M_allocate; - using _Base::_M_deallocate; - using _Base::_M_impl; - - public: - // [23.2.4.1] construct/copy/destroy - // (assign() and get_allocator() are also listed in this section) - /** - * @brief Default constructor creates no elements. - */ - explicit - vector(const allocator_type& __a = allocator_type()) - : _Base(__a) { } - - /** - * @brief Create a %vector with copies of an exemplar element. - * @param n The number of elements to initially create. - * @param value An element to copy. - * - * This constructor fills the %vector with @a n copies of @a value. - */ - vector(size_type __n, const value_type& __value, - const allocator_type& __a = allocator_type()) - : _Base(__n, __a) - { this->_M_impl._M_finish = std::uninitialized_fill_n(this->_M_impl._M_start, - __n, __value); } - - /** - * @brief Create a %vector with default elements. - * @param n The number of elements to initially create. - * - * This constructor fills the %vector with @a n copies of a - * default-constructed element. - */ - explicit - vector(size_type __n) - : _Base(__n, allocator_type()) - { this->_M_impl._M_finish = std::uninitialized_fill_n(this->_M_impl._M_start, - __n, value_type()); } - - /** - * @brief %Vector copy constructor. - * @param x A %vector of identical element and allocator types. - * - * The newly-created %vector uses a copy of the allocation - * object used by @a x. All the elements of @a x are copied, - * but any extra memory in - * @a x (for fast expansion) will not be copied. - */ - vector(const vector& __x) - : _Base(__x.size(), __x.get_allocator()) - { this->_M_impl._M_finish = std::uninitialized_copy(__x.begin(), __x.end(), - this->_M_impl._M_start); - } - - /** - * @brief Builds a %vector from a range. - * @param first An input iterator. - * @param last An input iterator. - * - * Create a %vector consisting of copies of the elements from - * [first,last). - * - * If the iterators are forward, bidirectional, or - * random-access, then this will call the elements' copy - * constructor N times (where N is distance(first,last)) and do - * no memory reallocation. But if only input iterators are - * used, then this will do at most 2N calls to the copy - * constructor, and logN memory reallocations. - */ - template<typename _InputIterator> - vector(_InputIterator __first, _InputIterator __last, - const allocator_type& __a = allocator_type()) - : _Base(__a) - { - // Check whether it's an integral type. If so, it's not an iterator. - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_initialize_dispatch(__first, __last, _Integral()); - } - - /** - * The dtor only erases the elements, and note that if the - * elements themselves are pointers, the pointed-to memory is - * not touched in any way. Managing the pointer is the user's - * responsibilty. - */ - ~vector() { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish); } - - /** - * @brief %Vector assignment operator. - * @param x A %vector of identical element and allocator types. - * - * All the elements of @a x are copied, but any extra memory in - * @a x (for fast expansion) will not be copied. Unlike the - * copy constructor, the allocator object is not copied. - */ - vector& - operator=(const vector& __x); - - /** - * @brief Assigns a given value to a %vector. - * @param n Number of elements to be assigned. - * @param val Value to be assigned. - * - * This function fills a %vector with @a n copies of the given - * value. Note that the assignment completely changes the - * %vector and that the resulting %vector's size is the same as - * the number of elements assigned. Old data may be lost. - */ - void - assign(size_type __n, const value_type& __val) - { _M_fill_assign(__n, __val); } - - /** - * @brief Assigns a range to a %vector. - * @param first An input iterator. - * @param last An input iterator. - * - * This function fills a %vector with copies of the elements in the - * range [first,last). - * - * Note that the assignment completely changes the %vector and - * that the resulting %vector's size is the same as the number - * of elements assigned. Old data may be lost. - */ - template<typename _InputIterator> - void - assign(_InputIterator __first, _InputIterator __last) - { - // Check whether it's an integral type. If so, it's not an iterator. - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_assign_dispatch(__first, __last, _Integral()); - } - - /// Get a copy of the memory allocation object. - using _Base::get_allocator; - - // iterators - /** - * Returns a read/write iterator that points to the first - * element in the %vector. Iteration is done in ordinary - * element order. - */ - iterator - begin() { return iterator (this->_M_impl._M_start); } - - /** - * Returns a read-only (constant) iterator that points to the - * first element in the %vector. Iteration is done in ordinary - * element order. - */ - const_iterator - begin() const { return const_iterator (this->_M_impl._M_start); } - - /** - * Returns a read/write iterator that points one past the last - * element in the %vector. Iteration is done in ordinary - * element order. - */ - iterator - end() { return iterator (this->_M_impl._M_finish); } - - /** - * Returns a read-only (constant) iterator that points one past - * the last element in the %vector. Iteration is done in - * ordinary element order. - */ - const_iterator - end() const { return const_iterator (this->_M_impl._M_finish); } - - /** - * Returns a read/write reverse iterator that points to the - * last element in the %vector. Iteration is done in reverse - * element order. - */ - reverse_iterator - rbegin() { return reverse_iterator(end()); } - - /** - * Returns a read-only (constant) reverse iterator that points - * to the last element in the %vector. Iteration is done in - * reverse element order. - */ - const_reverse_iterator - rbegin() const { return const_reverse_iterator(end()); } - - /** - * Returns a read/write reverse iterator that points to one - * before the first element in the %vector. Iteration is done - * in reverse element order. - */ - reverse_iterator - rend() { return reverse_iterator(begin()); } - - /** - * Returns a read-only (constant) reverse iterator that points - * to one before the first element in the %vector. Iteration - * is done in reverse element order. - */ - const_reverse_iterator - rend() const { return const_reverse_iterator(begin()); } - - // [23.2.4.2] capacity - /** Returns the number of elements in the %vector. */ - size_type - size() const { return size_type(end() - begin()); } - - /** Returns the size() of the largest possible %vector. */ - size_type - max_size() const { return size_type(-1) / sizeof(value_type); } - - /** - * @brief Resizes the %vector to the specified number of elements. - * @param new_size Number of elements the %vector should contain. - * @param x Data with which new elements should be populated. - * - * This function will %resize the %vector to the specified - * number of elements. If the number is smaller than the - * %vector's current size the %vector is truncated, otherwise - * the %vector is extended and new elements are populated with - * given data. - */ - void - resize(size_type __new_size, const value_type& __x) - { - if (__new_size < size()) - erase(begin() + __new_size, end()); - else - insert(end(), __new_size - size(), __x); - } - - /** - * @brief Resizes the %vector to the specified number of elements. - * @param new_size Number of elements the %vector should contain. - * - * This function will resize the %vector to the specified - * number of elements. If the number is smaller than the - * %vector's current size the %vector is truncated, otherwise - * the %vector is extended and new elements are - * default-constructed. - */ - void - resize(size_type __new_size) { resize(__new_size, value_type()); } - - /** - * Returns the total number of elements that the %vector can - * hold before needing to allocate more memory. - */ - size_type - capacity() const - { return size_type(const_iterator(this->_M_impl._M_end_of_storage) - begin()); } - - /** - * Returns true if the %vector is empty. (Thus begin() would - * equal end().) - */ - bool - empty() const { return begin() == end(); } - - /** - * @brief Attempt to preallocate enough memory for specified number of - * elements. - * @param n Number of elements required. - * @throw std::length_error If @a n exceeds @c max_size(). - * - * This function attempts to reserve enough memory for the - * %vector to hold the specified number of elements. If the - * number requested is more than max_size(), length_error is - * thrown. - * - * The advantage of this function is that if optimal code is a - * necessity and the user can determine the number of elements - * that will be required, the user can reserve the memory in - * %advance, and thus prevent a possible reallocation of memory - * and copying of %vector data. - */ - void - reserve(size_type __n); - - // element access - /** - * @brief Subscript access to the data contained in the %vector. - * @param n The index of the element for which data should be - * accessed. - * @return Read/write reference to data. - * - * This operator allows for easy, array-style, data access. - * Note that data access with this operator is unchecked and - * out_of_range lookups are not defined. (For checked lookups - * see at().) - */ - reference - operator[](size_type __n) { return *(begin() + __n); } - - /** - * @brief Subscript access to the data contained in the %vector. - * @param n The index of the element for which data should be - * accessed. - * @return Read-only (constant) reference to data. - * - * This operator allows for easy, array-style, data access. - * Note that data access with this operator is unchecked and - * out_of_range lookups are not defined. (For checked lookups - * see at().) - */ - const_reference - operator[](size_type __n) const { return *(begin() + __n); } - - protected: - /// @if maint Safety check used only from at(). @endif - void - _M_range_check(size_type __n) const - { - if (__n >= this->size()) - __throw_out_of_range(__N("vector::_M_range_check")); - } - - public: - /** - * @brief Provides access to the data contained in the %vector. - * @param n The index of the element for which data should be - * accessed. - * @return Read/write reference to data. - * @throw std::out_of_range If @a n is an invalid index. - * - * This function provides for safer data access. The parameter - * is first checked that it is in the range of the vector. The - * function throws out_of_range if the check fails. - */ - reference - at(size_type __n) { _M_range_check(__n); return (*this)[__n]; } - - /** - * @brief Provides access to the data contained in the %vector. - * @param n The index of the element for which data should be - * accessed. - * @return Read-only (constant) reference to data. - * @throw std::out_of_range If @a n is an invalid index. - * - * This function provides for safer data access. The parameter - * is first checked that it is in the range of the vector. The - * function throws out_of_range if the check fails. - */ - const_reference - at(size_type __n) const { _M_range_check(__n); return (*this)[__n]; } - - /** - * Returns a read/write reference to the data at the first - * element of the %vector. - */ - reference - front() { return *begin(); } - - /** - * Returns a read-only (constant) reference to the data at the first - * element of the %vector. - */ - const_reference - front() const { return *begin(); } - - /** - * Returns a read/write reference to the data at the last - * element of the %vector. - */ - reference - back() { return *(end() - 1); } - - /** - * Returns a read-only (constant) reference to the data at the - * last element of the %vector. - */ - const_reference - back() const { return *(end() - 1); } - - // [23.2.4.3] modifiers - /** - * @brief Add data to the end of the %vector. - * @param x Data to be added. - * - * This is a typical stack operation. The function creates an - * element at the end of the %vector and assigns the given data - * to it. Due to the nature of a %vector this operation can be - * done in constant time if the %vector has preallocated space - * available. - */ - void - push_back(const value_type& __x) - { - if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) - { - std::_Construct(this->_M_impl._M_finish, __x); - ++this->_M_impl._M_finish; - } - else - _M_insert_aux(end(), __x); - } - - /** - * @brief Removes last element. - * - * This is a typical stack operation. It shrinks the %vector by one. - * - * Note that no data is returned, and if the last element's - * data is needed, it should be retrieved before pop_back() is - * called. - */ - void - pop_back() - { - --this->_M_impl._M_finish; - std::_Destroy(this->_M_impl._M_finish); - } - - /** - * @brief Inserts given value into %vector before specified iterator. - * @param position An iterator into the %vector. - * @param x Data to be inserted. - * @return An iterator that points to the inserted data. - * - * This function will insert a copy of the given value before - * the specified location. Note that this kind of operation - * could be expensive for a %vector and if it is frequently - * used the user should consider using std::list. - */ - iterator - insert(iterator __position, const value_type& __x); - - /** - * @brief Inserts a number of copies of given data into the %vector. - * @param position An iterator into the %vector. - * @param n Number of elements to be inserted. - * @param x Data to be inserted. - * - * This function will insert a specified number of copies of - * the given data before the location specified by @a position. - * - * Note that this kind of operation could be expensive for a - * %vector and if it is frequently used the user should - * consider using std::list. - */ - void - insert(iterator __position, size_type __n, const value_type& __x) - { _M_fill_insert(__position, __n, __x); } - - /** - * @brief Inserts a range into the %vector. - * @param position An iterator into the %vector. - * @param first An input iterator. - * @param last An input iterator. - * - * This function will insert copies of the data in the range - * [first,last) into the %vector before the location specified - * by @a pos. - * - * Note that this kind of operation could be expensive for a - * %vector and if it is frequently used the user should - * consider using std::list. - */ - template<typename _InputIterator> - void - insert(iterator __position, _InputIterator __first, - _InputIterator __last) - { - // Check whether it's an integral type. If so, it's not an iterator. - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_insert_dispatch(__position, __first, __last, _Integral()); - } - - /** - * @brief Remove element at given position. - * @param position Iterator pointing to element to be erased. - * @return An iterator pointing to the next element (or end()). - * - * This function will erase the element at the given position and thus - * shorten the %vector by one. - * - * Note This operation could be expensive and if it is - * frequently used the user should consider using std::list. - * The user is also cautioned that this function only erases - * the element, and that if the element is itself a pointer, - * the pointed-to memory is not touched in any way. Managing - * the pointer is the user's responsibilty. - */ - iterator - erase(iterator __position); - - /** - * @brief Remove a range of elements. - * @param first Iterator pointing to the first element to be erased. - * @param last Iterator pointing to one past the last element to be - * erased. - * @return An iterator pointing to the element pointed to by @a last - * prior to erasing (or end()). - * - * This function will erase the elements in the range [first,last) and - * shorten the %vector accordingly. - * - * Note This operation could be expensive and if it is - * frequently used the user should consider using std::list. - * The user is also cautioned that this function only erases - * the elements, and that if the elements themselves are - * pointers, the pointed-to memory is not touched in any way. - * Managing the pointer is the user's responsibilty. - */ - iterator - erase(iterator __first, iterator __last); - - /** - * @brief Swaps data with another %vector. - * @param x A %vector of the same element and allocator types. - * - * This exchanges the elements between two vectors in constant time. - * (Three pointers, so it should be quite fast.) - * Note that the global std::swap() function is specialized such that - * std::swap(v1,v2) will feed to this function. - */ - void - swap(vector& __x) - { - std::swap(this->_M_impl._M_start, __x._M_impl._M_start); - std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish); - std::swap(this->_M_impl._M_end_of_storage, __x._M_impl._M_end_of_storage); - } - - /** - * Erases all the elements. Note that this function only erases the - * elements, and that if the elements themselves are pointers, the - * pointed-to memory is not touched in any way. Managing the pointer is - * the user's responsibilty. - */ - void - clear() { erase(begin(), end()); } - - protected: - /** - * @if maint - * Memory expansion handler. Uses the member allocation function to - * obtain @a n bytes of memory, and then copies [first,last) into it. - * @endif - */ - template<typename _ForwardIterator> - pointer - _M_allocate_and_copy(size_type __n, - _ForwardIterator __first, _ForwardIterator __last) - { - pointer __result = this->_M_allocate(__n); - try - { - std::uninitialized_copy(__first, __last, __result); - return __result; - } - catch(...) - { - _M_deallocate(__result, __n); - __throw_exception_again; - } - } - - - // Internal constructor functions follow. - - // Called by the range constructor to implement [23.1.1]/9 - template<typename _Integer> - void - _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type) - { - this->_M_impl._M_start = _M_allocate(__n); - this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; - this->_M_impl._M_finish = std::uninitialized_fill_n(this->_M_impl._M_start, - __n, __value); - } - - // Called by the range constructor to implement [23.1.1]/9 - template<typename _InputIterator> - void - _M_initialize_dispatch(_InputIterator __first, _InputIterator __last, - __false_type) - { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; - _M_range_initialize(__first, __last, _IterCategory()); - } - - // Called by the second initialize_dispatch above - template<typename _InputIterator> - void - _M_range_initialize(_InputIterator __first, - _InputIterator __last, input_iterator_tag) - { - for ( ; __first != __last; ++__first) - push_back(*__first); - } - - // Called by the second initialize_dispatch above - template<typename _ForwardIterator> - void - _M_range_initialize(_ForwardIterator __first, - _ForwardIterator __last, forward_iterator_tag) - { - size_type __n = std::distance(__first, __last); - this->_M_impl._M_start = this->_M_allocate(__n); - this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; - this->_M_impl._M_finish = std::uninitialized_copy(__first, __last, - this->_M_impl._M_start); - } - - - // Internal assign functions follow. The *_aux functions do the actual - // assignment work for the range versions. - - // Called by the range assign to implement [23.1.1]/9 - template<typename _Integer> - void - _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) - { - _M_fill_assign(static_cast<size_type>(__n), - static_cast<value_type>(__val)); - } - - // Called by the range assign to implement [23.1.1]/9 - template<typename _InputIterator> - void - _M_assign_dispatch(_InputIterator __first, _InputIterator __last, - __false_type) - { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; - _M_assign_aux(__first, __last, _IterCategory()); - } - - // Called by the second assign_dispatch above - template<typename _InputIterator> - void - _M_assign_aux(_InputIterator __first, _InputIterator __last, - input_iterator_tag); - - // Called by the second assign_dispatch above - template<typename _ForwardIterator> - void - _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag); - - // Called by assign(n,t), and the range assign when it turns out - // to be the same thing. - void - _M_fill_assign(size_type __n, const value_type& __val); - - - // Internal insert functions follow. - - // Called by the range insert to implement [23.1.1]/9 - template<typename _Integer> - void - _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val, - __true_type) - { - _M_fill_insert(__pos, static_cast<size_type>(__n), - static_cast<value_type>(__val)); - } - - // Called by the range insert to implement [23.1.1]/9 - template<typename _InputIterator> - void - _M_insert_dispatch(iterator __pos, _InputIterator __first, - _InputIterator __last, __false_type) - { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; - _M_range_insert(__pos, __first, __last, _IterCategory()); - } - - // Called by the second insert_dispatch above - template<typename _InputIterator> - void - _M_range_insert(iterator __pos, _InputIterator __first, - _InputIterator __last, input_iterator_tag); - - // Called by the second insert_dispatch above - template<typename _ForwardIterator> - void - _M_range_insert(iterator __pos, _ForwardIterator __first, - _ForwardIterator __last, forward_iterator_tag); - - // Called by insert(p,n,x), and the range insert when it turns out to be - // the same thing. - void - _M_fill_insert(iterator __pos, size_type __n, const value_type& __x); - - // Called by insert(p,x) - void - _M_insert_aux(iterator __position, const value_type& __x); - }; - - - /** - * @brief Vector equality comparison. - * @param x A %vector. - * @param y A %vector of the same type as @a x. - * @return True iff the size and elements of the vectors are equal. - * - * This is an equivalence relation. It is linear in the size of the - * vectors. Vectors are considered equivalent if their sizes are equal, - * and if corresponding elements compare equal. - */ - template<typename _Tp, typename _Alloc> - inline bool - operator==(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) - { - return __x.size() == __y.size() && - std::equal(__x.begin(), __x.end(), __y.begin()); - } - - /** - * @brief Vector ordering relation. - * @param x A %vector. - * @param y A %vector of the same type as @a x. - * @return True iff @a x is lexicographically less than @a y. - * - * This is a total ordering relation. It is linear in the size of the - * vectors. The elements must be comparable with @c <. - * - * See std::lexicographical_compare() for how the determination is made. - */ - template<typename _Tp, typename _Alloc> - inline bool - operator<(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) - { - return std::lexicographical_compare(__x.begin(), __x.end(), - __y.begin(), __y.end()); - } - - /// Based on operator== - template<typename _Tp, typename _Alloc> - inline bool - operator!=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) - { return !(__x == __y); } - - /// Based on operator< - template<typename _Tp, typename _Alloc> - inline bool - operator>(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) - { return __y < __x; } - - /// Based on operator< - template<typename _Tp, typename _Alloc> - inline bool - operator<=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) - { return !(__y < __x); } - - /// Based on operator< - template<typename _Tp, typename _Alloc> - inline bool - operator>=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) - { return !(__x < __y); } - - /// See std::vector::swap(). - template<typename _Tp, typename _Alloc> - inline void - swap(vector<_Tp,_Alloc>& __x, vector<_Tp,_Alloc>& __y) - { __x.swap(__y); } -} // namespace std - -#endif /* _VECTOR_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stream_iterator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stream_iterator.h deleted file mode 100644 index fa11bd6b28f..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stream_iterator.h +++ /dev/null @@ -1,214 +0,0 @@ -// Stream iterators - -// Copyright (C) 2001, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file stream_iterator.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _STREAM_ITERATOR_H -#define _STREAM_ITERATOR_H 1 - -#pragma GCC system_header - -#include <debug/debug.h> - -namespace std -{ - /// Provides input iterator semantics for streams. - template<typename _Tp, typename _CharT = char, - typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t> - class istream_iterator - : public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&> - { - public: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef basic_istream<_CharT, _Traits> istream_type; - - private: - istream_type* _M_stream; - _Tp _M_value; - bool _M_ok; - - public: - /// Construct end of input stream iterator. - istream_iterator() - : _M_stream(0), _M_ok(false) {} - - /// Construct start of input stream iterator. - istream_iterator(istream_type& __s) - : _M_stream(&__s) - { _M_read(); } - - istream_iterator(const istream_iterator& __obj) - : _M_stream(__obj._M_stream), _M_value(__obj._M_value), - _M_ok(__obj._M_ok) - { } - - const _Tp& - operator*() const - { - __glibcxx_requires_cond(_M_ok, - _M_message(__gnu_debug::__msg_deref_istream) - ._M_iterator(*this)); - return _M_value; - } - - const _Tp* - operator->() const { return &(operator*()); } - - istream_iterator& - operator++() - { - __glibcxx_requires_cond(_M_ok, - _M_message(__gnu_debug::__msg_inc_istream) - ._M_iterator(*this)); - _M_read(); - return *this; - } - - istream_iterator - operator++(int) - { - __glibcxx_requires_cond(_M_ok, - _M_message(__gnu_debug::__msg_inc_istream) - ._M_iterator(*this)); - istream_iterator __tmp = *this; - _M_read(); - return __tmp; - } - - bool - _M_equal(const istream_iterator& __x) const - { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); } - - private: - void - _M_read() - { - _M_ok = (_M_stream && *_M_stream) ? true : false; - if (_M_ok) - { - *_M_stream >> _M_value; - _M_ok = *_M_stream ? true : false; - } - } - }; - - /// Return true if x and y are both end or not end, or x and y are the same. - template<typename _Tp, typename _CharT, typename _Traits, typename _Dist> - inline bool - operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x, - const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) - { return __x._M_equal(__y); } - - /// Return false if x and y are both end or not end, or x and y are the same. - template <class _Tp, class _CharT, class _Traits, class _Dist> - inline bool - operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x, - const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) - { return !__x._M_equal(__y); } - - /** - * @brief Provides output iterator semantics for streams. - * - * This class provides an iterator to write to an ostream. The type Tp is - * the only type written by this iterator and there must be an - * operator<<(Tp) defined. - * - * @param Tp The type to write to the ostream. - * @param CharT The ostream char_type. - * @param Traits The ostream char_traits. - */ - template<typename _Tp, typename _CharT = char, - typename _Traits = char_traits<_CharT> > - class ostream_iterator - : public iterator<output_iterator_tag, void, void, void, void> - { - public: - //@{ - /// Public typedef - typedef _CharT char_type; - typedef _Traits traits_type; - typedef basic_ostream<_CharT, _Traits> ostream_type; - //@} - - private: - ostream_type* _M_stream; - const _CharT* _M_string; - - public: - /// Construct from an ostream. - ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {} - - /** - * Construct from an ostream. - * - * The delimiter string @a c is written to the stream after every Tp - * written to the stream. The delimiter is not copied, and thus must - * not be destroyed while this iterator is in use. - * - * @param s Underlying ostream to write to. - * @param c CharT delimiter string to insert. - */ - ostream_iterator(ostream_type& __s, const _CharT* __c) - : _M_stream(&__s), _M_string(__c) { } - - /// Copy constructor. - ostream_iterator(const ostream_iterator& __obj) - : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { } - - /// Writes @a value to underlying ostream using operator<<. If - /// constructed with delimiter string, writes delimiter to ostream. - ostream_iterator& - operator=(const _Tp& __value) - { - __glibcxx_requires_cond(_M_stream != 0, - _M_message(__gnu_debug::__msg_output_ostream) - ._M_iterator(*this)); - *_M_stream << __value; - if (_M_string) *_M_stream << _M_string; - return *this; - } - - ostream_iterator& - operator*() - { return *this; } - - ostream_iterator& - operator++() - { return *this; } - - ostream_iterator& - operator++(int) - { return *this; } - }; -} // namespace std -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/streambuf.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/streambuf.tcc deleted file mode 100644 index 554d0617899..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/streambuf.tcc +++ /dev/null @@ -1,163 +0,0 @@ -// Stream buffer classes -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.5 Stream buffers -// - -#ifndef _STREAMBUF_TCC -#define _STREAMBUF_TCC 1 - -#pragma GCC system_header - -namespace std -{ - template<typename _CharT, typename _Traits> - streamsize - basic_streambuf<_CharT, _Traits>:: - xsgetn(char_type* __s, streamsize __n) - { - streamsize __ret = 0; - while (__ret < __n) - { - const size_t __buf_len = this->egptr() - this->gptr(); - if (__buf_len) - { - const size_t __remaining = __n - __ret; - const size_t __len = std::min(__buf_len, __remaining); - traits_type::copy(__s, this->gptr(), __len); - __ret += __len; - __s += __len; - this->gbump(__len); - } - - if (__ret < __n) - { - const int_type __c = this->uflow(); - if (!traits_type::eq_int_type(__c, traits_type::eof())) - { - traits_type::assign(*__s++, traits_type::to_char_type(__c)); - ++__ret; - } - else - break; - } - } - return __ret; - } - - template<typename _CharT, typename _Traits> - streamsize - basic_streambuf<_CharT, _Traits>:: - xsputn(const char_type* __s, streamsize __n) - { - streamsize __ret = 0; - while (__ret < __n) - { - const size_t __buf_len = this->epptr() - this->pptr(); - if (__buf_len) - { - const size_t __remaining = __n - __ret; - const size_t __len = std::min(__buf_len, __remaining); - traits_type::copy(this->pptr(), __s, __len); - __ret += __len; - __s += __len; - this->pbump(__len); - } - - if (__ret < __n) - { - int_type __c = this->overflow(traits_type::to_int_type(*__s)); - if (!traits_type::eq_int_type(__c, traits_type::eof())) - { - ++__ret; - ++__s; - } - else - break; - } - } - return __ret; - } - - // Conceivably, this could be used to implement buffer-to-buffer - // copies, if this was ever desired in an un-ambiguous way by the - // standard. If so, then checks for __ios being zero would be - // necessary. - template<typename _CharT, typename _Traits> - streamsize - __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin, - basic_streambuf<_CharT, _Traits>* __sbout) - { - streamsize __ret = 0; - typename _Traits::int_type __c = __sbin->sgetc(); - while (!_Traits::eq_int_type(__c, _Traits::eof())) - { - const size_t __n = __sbin->egptr() - __sbin->gptr(); - if (__n > 1) - { - const size_t __wrote = __sbout->sputn(__sbin->gptr(), __n); - __sbin->gbump(__wrote); - __ret += __wrote; - if (__wrote < __n) - break; - __c = __sbin->underflow(); - } - else - { - __c = __sbout->sputc(_Traits::to_char_type(__c)); - if (_Traits::eq_int_type(__c, _Traits::eof())) - break; - ++__ret; - __c = __sbin->snextc(); - } - } - return __ret; - } - - // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. -#if _GLIBCXX_EXTERN_TEMPLATE - extern template class basic_streambuf<char>; - extern template - streamsize - __copy_streambufs(basic_streambuf<char>*, basic_streambuf<char>*); - -#ifdef _GLIBCXX_USE_WCHAR_T - extern template class basic_streambuf<wchar_t>; - extern template - streamsize - __copy_streambufs(basic_streambuf<wchar_t>*, basic_streambuf<wchar_t>*); -#endif -#endif -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/streambuf_iterator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/streambuf_iterator.h deleted file mode 100644 index 970933578c7..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/streambuf_iterator.h +++ /dev/null @@ -1,258 +0,0 @@ -// Streambuf iterators - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file streambuf_iterator.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _STREAMBUF_ITERATOR_H -#define _STREAMBUF_ITERATOR_H 1 - -#pragma GCC system_header - -#include <streambuf> -#include <debug/debug.h> - -// NB: Should specialize copy, find algorithms for streambuf iterators. - -namespace std -{ - // 24.5.3 Template class istreambuf_iterator - /// Provides input iterator semantics for streambufs. - template<typename _CharT, typename _Traits> - class istreambuf_iterator - : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type, - _CharT*, _CharT&> - { - public: - // Types: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename _Traits::int_type int_type; - typedef basic_streambuf<_CharT, _Traits> streambuf_type; - typedef basic_istream<_CharT, _Traits> istream_type; - //@} - - private: - // 24.5.3 istreambuf_iterator - // p 1 - // If the end of stream is reached (streambuf_type::sgetc() - // returns traits_type::eof()), the iterator becomes equal to - // the "end of stream" iterator value. - // NB: This implementation assumes the "end of stream" value - // is EOF, or -1. - mutable streambuf_type* _M_sbuf; - int_type _M_c; - - public: - /// Construct end of input stream iterator. - istreambuf_iterator() throw() - : _M_sbuf(0), _M_c(traits_type::eof()) { } - - /// Construct start of input stream iterator. - istreambuf_iterator(istream_type& __s) throw() - : _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { } - - /// Construct start of streambuf iterator. - istreambuf_iterator(streambuf_type* __s) throw() - : _M_sbuf(__s), _M_c(traits_type::eof()) { } - - /// Return the current character pointed to by iterator. This returns - /// streambuf.sgetc(). It cannot be assigned. NB: The result of - /// operator*() on an end of stream is undefined. - char_type - operator*() const - { -#ifdef _GLIBCXX_DEBUG_PEDANTIC - // Dereferencing a past-the-end istreambuf_iterator is a - // libstdc++ extension - __glibcxx_requires_cond(!_M_at_eof(), - _M_message(__gnu_debug::__msg_deref_istreambuf) - ._M_iterator(*this)); -#endif - return traits_type::to_char_type(_M_get()); - } - - /// Advance the iterator. Calls streambuf.sbumpc(). - istreambuf_iterator& - operator++() - { - __glibcxx_requires_cond(!_M_at_eof(), - _M_message(__gnu_debug::__msg_inc_istreambuf) - ._M_iterator(*this)); - const int_type __eof = traits_type::eof(); - if (_M_sbuf && traits_type::eq_int_type(_M_sbuf->sbumpc(), __eof)) - _M_sbuf = 0; - else - _M_c = __eof; - return *this; - } - - /// Advance the iterator. Calls streambuf.sbumpc(). - istreambuf_iterator - operator++(int) - { - __glibcxx_requires_cond(!_M_at_eof(), - _M_message(__gnu_debug::__msg_inc_istreambuf) - ._M_iterator(*this)); - - const int_type __eof = traits_type::eof(); - istreambuf_iterator __old = *this; - if (_M_sbuf - && traits_type::eq_int_type((__old._M_c = _M_sbuf->sbumpc()), - __eof)) - _M_sbuf = 0; - else - _M_c = __eof; - return __old; - } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 110 istreambuf_iterator::equal not const - // NB: there is also number 111 (NAD, Future) pending on this function. - /// Return true both iterators are end or both are not end. - bool - equal(const istreambuf_iterator& __b) const - { - const bool __thiseof = _M_at_eof(); - const bool __beof = __b._M_at_eof(); - return (__thiseof && __beof || (!__thiseof && !__beof)); - } - - private: - int_type - _M_get() const - { - const int_type __eof = traits_type::eof(); - int_type __ret = __eof; - if (_M_sbuf) - { - if (!traits_type::eq_int_type(_M_c, __eof)) - __ret = _M_c; - else if (traits_type::eq_int_type((__ret = _M_sbuf->sgetc()), - __eof)) - _M_sbuf = 0; - } - return __ret; - } - - bool - _M_at_eof() const - { - const int_type __eof = traits_type::eof(); - return traits_type::eq_int_type(_M_get(), __eof); - } - }; - - template<typename _CharT, typename _Traits> - inline bool - operator==(const istreambuf_iterator<_CharT, _Traits>& __a, - const istreambuf_iterator<_CharT, _Traits>& __b) - { return __a.equal(__b); } - - template<typename _CharT, typename _Traits> - inline bool - operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, - const istreambuf_iterator<_CharT, _Traits>& __b) - { return !__a.equal(__b); } - - /// Provides output iterator semantics for streambufs. - template<typename _CharT, typename _Traits> - class ostreambuf_iterator - : public iterator<output_iterator_tag, void, void, void, void> - { - public: - // Types: - //@{ - /// Public typedefs - typedef _CharT char_type; - typedef _Traits traits_type; - typedef basic_streambuf<_CharT, _Traits> streambuf_type; - typedef basic_ostream<_CharT, _Traits> ostream_type; - //@} - - private: - streambuf_type* _M_sbuf; - bool _M_failed; - - public: - /// Construct output iterator from ostream. - ostreambuf_iterator(ostream_type& __s) throw () - : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { } - - /// Construct output iterator from streambuf. - ostreambuf_iterator(streambuf_type* __s) throw () - : _M_sbuf(__s), _M_failed(!_M_sbuf) { } - - /// Write character to streambuf. Calls streambuf.sputc(). - ostreambuf_iterator& - operator=(_CharT __c) - { - if (!_M_failed && - _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof())) - _M_failed = true; - return *this; - } - - /// Return *this. - ostreambuf_iterator& - operator*() - { return *this; } - - /// Return *this. - ostreambuf_iterator& - operator++(int) - { return *this; } - - /// Return *this. - ostreambuf_iterator& - operator++() - { return *this; } - - /// Return true if previous operator=() failed. - bool - failed() const throw() - { return _M_failed; } - - ostreambuf_iterator& - _M_put(const _CharT* __ws, streamsize __len) - { - if (__builtin_expect(!_M_failed, true) - && __builtin_expect(this->_M_sbuf->sputn(__ws, __len) != __len, - false)) - _M_failed = true; - return *this; - } - }; -} // namespace std -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stringfwd.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stringfwd.h deleted file mode 100644 index c27e6d1c504..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stringfwd.h +++ /dev/null @@ -1,69 +0,0 @@ -// String support -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 21 Strings library -// - -/** @file stringfwd.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _STRINGFWD_H -#define _STRINGFWD_H 1 - -#pragma GCC system_header - -#include <bits/c++config.h> - -namespace std -{ - template<typename _Alloc> - class allocator; - - template<class _CharT> - struct char_traits; - - template<typename _CharT, typename _Traits = char_traits<_CharT>, - typename _Alloc = allocator<_CharT> > - class basic_string; - - template<> struct char_traits<char>; - - typedef basic_string<char> string; - -#if defined (_GLIBCXX_USE_WCHAR_T) || defined (_GLIBCXX_USE_WSTRING) - template<> struct char_traits<wchar_t>; - - typedef basic_string<wchar_t> wstring; -#endif -} // namespace std - -#endif // _STRINGFWD_H diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/type_traits.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/type_traits.h deleted file mode 100644 index 9b91e5c5cdf..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/type_traits.h +++ /dev/null @@ -1,405 +0,0 @@ -// Type traits implementation -*- C++ -*- - -// Copyright (C) 2001, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file type_traits.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _TYPE_TRAITS_H -#define _TYPE_TRAITS_H 1 - -#pragma GCC system_header - -#include <bits/c++config.h> - -/* -This header file provides a framework for allowing compile time dispatch -based on type attributes. This is useful when writing template code. -For example, when making a copy of an array of an unknown type, it helps -to know if the type has a trivial copy constructor or not, to help decide -if a memcpy can be used. - -The class template __type_traits provides a series of typedefs each of -which is either __true_type or __false_type. The argument to -__type_traits can be any type. The typedefs within this template will -attain their correct values by one of these means: - 1. The general instantiation contain conservative values which work - for all types. - 2. Specializations may be declared to make distinctions between types. - 3. Some compilers (such as the Silicon Graphics N32 and N64 compilers) - will automatically provide the appropriate specializations for all - types. - -EXAMPLE: - -//Copy an array of elements which have non-trivial copy constructors -template <class _Tp> void - copy(_Tp* __source,_Tp* __destination,int __n,__false_type); -//Copy an array of elements which have trivial copy constructors. Use memcpy. -template <class _Tp> void - copy(_Tp* __source,_Tp* __destination,int __n,__true_type); - -//Copy an array of any type by using the most efficient copy mechanism -template <class _Tp> inline void copy(_Tp* __source,_Tp* __destination,int __n) { - copy(__source,__destination,__n, - typename __type_traits<_Tp>::has_trivial_copy_constructor()); -} -*/ - -struct __true_type {}; -struct __false_type {}; - -template <class _Tp> - struct __type_traits - { - typedef __true_type this_dummy_member_must_be_first; - /* Do not remove this member. It informs a compiler which - automatically specializes __type_traits that this - __type_traits template is special. It just makes sure that - things work if an implementation is using a template - called __type_traits for something unrelated. */ - - /* The following restrictions should be observed for the sake of - compilers which automatically produce type specific specializations - of this class: - - You may reorder the members below if you wish - - You may remove any of the members below if you wish - - You must not rename members without making the corresponding - name change in the compiler - - Members you add will be treated like regular members unless - you add the appropriate support in the compiler. */ - - - typedef __false_type has_trivial_default_constructor; - typedef __false_type has_trivial_copy_constructor; - typedef __false_type has_trivial_assignment_operator; - typedef __false_type has_trivial_destructor; - typedef __false_type is_POD_type; - }; - - -// Provide some specializations. - -template<> - struct __type_traits<bool> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<char> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<signed char> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<unsigned char> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<wchar_t> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<short> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<unsigned short> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<int> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<unsigned int> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<long> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<unsigned long> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<long long> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<unsigned long long> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<float> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<double> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template<> - struct __type_traits<long double> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -template <class _Tp> - struct __type_traits<_Tp*> - { - typedef __true_type has_trivial_default_constructor; - typedef __true_type has_trivial_copy_constructor; - typedef __true_type has_trivial_assignment_operator; - typedef __true_type has_trivial_destructor; - typedef __true_type is_POD_type; - }; - -// The following could be written in terms of numeric_limits. -// We're doing it separately to reduce the number of dependencies. - -template <class _Tp> - struct _Is_integer - { - typedef __false_type _Integral; - }; - -template<> - struct _Is_integer<bool> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<char> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<signed char> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<unsigned char> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<wchar_t> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<short> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<unsigned short> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<int> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<unsigned int> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<long> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<unsigned long> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<long long> - { - typedef __true_type _Integral; - }; - -template<> - struct _Is_integer<unsigned long long> - { - typedef __true_type _Integral; - }; - -template<typename _Tp> - struct _Is_normal_iterator - { - typedef __false_type _Normal; - }; - -// Forward declaration hack, should really include this from somewhere. -namespace __gnu_cxx -{ - template<typename _Iterator, typename _Container> - class __normal_iterator; -} - -template<typename _Iterator, typename _Container> - struct _Is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator, - _Container> > - { - typedef __true_type _Normal; - }; - -#endif /* _TYPE_TRAITS_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_after.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_after.h deleted file mode 100644 index b74cab5dbac..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_after.h +++ /dev/null @@ -1,499 +0,0 @@ -// The template and inlines for the -*- C++ -*- internal _Meta class. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr> - -/** @file valarray_meta.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _VALARRAY_AFTER_H -#define _VALARRAY_AFTER_H 1 - -#pragma GCC system_header - -namespace std -{ - - // - // gslice_array closure. - // - template<class _Dom> class _GBase { - public: - typedef typename _Dom::value_type value_type; - - _GBase (const _Dom& __e, const valarray<size_t>& __i) - : _M_expr (__e), _M_index(__i) {} - value_type operator[] (size_t __i) const - { return _M_expr[_M_index[__i]]; } - size_t size () const { return _M_index.size(); } - - private: - const _Dom& _M_expr; - const valarray<size_t>& _M_index; - }; - - template<typename _Tp> class _GBase<_Array<_Tp> > { - public: - typedef _Tp value_type; - - _GBase (_Array<_Tp> __a, const valarray<size_t>& __i) - : _M_array (__a), _M_index(__i) {} - value_type operator[] (size_t __i) const - { return _M_array._M_data[_M_index[__i]]; } - size_t size () const { return _M_index.size(); } - - private: - const _Array<_Tp> _M_array; - const valarray<size_t>& _M_index; - }; - - template<class _Dom> struct _GClos<_Expr,_Dom> : _GBase<_Dom> { - typedef _GBase<_Dom> _Base; - typedef typename _Base::value_type value_type; - - _GClos (const _Dom& __e, const valarray<size_t>& __i) - : _Base (__e, __i) {} - }; - - template<typename _Tp> - struct _GClos<_ValArray,_Tp> : _GBase<_Array<_Tp> > { - typedef _GBase<_Array<_Tp> > _Base; - typedef typename _Base::value_type value_type; - - _GClos (_Array<_Tp> __a, const valarray<size_t>& __i) - : _Base (__a, __i) {} - }; - - // - // indirect_array closure - // - template<class _Dom> class _IBase { - public: - typedef typename _Dom::value_type value_type; - - _IBase (const _Dom& __e, const valarray<size_t>& __i) - : _M_expr (__e), _M_index (__i) {} - value_type operator[] (size_t __i) const - { return _M_expr[_M_index[__i]]; } - size_t size() const { return _M_index.size(); } - - private: - const _Dom& _M_expr; - const valarray<size_t>& _M_index; - }; - - template<class _Dom> struct _IClos<_Expr,_Dom> : _IBase<_Dom> { - typedef _IBase<_Dom> _Base; - typedef typename _Base::value_type value_type; - - _IClos (const _Dom& __e, const valarray<size_t>& __i) - : _Base (__e, __i) {} - }; - - template<typename _Tp> - struct _IClos<_ValArray,_Tp> : _IBase<valarray<_Tp> > { - typedef _IBase<valarray<_Tp> > _Base; - typedef _Tp value_type; - - _IClos (const valarray<_Tp>& __a, const valarray<size_t>& __i) - : _Base (__a, __i) {} - }; - - // - // class _Expr - // - template<class _Clos, typename _Tp> - class _Expr - { - public: - typedef _Tp value_type; - - _Expr(const _Clos&); - - const _Clos& operator()() const; - - value_type operator[](size_t) const; - valarray<value_type> operator[](slice) const; - valarray<value_type> operator[](const gslice&) const; - valarray<value_type> operator[](const valarray<bool>&) const; - valarray<value_type> operator[](const valarray<size_t>&) const; - - _Expr<_UnClos<__unary_plus,std::_Expr,_Clos>, value_type> - operator+() const; - - _Expr<_UnClos<__negate,std::_Expr,_Clos>, value_type> - operator-() const; - - _Expr<_UnClos<__bitwise_not,std::_Expr,_Clos>, value_type> - operator~() const; - - _Expr<_UnClos<__logical_not,std::_Expr,_Clos>, bool> - operator!() const; - - size_t size() const; - value_type sum() const; - - valarray<value_type> shift(int) const; - valarray<value_type> cshift(int) const; - - value_type min() const; - value_type max() const; - - valarray<value_type> apply(value_type (*)(const value_type&)) const; - valarray<value_type> apply(value_type (*)(value_type)) const; - - private: - const _Clos _M_closure; - }; - - template<class _Clos, typename _Tp> - inline - _Expr<_Clos,_Tp>::_Expr(const _Clos& __c) : _M_closure(__c) {} - - template<class _Clos, typename _Tp> - inline const _Clos& - _Expr<_Clos,_Tp>::operator()() const - { return _M_closure; } - - template<class _Clos, typename _Tp> - inline _Tp - _Expr<_Clos,_Tp>::operator[](size_t __i) const - { return _M_closure[__i]; } - - template<class _Clos, typename _Tp> - inline valarray<_Tp> - _Expr<_Clos,_Tp>::operator[](slice __s) const - { return _M_closure[__s]; } - - template<class _Clos, typename _Tp> - inline valarray<_Tp> - _Expr<_Clos,_Tp>::operator[](const gslice& __gs) const - { return _M_closure[__gs]; } - - template<class _Clos, typename _Tp> - inline valarray<_Tp> - _Expr<_Clos,_Tp>::operator[](const valarray<bool>& __m) const - { return _M_closure[__m]; } - - template<class _Clos, typename _Tp> - inline valarray<_Tp> - _Expr<_Clos,_Tp>::operator[](const valarray<size_t>& __i) const - { return _M_closure[__i]; } - - template<class _Clos, typename _Tp> - inline size_t - _Expr<_Clos,_Tp>::size() const { return _M_closure.size (); } - - template<class _Clos, typename _Tp> - inline valarray<_Tp> - _Expr<_Clos, _Tp>::shift(int __n) const - { return valarray<_Tp>(_M_closure).shift(__n); } - - template<class _Clos, typename _Tp> - inline valarray<_Tp> - _Expr<_Clos, _Tp>::cshift(int __n) const - { return valarray<_Tp>(_M_closure).cshift(__n); } - - template<class _Clos, typename _Tp> - inline valarray<_Tp> - _Expr<_Clos, _Tp>::apply(_Tp __f(const _Tp&)) const - { return valarray<_Tp>(_M_closure).apply(__f); } - - template<class _Clos, typename _Tp> - inline valarray<_Tp> - _Expr<_Clos, _Tp>::apply(_Tp __f(_Tp)) const - { return valarray<_Tp>(_M_closure).apply(__f); } - - // XXX: replace this with a more robust summation algorithm. - template<class _Clos, typename _Tp> - inline _Tp - _Expr<_Clos,_Tp>::sum() const - { - size_t __n = _M_closure.size(); - if (__n == 0) - return _Tp(); - else - { - _Tp __s = _M_closure[--__n]; - while (__n != 0) - __s += _M_closure[--__n]; - return __s; - } - } - - template<class _Clos, typename _Tp> - inline _Tp - _Expr<_Clos, _Tp>::min() const - { return __valarray_min(_M_closure); } - - template<class _Clos, typename _Tp> - inline _Tp - _Expr<_Clos, _Tp>::max() const - { return __valarray_max(_M_closure); } - - template<class _Dom, typename _Tp> - inline _Expr<_UnClos<__logical_not,_Expr,_Dom>, bool> - _Expr<_Dom,_Tp>::operator!() const - { - typedef _UnClos<__logical_not,std::_Expr,_Dom> _Closure; - return _Expr<_Closure,_Tp>(_Closure(this->_M_closure)); - } - -#define _DEFINE_EXPR_UNARY_OPERATOR(_Op, _Name) \ - template<class _Dom, typename _Tp> \ - inline _Expr<_UnClos<_Name,std::_Expr,_Dom>,_Tp> \ - _Expr<_Dom,_Tp>::operator _Op() const \ - { \ - typedef _UnClos<_Name,std::_Expr,_Dom> _Closure; \ - return _Expr<_Closure,_Tp>(_Closure(this->_M_closure)); \ - } - - _DEFINE_EXPR_UNARY_OPERATOR(+, __unary_plus) - _DEFINE_EXPR_UNARY_OPERATOR(-, __negate) - _DEFINE_EXPR_UNARY_OPERATOR(~, __bitwise_not) - -#undef _DEFINE_EXPR_UNARY_OPERATOR - - -#define _DEFINE_EXPR_BINARY_OPERATOR(_Op, _Name) \ - template<class _Dom1, class _Dom2> \ - inline _Expr<_BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2>, \ - typename __fun<_Name, typename _Dom1::value_type>::result_type>\ - operator _Op(const _Expr<_Dom1,typename _Dom1::value_type>& __v, \ - const _Expr<_Dom2,typename _Dom2::value_type>& __w) \ - { \ - typedef typename _Dom1::value_type _Arg; \ - typedef typename __fun<_Name, _Arg>::result_type _Value; \ - typedef _BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2> _Closure; \ - return _Expr<_Closure,_Value>(_Closure(__v(), __w())); \ - } \ - \ -template<class _Dom> \ -inline _Expr<_BinClos<_Name,_Expr,_Constant,_Dom,typename _Dom::value_type>,\ - typename __fun<_Name, typename _Dom::value_type>::result_type>\ -operator _Op(const _Expr<_Dom,typename _Dom::value_type>& __v, \ - const typename _Dom::value_type& __t) \ -{ \ - typedef typename _Dom::value_type _Arg; \ - typedef typename __fun<_Name, _Arg>::result_type _Value; \ - typedef _BinClos<_Name,_Expr,_Constant,_Dom,_Arg> _Closure; \ - return _Expr<_Closure,_Value>(_Closure(__v(), __t)); \ -} \ - \ -template<class _Dom> \ -inline _Expr<_BinClos<_Name,_Constant,_Expr,typename _Dom::value_type,_Dom>,\ - typename __fun<_Name, typename _Dom::value_type>::result_type>\ -operator _Op(const typename _Dom::value_type& __t, \ - const _Expr<_Dom,typename _Dom::value_type>& __v) \ -{ \ - typedef typename _Dom::value_type _Arg; \ - typedef typename __fun<_Name, _Arg>::result_type _Value; \ - typedef _BinClos<_Name,_Constant,_Expr,_Arg,_Dom> _Closure; \ - return _Expr<_Closure,_Value>(_Closure(__t, __v())); \ -} \ - \ -template<class _Dom> \ -inline _Expr<_BinClos<_Name,_Expr,_ValArray,_Dom,typename _Dom::value_type>,\ - typename __fun<_Name, typename _Dom::value_type>::result_type>\ -operator _Op(const _Expr<_Dom,typename _Dom::value_type>& __e, \ - const valarray<typename _Dom::value_type>& __v) \ -{ \ - typedef typename _Dom::value_type _Arg; \ - typedef typename __fun<_Name, _Arg>::result_type _Value; \ - typedef _BinClos<_Name,_Expr,_ValArray,_Dom,_Arg> _Closure; \ - return _Expr<_Closure,_Value>(_Closure(__e(), __v)); \ -} \ - \ -template<class _Dom> \ -inline _Expr<_BinClos<_Name,_ValArray,_Expr,typename _Dom::value_type,_Dom>,\ - typename __fun<_Name, typename _Dom::value_type>::result_type>\ -operator _Op(const valarray<typename _Dom::value_type>& __v, \ - const _Expr<_Dom,typename _Dom::value_type>& __e) \ -{ \ - typedef typename _Dom::value_type _Tp; \ - typedef typename __fun<_Name, _Tp>::result_type _Value; \ - typedef _BinClos<_Name,_ValArray,_Expr,_Tp,_Dom> _Closure; \ - return _Expr<_Closure,_Value> (_Closure (__v, __e ())); \ -} - - _DEFINE_EXPR_BINARY_OPERATOR(+, __plus) - _DEFINE_EXPR_BINARY_OPERATOR(-, __minus) - _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies) - _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) - _DEFINE_EXPR_BINARY_OPERATOR(%, __modulus) - _DEFINE_EXPR_BINARY_OPERATOR(^, __bitwise_xor) - _DEFINE_EXPR_BINARY_OPERATOR(&, __bitwise_and) - _DEFINE_EXPR_BINARY_OPERATOR(|, __bitwise_or) - _DEFINE_EXPR_BINARY_OPERATOR(<<, __shift_left) - _DEFINE_EXPR_BINARY_OPERATOR(>>, __shift_right) - _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and) - _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or) - _DEFINE_EXPR_BINARY_OPERATOR(==, __equal_to) - _DEFINE_EXPR_BINARY_OPERATOR(!=, __not_equal_to) - _DEFINE_EXPR_BINARY_OPERATOR(<, __less) - _DEFINE_EXPR_BINARY_OPERATOR(>, __greater) - _DEFINE_EXPR_BINARY_OPERATOR(<=, __less_equal) - _DEFINE_EXPR_BINARY_OPERATOR(>=, __greater_equal) - -#undef _DEFINE_EXPR_BINARY_OPERATOR - -#define _DEFINE_EXPR_UNARY_FUNCTION(_Name) \ - template<class _Dom> \ - inline _Expr<_UnClos<__##_Name,_Expr,_Dom>,typename _Dom::value_type>\ - _Name(const _Expr<_Dom,typename _Dom::value_type>& __e) \ - { \ - typedef typename _Dom::value_type _Tp; \ - typedef _UnClos<__##_Name,_Expr,_Dom> _Closure; \ - return _Expr<_Closure,_Tp>(_Closure(__e())); \ - } \ - \ - template<typename _Tp> \ - inline _Expr<_UnClos<__##_Name,_ValArray,_Tp>,_Tp> \ - _Name(const valarray<_Tp>& __v) \ - { \ - typedef _UnClos<__##_Name,_ValArray,_Tp> _Closure; \ - return _Expr<_Closure,_Tp>(_Closure(__v)); \ - } - - _DEFINE_EXPR_UNARY_FUNCTION(abs) - _DEFINE_EXPR_UNARY_FUNCTION(cos) - _DEFINE_EXPR_UNARY_FUNCTION(acos) - _DEFINE_EXPR_UNARY_FUNCTION(cosh) - _DEFINE_EXPR_UNARY_FUNCTION(sin) - _DEFINE_EXPR_UNARY_FUNCTION(asin) - _DEFINE_EXPR_UNARY_FUNCTION(sinh) - _DEFINE_EXPR_UNARY_FUNCTION(tan) - _DEFINE_EXPR_UNARY_FUNCTION(tanh) - _DEFINE_EXPR_UNARY_FUNCTION(atan) - _DEFINE_EXPR_UNARY_FUNCTION(exp) - _DEFINE_EXPR_UNARY_FUNCTION(log) - _DEFINE_EXPR_UNARY_FUNCTION(log10) - _DEFINE_EXPR_UNARY_FUNCTION(sqrt) - -#undef _DEFINE_EXPR_UNARY_FUNCTION - -#define _DEFINE_EXPR_BINARY_FUNCTION(_Fun) \ - template<class _Dom1, class _Dom2> \ - inline _Expr<_BinClos<__##_Fun,_Expr,_Expr,_Dom1,_Dom2>, \ - typename _Dom1::value_type> \ - _Fun(const _Expr<_Dom1,typename _Dom1::value_type>& __e1, \ - const _Expr<_Dom2,typename _Dom2::value_type>& __e2) \ - { \ - typedef typename _Dom1::value_type _Tp; \ - typedef _BinClos<__##_Fun,_Expr,_Expr,_Dom1,_Dom2> _Closure; \ - return _Expr<_Closure,_Tp>(_Closure(__e1(), __e2())); \ - } \ - \ - template<class _Dom> \ - inline _Expr<_BinClos<__##_Fun, _Expr, _ValArray, _Dom, \ - typename _Dom::value_type>, \ - typename _Dom::value_type> \ - _Fun(const _Expr<_Dom,typename _Dom::value_type>& __e, \ - const valarray<typename _Dom::value_type>& __v) \ - { \ - typedef typename _Dom::value_type _Tp; \ - typedef _BinClos<__##_Fun, _Expr, _ValArray, _Dom, _Tp> _Closure;\ - return _Expr<_Closure,_Tp>(_Closure(__e(), __v)); \ - } \ - \ - template<class _Dom> \ - inline _Expr<_BinClos<__##_Fun, _ValArray, _Expr, \ - typename _Dom::value_type,_Dom>, \ - typename _Dom::value_type> \ - _Fun(const valarray<typename _Dom::valarray>& __v, \ - const _Expr<_Dom,typename _Dom::value_type>& __e) \ - { \ - typedef typename _Dom::value_type _Tp; \ - typedef _BinClos<__##_Fun,_ValArray,_Expr,_Tp,_Dom> _Closure; \ - return _Expr<_Closure,_Tp>(_Closure(__v, __e())); \ - } \ - \ - template<class _Dom> \ - inline _Expr<_BinClos<__##_Fun,_Expr,_Constant,_Dom, \ - typename _Dom::value_type>, \ - typename _Dom::value_type> \ - _Fun(const _Expr<_Dom, typename _Dom::value_type>& __e, \ - const typename _Dom::value_type& __t) \ - { \ - typedef typename _Dom::value_type _Tp; \ - typedef _BinClos<__##_Fun,_Expr,_Constant,_Dom,_Tp> _Closure; \ - return _Expr<_Closure,_Tp>(_Closure(__e(), __t)); \ - } \ - \ - template<class _Dom> \ - inline _Expr<_BinClos<__##_Fun,_Constant,_Expr, \ - typename _Dom::value_type,_Dom>, \ - typename _Dom::value_type> \ - _Fun(const typename _Dom::value_type& __t, \ - const _Expr<_Dom,typename _Dom::value_type>& __e) \ - { \ - typedef typename _Dom::value_type _Tp; \ - typedef _BinClos<__##_Fun, _Constant,_Expr,_Tp,_Dom> _Closure; \ - return _Expr<_Closure,_Tp>(_Closure(__t, __e())); \ - } \ - \ - template<typename _Tp> \ - inline _Expr<_BinClos<__##_Fun,_ValArray,_ValArray,_Tp,_Tp>, _Tp> \ - _Fun(const valarray<_Tp>& __v, const valarray<_Tp>& __w) \ - { \ - typedef _BinClos<__##_Fun,_ValArray,_ValArray,_Tp,_Tp> _Closure; \ - return _Expr<_Closure,_Tp>(_Closure(__v, __w)); \ - } \ - \ - template<typename _Tp> \ - inline _Expr<_BinClos<__##_Fun,_ValArray,_Constant,_Tp,_Tp>,_Tp> \ - _Fun(const valarray<_Tp>& __v, const _Tp& __t) \ - { \ - typedef _BinClos<__##_Fun,_ValArray,_Constant,_Tp,_Tp> _Closure; \ - return _Expr<_Closure,_Tp>(_Closure(__v, __t)); \ - } \ - \ - template<typename _Tp> \ - inline _Expr<_BinClos<__##_Fun,_Constant,_ValArray,_Tp,_Tp>,_Tp> \ - _Fun(const _Tp& __t, const valarray<_Tp>& __v) \ - { \ - typedef _BinClos<__##_Fun,_Constant,_ValArray,_Tp,_Tp> _Closure; \ - return _Expr<_Closure,_Tp>(_Closure(__t, __v)); \ - } - -_DEFINE_EXPR_BINARY_FUNCTION(atan2) -_DEFINE_EXPR_BINARY_FUNCTION(pow) - -#undef _DEFINE_EXPR_BINARY_FUNCTION - -} // std:: - - -#endif /* _CPP_VALARRAY_AFTER_H */ - -// Local Variables: -// mode:c++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_array.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_array.h deleted file mode 100644 index e18e8e8e9e8..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_array.h +++ /dev/null @@ -1,625 +0,0 @@ -// The template and inlines for the -*- C++ -*- internal _Array helper class. - -// Copyright (C) 1997, 1998, 1999, 2000, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr> - -/** @file valarray_array.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _VALARRAY_ARRAY_H -#define _VALARRAY_ARRAY_H 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/cpp_type_traits.h> -#include <cstdlib> -#include <cstring> -#include <new> - -namespace std -{ - // - // Helper functions on raw pointers - // - - // We get memory by the old fashion way - inline void* - __valarray_get_memory(size_t __n) - { return operator new(__n); } - - template<typename _Tp> - inline _Tp*__restrict__ - __valarray_get_storage(size_t __n) - { - return static_cast<_Tp*__restrict__> - (std::__valarray_get_memory(__n * sizeof(_Tp))); - } - - // Return memory to the system - inline void - __valarray_release_memory(void* __p) - { operator delete(__p); } - - // Turn a raw-memory into an array of _Tp filled with _Tp() - // This is required in 'valarray<T> v(n);' - template<typename _Tp, bool> - struct _Array_default_ctor - { - // Please note that this isn't exception safe. But - // valarrays aren't required to be exception safe. - inline static void - _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e) - { while (__b != __e) new(__b++) _Tp(); } - }; - - template<typename _Tp> - struct _Array_default_ctor<_Tp, true> - { - // For fundamental types, it suffices to say 'memset()' - inline static void - _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e) - { std::memset(__b, 0, (__e - __b)*sizeof(_Tp)); } - }; - - template<typename _Tp> - inline void - __valarray_default_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e) - { - _Array_default_ctor<_Tp, __is_fundamental<_Tp>::_M_type>:: - _S_do_it(__b, __e); - } - - // Turn a raw-memory into an array of _Tp filled with __t - // This is the required in valarray<T> v(n, t). Also - // used in valarray<>::resize(). - template<typename _Tp, bool> - struct _Array_init_ctor - { - // Please note that this isn't exception safe. But - // valarrays aren't required to be exception safe. - inline static void - _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e, const _Tp __t) - { while (__b != __e) new(__b++) _Tp(__t); } - }; - - template<typename _Tp> - struct _Array_init_ctor<_Tp, true> - { - inline static void - _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e, const _Tp __t) - { while (__b != __e) *__b++ = __t; } - }; - - template<typename _Tp> - inline void - __valarray_fill_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e, - const _Tp __t) - { - _Array_init_ctor<_Tp, __is_fundamental<_Tp>::_M_type>:: - _S_do_it(__b, __e, __t); - } - - // - // copy-construct raw array [__o, *) from plain array [__b, __e) - // We can't just say 'memcpy()' - // - template<typename _Tp, bool> - struct _Array_copy_ctor - { - // Please note that this isn't exception safe. But - // valarrays aren't required to be exception safe. - inline static void - _S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e, - _Tp* __restrict__ __o) - { while (__b != __e) new(__o++) _Tp(*__b++); } - }; - - template<typename _Tp> - struct _Array_copy_ctor<_Tp, true> - { - inline static void - _S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e, - _Tp* __restrict__ __o) - { std::memcpy(__o, __b, (__e - __b)*sizeof(_Tp)); } - }; - - template<typename _Tp> - inline void - __valarray_copy_construct(const _Tp* __restrict__ __b, - const _Tp* __restrict__ __e, - _Tp* __restrict__ __o) - { - _Array_copy_ctor<_Tp, __is_fundamental<_Tp>::_M_type>:: - _S_do_it(__b, __e, __o); - } - - // copy-construct raw array [__o, *) from strided array __a[<__n : __s>] - template<typename _Tp> - inline void - __valarray_copy_construct (const _Tp* __restrict__ __a, size_t __n, - size_t __s, _Tp* __restrict__ __o) - { - if (__is_fundamental<_Tp>::_M_type) - while (__n--) { *__o++ = *__a; __a += __s; } - else - while (__n--) { new(__o++) _Tp(*__a); __a += __s; } - } - - // copy-construct raw array [__o, *) from indexed array __a[__i[<__n>]] - template<typename _Tp> - inline void - __valarray_copy_construct (const _Tp* __restrict__ __a, - const size_t* __restrict__ __i, - _Tp* __restrict__ __o, size_t __n) - { - if (__is_fundamental<_Tp>::_M_type) - while (__n--) *__o++ = __a[*__i++]; - else - while (__n--) new (__o++) _Tp(__a[*__i++]); - } - - // Do the necessary cleanup when we're done with arrays. - template<typename _Tp> - inline void - __valarray_destroy_elements(_Tp* __restrict__ __b, _Tp* __restrict__ __e) - { - if (!__is_fundamental<_Tp>::_M_type) - while (__b != __e) { __b->~_Tp(); ++__b; } - } - - // Fill a plain array __a[<__n>] with __t - template<typename _Tp> - inline void - __valarray_fill (_Tp* __restrict__ __a, size_t __n, const _Tp& __t) - { while (__n--) *__a++ = __t; } - - // fill strided array __a[<__n-1 : __s>] with __t - template<typename _Tp> - inline void - __valarray_fill (_Tp* __restrict__ __a, size_t __n, - size_t __s, const _Tp& __t) - { for (size_t __i=0; __i<__n; ++__i, __a+=__s) *__a = __t; } - - // fill indir ect array __a[__i[<__n>]] with __i - template<typename _Tp> - inline void - __valarray_fill(_Tp* __restrict__ __a, const size_t* __restrict__ __i, - size_t __n, const _Tp& __t) - { for (size_t __j=0; __j<__n; ++__j, ++__i) __a[*__i] = __t; } - - // copy plain array __a[<__n>] in __b[<__n>] - // For non-fundamental types, it is wrong to say 'memcpy()' - template<typename _Tp, bool> - struct _Array_copier - { - inline static void - _S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b) - { while (__n--) *__b++ = *__a++; } - }; - - template<typename _Tp> - struct _Array_copier<_Tp, true> - { - inline static void - _S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b) - { std::memcpy (__b, __a, __n * sizeof (_Tp)); } - }; - - // Copy a plain array __a[<__n>] into a play array __b[<>] - template<typename _Tp> - inline void - __valarray_copy(const _Tp* __restrict__ __a, size_t __n, - _Tp* __restrict__ __b) - { - _Array_copier<_Tp, __is_fundamental<_Tp>::_M_type>:: - _S_do_it(__a, __n, __b); - } - - // Copy strided array __a[<__n : __s>] in plain __b[<__n>] - template<typename _Tp> - inline void - __valarray_copy(const _Tp* __restrict__ __a, size_t __n, size_t __s, - _Tp* __restrict__ __b) - { for (size_t __i=0; __i<__n; ++__i, ++__b, __a += __s) *__b = *__a; } - - // Copy a plain array __a[<__n>] into a strided array __b[<__n : __s>] - template<typename _Tp> - inline void - __valarray_copy(const _Tp* __restrict__ __a, _Tp* __restrict__ __b, - size_t __n, size_t __s) - { for (size_t __i=0; __i<__n; ++__i, ++__a, __b+=__s) *__b = *__a; } - - // Copy strided array __src[<__n : __s1>] into another - // strided array __dst[< : __s2>]. Their sizes must match. - template<typename _Tp> - inline void - __valarray_copy(const _Tp* __restrict__ __src, size_t __n, size_t __s1, - _Tp* __restrict__ __dst, size_t __s2) - { - for (size_t __i = 0; __i < __n; ++__i) - __dst[__i * __s2] = __src [ __i * __s1]; - } - - - // Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>] - template<typename _Tp> - inline void - __valarray_copy (const _Tp* __restrict__ __a, - const size_t* __restrict__ __i, - _Tp* __restrict__ __b, size_t __n) - { for (size_t __j=0; __j<__n; ++__j, ++__b, ++__i) *__b = __a[*__i]; } - - // Copy a plain array __a[<__n>] in an indexed array __b[__i[<__n>]] - template<typename _Tp> - inline void - __valarray_copy (const _Tp* __restrict__ __a, size_t __n, - _Tp* __restrict__ __b, const size_t* __restrict__ __i) - { for (size_t __j=0; __j<__n; ++__j, ++__a, ++__i) __b[*__i] = *__a; } - - // Copy the __n first elements of an indexed array __src[<__i>] into - // another indexed array __dst[<__j>]. - template<typename _Tp> - inline void - __valarray_copy(const _Tp* __restrict__ __src, size_t __n, - const size_t* __restrict__ __i, - _Tp* __restrict__ __dst, const size_t* __restrict__ __j) - { - for (size_t __k = 0; __k < __n; ++__k) - __dst[*__j++] = __src[*__i++]; - } - - // - // Compute the sum of elements in range [__f, __l) - // This is a naive algorithm. It suffers from cancelling. - // In the future try to specialize - // for _Tp = float, double, long double using a more accurate - // algorithm. - // - template<typename _Tp> - inline _Tp - __valarray_sum(const _Tp* __restrict__ __f, const _Tp* __restrict__ __l) - { - _Tp __r = _Tp(); - while (__f != __l) __r += *__f++; - return __r; - } - - // Compute the product of all elements in range [__f, __l) - template<typename _Tp> - inline _Tp - __valarray_product(const _Tp* __restrict__ __f, - const _Tp* __restrict__ __l) - { - _Tp __r = _Tp(1); - while (__f != __l) __r = __r * *__f++; - return __r; - } - - // Compute the min/max of an array-expression - template<typename _Ta> - inline typename _Ta::value_type - __valarray_min(const _Ta& __a) - { - size_t __s = __a.size(); - typedef typename _Ta::value_type _Value_type; - _Value_type __r = __s == 0 ? _Value_type() : __a[0]; - for (size_t __i = 1; __i < __s; ++__i) - { - _Value_type __t = __a[__i]; - if (__t < __r) - __r = __t; - } - return __r; - } - - template<typename _Ta> - inline typename _Ta::value_type - __valarray_max(const _Ta& __a) - { - size_t __s = __a.size(); - typedef typename _Ta::value_type _Value_type; - _Value_type __r = __s == 0 ? _Value_type() : __a[0]; - for (size_t __i = 1; __i < __s; ++__i) - { - _Value_type __t = __a[__i]; - if (__t > __r) - __r = __t; - } - return __r; - } - - // - // Helper class _Array, first layer of valarray abstraction. - // All operations on valarray should be forwarded to this class - // whenever possible. -- gdr - // - - template<typename _Tp> - struct _Array - { - explicit _Array (size_t); - explicit _Array (_Tp* const __restrict__); - explicit _Array (const valarray<_Tp>&); - _Array (const _Tp* __restrict__, size_t); - - _Tp* begin () const; - - _Tp* const __restrict__ _M_data; - }; - - template<typename _Tp> - inline void - __valarray_fill (_Array<_Tp> __a, size_t __n, const _Tp& __t) - { std::__valarray_fill (__a._M_data, __n, __t); } - - template<typename _Tp> - inline void - __valarray_fill (_Array<_Tp> __a, size_t __n, size_t __s, const _Tp& __t) - { std::__valarray_fill (__a._M_data, __n, __s, __t); } - - template<typename _Tp> - inline void - __valarray_fill (_Array<_Tp> __a, _Array<size_t> __i, - size_t __n, const _Tp& __t) - { std::__valarray_fill (__a._M_data, __i._M_data, __n, __t); } - - // Copy a plain array __a[<__n>] into a play array __b[<>] - template<typename _Tp> - inline void - __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b) - { std::__valarray_copy(__a._M_data, __n, __b._M_data); } - - // Copy strided array __a[<__n : __s>] in plain __b[<__n>] - template<typename _Tp> - inline void - __valarray_copy(_Array<_Tp> __a, size_t __n, size_t __s, _Array<_Tp> __b) - { std::__valarray_copy(__a._M_data, __n, __s, __b._M_data); } - - // Copy a plain array __a[<__n>] into a strided array __b[<__n : __s>] - template<typename _Tp> - inline void - __valarray_copy(_Array<_Tp> __a, _Array<_Tp> __b, size_t __n, size_t __s) - { __valarray_copy(__a._M_data, __b._M_data, __n, __s); } - - // Copy strided array __src[<__n : __s1>] into another - // strided array __dst[< : __s2>]. Their sizes must match. - template<typename _Tp> - inline void - __valarray_copy(_Array<_Tp> __a, size_t __n, size_t __s1, - _Array<_Tp> __b, size_t __s2) - { std::__valarray_copy(__a._M_data, __n, __s1, __b._M_data, __s2); } - - - // Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>] - template<typename _Tp> - inline void - __valarray_copy(_Array<_Tp> __a, _Array<size_t> __i, - _Array<_Tp> __b, size_t __n) - { std::__valarray_copy(__a._M_data, __i._M_data, __b._M_data, __n); } - - // Copy a plain array __a[<__n>] in an indexed array __b[__i[<__n>]] - template<typename _Tp> - inline void - __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b, - _Array<size_t> __i) - { std::__valarray_copy(__a._M_data, __n, __b._M_data, __i._M_data); } - - // Copy the __n first elements of an indexed array __src[<__i>] into - // another indexed array __dst[<__j>]. - template<typename _Tp> - inline void - __valarray_copy(_Array<_Tp> __src, size_t __n, _Array<size_t> __i, - _Array<_Tp> __dst, _Array<size_t> __j) - { - std::__valarray_copy(__src._M_data, __n, __i._M_data, - __dst._M_data, __j._M_data); - } - - template<typename _Tp> - inline - _Array<_Tp>::_Array (size_t __n) - : _M_data(__valarray_get_storage<_Tp>(__n)) - { std::__valarray_default_construct(_M_data, _M_data + __n); } - - template<typename _Tp> - inline - _Array<_Tp>::_Array (_Tp* const __restrict__ __p) : _M_data (__p) {} - - template<typename _Tp> - inline _Array<_Tp>::_Array (const valarray<_Tp>& __v) - : _M_data (__v._M_data) {} - - template<typename _Tp> - inline - _Array<_Tp>::_Array (const _Tp* __restrict__ __b, size_t __s) - : _M_data(__valarray_get_storage<_Tp>(__s)) - { std::__valarray_copy_construct(__b, __s, _M_data); } - - template<typename _Tp> - inline _Tp* - _Array<_Tp>::begin () const - { return _M_data; } - -#define _DEFINE_ARRAY_FUNCTION(_Op, _Name) \ -template<typename _Tp> \ -inline void \ -_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, const _Tp& __t) \ -{ \ - for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p) \ - *__p _Op##= __t; \ -} \ - \ -template<typename _Tp> \ -inline void \ -_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b) \ -{ \ - _Tp* __p = __a._M_data; \ - for (_Tp* __q=__b._M_data; __q<__b._M_data+__n; ++__p, ++__q) \ - *__p _Op##= *__q; \ -} \ - \ -template<typename _Tp, class _Dom> \ -void \ -_Array_augmented_##_Name (_Array<_Tp> __a, \ - const _Expr<_Dom,_Tp>& __e, size_t __n) \ -{ \ - _Tp* __p (__a._M_data); \ - for (size_t __i=0; __i<__n; ++__i, ++__p) *__p _Op##= __e[__i]; \ -} \ - \ -template<typename _Tp> \ -inline void \ -_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, size_t __s, \ - _Array<_Tp> __b) \ -{ \ - _Tp* __q (__b._M_data); \ - for (_Tp* __p=__a._M_data; __p<__a._M_data+__s*__n; __p+=__s, ++__q) \ - *__p _Op##= *__q; \ -} \ - \ -template<typename _Tp> \ -inline void \ -_Array_augmented_##_Name (_Array<_Tp> __a, _Array<_Tp> __b, \ - size_t __n, size_t __s) \ -{ \ - _Tp* __q (__b._M_data); \ - for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p, __q+=__s) \ - *__p _Op##= *__q; \ -} \ - \ -template<typename _Tp, class _Dom> \ -void \ -_Array_augmented_##_Name (_Array<_Tp> __a, size_t __s, \ - const _Expr<_Dom,_Tp>& __e, size_t __n) \ -{ \ - _Tp* __p (__a._M_data); \ - for (size_t __i=0; __i<__n; ++__i, __p+=__s) *__p _Op##= __e[__i]; \ -} \ - \ -template<typename _Tp> \ -inline void \ -_Array_augmented_##_Name (_Array<_Tp> __a, _Array<size_t> __i, \ - _Array<_Tp> __b, size_t __n) \ -{ \ - _Tp* __q (__b._M_data); \ - for (size_t* __j=__i._M_data; __j<__i._M_data+__n; ++__j, ++__q) \ - __a._M_data[*__j] _Op##= *__q; \ -} \ - \ -template<typename _Tp> \ -inline void \ -_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, \ - _Array<_Tp> __b, _Array<size_t> __i) \ -{ \ - _Tp* __p (__a._M_data); \ - for (size_t* __j=__i._M_data; __j<__i._M_data+__n; ++__j, ++__p) \ - *__p _Op##= __b._M_data[*__j]; \ -} \ - \ -template<typename _Tp, class _Dom> \ -void \ -_Array_augmented_##_Name (_Array<_Tp> __a, _Array<size_t> __i, \ - const _Expr<_Dom, _Tp>& __e, size_t __n) \ -{ \ - size_t* __j (__i._M_data); \ - for (size_t __k=0; __k<__n; ++__k, ++__j) \ - __a._M_data[*__j] _Op##= __e[__k]; \ -} \ - \ -template<typename _Tp> \ -void \ -_Array_augmented_##_Name (_Array<_Tp> __a, _Array<bool> __m, \ - _Array<_Tp> __b, size_t __n) \ -{ \ - bool* ok (__m._M_data); \ - _Tp* __p (__a._M_data); \ - for (_Tp* __q=__b._M_data; __q<__b._M_data+__n; ++__q, ++ok, ++__p) { \ - while (! *ok) { \ - ++ok; \ - ++__p; \ - } \ - *__p _Op##= *__q; \ - } \ -} \ - \ -template<typename _Tp> \ -void \ -_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, \ - _Array<_Tp> __b, _Array<bool> __m) \ -{ \ - bool* ok (__m._M_data); \ - _Tp* __q (__b._M_data); \ - for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p, ++ok, ++__q) { \ - while (! *ok) { \ - ++ok; \ - ++__q; \ - } \ - *__p _Op##= *__q; \ - } \ -} \ - \ -template<typename _Tp, class _Dom> \ -void \ -_Array_augmented_##_Name (_Array<_Tp> __a, _Array<bool> __m, \ - const _Expr<_Dom, _Tp>& __e, size_t __n) \ -{ \ - bool* ok(__m._M_data); \ - _Tp* __p (__a._M_data); \ - for (size_t __i=0; __i<__n; ++__i, ++ok, ++__p) { \ - while (! *ok) { \ - ++ok; \ - ++__p; \ - } \ - *__p _Op##= __e[__i]; \ - } \ -} - - _DEFINE_ARRAY_FUNCTION(+, __plus) - _DEFINE_ARRAY_FUNCTION(-, __minus) - _DEFINE_ARRAY_FUNCTION(*, __multiplies) - _DEFINE_ARRAY_FUNCTION(/, __divides) - _DEFINE_ARRAY_FUNCTION(%, __modulus) - _DEFINE_ARRAY_FUNCTION(^, __bitwise_xor) - _DEFINE_ARRAY_FUNCTION(|, __bitwise_or) - _DEFINE_ARRAY_FUNCTION(&, __bitwise_and) - _DEFINE_ARRAY_FUNCTION(<<, __shift_left) - _DEFINE_ARRAY_FUNCTION(>>, __shift_right) - -#undef _DEFINE_VALARRAY_FUNCTION -} // namespace std - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/valarray_array.tcc> -#endif - -#endif /* _ARRAY_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_array.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_array.tcc deleted file mode 100644 index fac5de6399b..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_array.tcc +++ /dev/null @@ -1,240 +0,0 @@ -// The template and inlines for the -*- C++ -*- internal _Array helper class. - -// Copyright (C) 1997, 1998, 1999, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr> - -#ifndef _VALARRAY_ARRAY_TCC -#define _VALARRAY_ARRAY_TCC 1 - -namespace std -{ - template<typename _Tp> - void - __valarray_fill(_Array<_Tp> __a, size_t __n, _Array<bool> __m, - const _Tp& __t) - { - _Tp* __p = __a._M_data; - bool* __ok (__m._M_data); - for (size_t __i=0; __i < __n; ++__i, ++__ok, ++__p) - { - while (!*__ok) - { - ++__ok; - ++__p; - } - *__p = __t; - } - } - - // Copy n elements of a into consecutive elements of b. When m is - // false, the corresponding element of a is skipped. m must contain - // at least n true elements. a must contain at least n elements and - // enough elements to match up with m through the nth true element - // of m. I.e. if n is 10, m has 15 elements with 5 false followed - // by 10 true, a must have 15 elements. - template<typename _Tp> - void - __valarray_copy(_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b, - size_t __n) - { - _Tp* __p (__a._M_data); - bool* __ok (__m._M_data); - for (_Tp* __q = __b._M_data; __q < __b._M_data + __n; - ++__q, ++__ok, ++__p) - { - while (! *__ok) - { - ++__ok; - ++__p; - } - *__q = *__p; - } - } - - // Copy n consecutive elements from a into elements of b. Elements - // of b are skipped if the corresponding element of m is false. m - // must contain at least n true elements. b must have at least as - // many elements as the index of the nth true element of m. I.e. if - // m has 15 elements with 5 false followed by 10 true, b must have - // at least 15 elements. - template<typename _Tp> - void - __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b, - _Array<bool> __m) - { - _Tp* __q (__b._M_data); - bool* __ok (__m._M_data); - for (_Tp* __p = __a._M_data; __p < __a._M_data+__n; - ++__p, ++__ok, ++__q) - { - while (! *__ok) - { - ++__ok; - ++__q; - } - *__q = *__p; - } - } - - // Copy n elements from a into elements of b. Elements of a are - // skipped if the corresponding element of m is false. Elements of - // b are skipped if the corresponding element of k is false. m and - // k must contain at least n true elements. a and b must have at - // least as many elements as the index of the nth true element of m. - template<typename _Tp> - void - __valarray_copy(_Array<_Tp> __a, _Array<bool> __m, size_t __n, - _Array<_Tp> __b, _Array<bool> __k) - { - _Tp* __p (__a._M_data); - _Tp* __q (__b._M_data); - bool* __srcok (__m._M_data); - bool* __dstok (__k._M_data); - for (size_t __i = 0; __i < __n; - ++__srcok, ++__p, ++__dstok, ++__q, ++__i) - { - while (! *__srcok) - { - ++__srcok; - ++__p; - } - while (! *__dstok) - { - ++__dstok; - ++__q; - } - *__q = *__p; - } - } - - // Copy n consecutive elements of e into consecutive elements of a. - // I.e. a[i] = e[i]. - template<typename _Tp, class _Dom> - void - __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a) - { - _Tp* __p (__a._M_data); - for (size_t __i = 0; __i < __n; ++__i, ++__p) - *__p = __e[__i]; - } - - // Copy n consecutive elements of e into elements of a using stride - // s. I.e., a[0] = e[0], a[s] = e[1], a[2*s] = e[2]. - template<typename _Tp, class _Dom> - void - __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, - _Array<_Tp> __a, size_t __s) - { - _Tp* __p (__a._M_data); - for (size_t __i = 0; __i < __n; ++__i, __p += __s) - *__p = __e[__i]; - } - - // Copy n consecutive elements of e into elements of a indexed by - // contents of i. I.e., a[i[0]] = e[0]. - template<typename _Tp, class _Dom> - void - __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, - _Array<_Tp> __a, _Array<size_t> __i) - { - size_t* __j (__i._M_data); - for (size_t __k = 0; __k < __n; ++__k, ++__j) - __a._M_data[*__j] = __e[__k]; - } - - // Copy n elements of e indexed by contents of f into elements of a - // indexed by contents of i. I.e., a[i[0]] = e[f[0]]. - template<typename _Tp> - void - __valarray_copy(_Array<_Tp> __e, _Array<size_t> __f, - size_t __n, - _Array<_Tp> __a, _Array<size_t> __i) - { - size_t* __g (__f._M_data); - size_t* __j (__i._M_data); - for (size_t __k = 0; __k < __n; ++__k, ++__j, ++__g) - __a._M_data[*__j] = __e._M_data[*__g]; - } - - // Copy n consecutive elements of e into elements of a. Elements of - // a are skipped if the corresponding element of m is false. m must - // have at least n true elements and a must have at least as many - // elements as the index of the nth true element of m. I.e. if m - // has 5 false followed by 10 true elements and n == 10, a must have - // at least 15 elements. - template<typename _Tp, class _Dom> - void - __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, - _Array<_Tp> __a, _Array<bool> __m) - { - bool* __ok (__m._M_data); - _Tp* __p (__a._M_data); - for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p) - { - while (! *__ok) - { - ++__ok; - ++__p; - } - *__p = __e[__i]; - } - } - - - template<typename _Tp, class _Dom> - void - __valarray_copy_construct(const _Expr<_Dom, _Tp>& __e, size_t __n, - _Array<_Tp> __a) - { - _Tp* __p (__a._M_data); - for (size_t __i = 0; __i < __n; ++__i, ++__p) - new (__p) _Tp(__e[__i]); - } - - - template<typename _Tp> - void - __valarray_copy_construct(_Array<_Tp> __a, _Array<bool> __m, - _Array<_Tp> __b, size_t __n) - { - _Tp* __p (__a._M_data); - bool* __ok (__m._M_data); - for (_Tp* __q = __b._M_data; __q < __b._M_data+__n; ++__q, ++__ok, ++__p) - { - while (! *__ok) - { - ++__ok; - ++__p; - } - new (__q) _Tp(*__p); - } - } -} // namespace std - -#endif /* _VALARRAY_ARRAY_TCC */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_before.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_before.h deleted file mode 100644 index 263ac2f0e22..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/valarray_before.h +++ /dev/null @@ -1,701 +0,0 @@ -// The template and inlines for the -*- C++ -*- internal _Meta class. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr> - -/** @file valarray_meta.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _VALARRAY_BEFORE_H -#define _VALARRAY_BEFORE_H 1 - -#pragma GCC system_header - -#include <bits/slice_array.h> - -namespace std -{ - // - // Implementing a loosened valarray return value is tricky. - // First we need to meet 26.3.1/3: we should not add more than - // two levels of template nesting. Therefore we resort to template - // template to "flatten" loosened return value types. - // At some point we use partial specialization to remove one level - // template nesting due to _Expr<> - // - - // This class is NOT defined. It doesn't need to. - template<typename _Tp1, typename _Tp2> class _Constant; - - // Implementations of unary functions applied to valarray<>s. - // I use hard-coded object functions here instead of a generic - // approach like pointers to function: - // 1) correctness: some functions take references, others values. - // we can't deduce the correct type afterwards. - // 2) efficiency -- object functions can be easily inlined - // 3) be Koenig-lookup-friendly - - struct __abs - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return abs(__t); } - }; - - struct __cos - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return cos(__t); } - }; - - struct __acos - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return acos(__t); } - }; - - struct __cosh - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return cosh(__t); } - }; - - struct __sin - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return sin(__t); } - }; - - struct __asin - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return asin(__t); } - }; - - struct __sinh - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return sinh(__t); } - }; - - struct __tan - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return tan(__t); } - }; - - struct __atan - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return atan(__t); } - }; - - struct __tanh - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return tanh(__t); } - }; - - struct __exp - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return exp(__t); } - }; - - struct __log - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return log(__t); } - }; - - struct __log10 - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return log10(__t); } - }; - - struct __sqrt - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return sqrt(__t); } - }; - - // In the past, we used to tailor operator applications semantics - // to the specialization of standard function objects (i.e. plus<>, etc.) - // That is incorrect. Therefore we provide our own surrogates. - - struct __unary_plus - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return +__t; } - }; - - struct __negate - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return -__t; } - }; - - struct __bitwise_not - { - template<typename _Tp> - _Tp operator()(const _Tp& __t) const { return ~__t; } - }; - - struct __plus - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return __x + __y; } - }; - - struct __minus - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return __x - __y; } - }; - - struct __multiplies - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return __x * __y; } - }; - - struct __divides - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return __x / __y; } - }; - - struct __modulus - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return __x % __y; } - }; - - struct __bitwise_xor - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return __x ^ __y; } - }; - - struct __bitwise_and - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return __x & __y; } - }; - - struct __bitwise_or - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return __x | __y; } - }; - - struct __shift_left - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return __x << __y; } - }; - - struct __shift_right - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return __x >> __y; } - }; - - struct __logical_and - { - template<typename _Tp> - bool operator()(const _Tp& __x, const _Tp& __y) const - { return __x && __y; } - }; - - struct __logical_or - { - template<typename _Tp> - bool operator()(const _Tp& __x, const _Tp& __y) const - { return __x || __y; } - }; - - struct __logical_not - { - template<typename _Tp> - bool operator()(const _Tp& __x) const { return !__x; } - }; - - struct __equal_to - { - template<typename _Tp> - bool operator()(const _Tp& __x, const _Tp& __y) const - { return __x == __y; } - }; - - struct __not_equal_to - { - template<typename _Tp> - bool operator()(const _Tp& __x, const _Tp& __y) const - { return __x != __y; } - }; - - struct __less - { - template<typename _Tp> - bool operator()(const _Tp& __x, const _Tp& __y) const - { return __x < __y; } - }; - - struct __greater - { - template<typename _Tp> - bool operator()(const _Tp& __x, const _Tp& __y) const - { return __x > __y; } - }; - - struct __less_equal - { - template<typename _Tp> - bool operator()(const _Tp& __x, const _Tp& __y) const - { return __x <= __y; } - }; - - struct __greater_equal - { - template<typename _Tp> - bool operator()(const _Tp& __x, const _Tp& __y) const - { return __x >= __y; } - }; - - // The few binary functions we miss. - struct __atan2 - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return atan2(__x, __y); } - }; - - struct __pow - { - template<typename _Tp> - _Tp operator()(const _Tp& __x, const _Tp& __y) const - { return pow(__x, __y); } - }; - - - // We need these bits in order to recover the return type of - // some functions/operators now that we're no longer using - // function templates. - template<typename, typename _Tp> - struct __fun - { - typedef _Tp result_type; - }; - - // several specializations for relational operators. - template<typename _Tp> - struct __fun<__logical_not, _Tp> - { - typedef bool result_type; - }; - - template<typename _Tp> - struct __fun<__logical_and, _Tp> - { - typedef bool result_type; - }; - - template<typename _Tp> - struct __fun<__logical_or, _Tp> - { - typedef bool result_type; - }; - - template<typename _Tp> - struct __fun<__less, _Tp> - { - typedef bool result_type; - }; - - template<typename _Tp> - struct __fun<__greater, _Tp> - { - typedef bool result_type; - }; - - template<typename _Tp> - struct __fun<__less_equal, _Tp> - { - typedef bool result_type; - }; - - template<typename _Tp> - struct __fun<__greater_equal, _Tp> - { - typedef bool result_type; - }; - - template<typename _Tp> - struct __fun<__equal_to, _Tp> - { - typedef bool result_type; - }; - - template<typename _Tp> - struct __fun<__not_equal_to, _Tp> - { - typedef bool result_type; - }; - - // - // Apply function taking a value/const reference closure - // - - template<typename _Dom, typename _Arg> - class _FunBase - { - public: - typedef typename _Dom::value_type value_type; - - _FunBase(const _Dom& __e, value_type __f(_Arg)) - : _M_expr(__e), _M_func(__f) {} - - value_type operator[](size_t __i) const - { return _M_func (_M_expr[__i]); } - - size_t size() const { return _M_expr.size ();} - - private: - const _Dom& _M_expr; - value_type (*_M_func)(_Arg); - }; - - template<class _Dom> - struct _ValFunClos<_Expr,_Dom> : _FunBase<_Dom, typename _Dom::value_type> - { - typedef _FunBase<_Dom, typename _Dom::value_type> _Base; - typedef typename _Base::value_type value_type; - typedef value_type _Tp; - - _ValFunClos(const _Dom& __e, _Tp __f(_Tp)) : _Base(__e, __f) {} - }; - - template<typename _Tp> - struct _ValFunClos<_ValArray,_Tp> : _FunBase<valarray<_Tp>, _Tp> - { - typedef _FunBase<valarray<_Tp>, _Tp> _Base; - typedef _Tp value_type; - - _ValFunClos(const valarray<_Tp>& __v, _Tp __f(_Tp)) : _Base(__v, __f) {} - }; - - template<class _Dom> - struct _RefFunClos<_Expr,_Dom> : - _FunBase<_Dom, const typename _Dom::value_type&> - { - typedef _FunBase<_Dom, const typename _Dom::value_type&> _Base; - typedef typename _Base::value_type value_type; - typedef value_type _Tp; - - _RefFunClos(const _Dom& __e, _Tp __f(const _Tp&)) - : _Base(__e, __f) {} - }; - - template<typename _Tp> - struct _RefFunClos<_ValArray,_Tp> : _FunBase<valarray<_Tp>, const _Tp&> - { - typedef _FunBase<valarray<_Tp>, const _Tp&> _Base; - typedef _Tp value_type; - - _RefFunClos(const valarray<_Tp>& __v, _Tp __f(const _Tp&)) - : _Base(__v, __f) {} - }; - - // - // Unary expression closure. - // - - template<class _Oper, class _Arg> - class _UnBase - { - public: - typedef typename _Arg::value_type _Vt; - typedef typename __fun<_Oper, _Vt>::result_type value_type; - - _UnBase(const _Arg& __e) : _M_expr(__e) {} - - value_type operator[](size_t __i) const - { return _Oper()(_M_expr[__i]); } - - size_t size() const { return _M_expr.size(); } - - private: - const _Arg& _M_expr; - }; - - template<class _Oper, class _Dom> - struct _UnClos<_Oper, _Expr, _Dom> : _UnBase<_Oper, _Dom> - { - typedef _Dom _Arg; - typedef _UnBase<_Oper, _Dom> _Base; - typedef typename _Base::value_type value_type; - - _UnClos(const _Arg& __e) : _Base(__e) {} - }; - - template<class _Oper, typename _Tp> - struct _UnClos<_Oper, _ValArray, _Tp> : _UnBase<_Oper, valarray<_Tp> > - { - typedef valarray<_Tp> _Arg; - typedef _UnBase<_Oper, valarray<_Tp> > _Base; - typedef typename _Base::value_type value_type; - - _UnClos(const _Arg& __e) : _Base(__e) {} - }; - - - // - // Binary expression closure. - // - - template<class _Oper, class _FirstArg, class _SecondArg> - class _BinBase - { - public: - typedef typename _FirstArg::value_type _Vt; - typedef typename __fun<_Oper, _Vt>::result_type value_type; - - _BinBase(const _FirstArg& __e1, const _SecondArg& __e2) - : _M_expr1(__e1), _M_expr2(__e2) {} - - value_type operator[](size_t __i) const - { return _Oper()(_M_expr1[__i], _M_expr2[__i]); } - - size_t size() const { return _M_expr1.size(); } - - private: - const _FirstArg& _M_expr1; - const _SecondArg& _M_expr2; - }; - - - template<class _Oper, class _Clos> - class _BinBase2 - { - public: - typedef typename _Clos::value_type _Vt; - typedef typename __fun<_Oper, _Vt>::result_type value_type; - - _BinBase2(const _Clos& __e, const _Vt& __t) - : _M_expr1(__e), _M_expr2(__t) {} - - value_type operator[](size_t __i) const - { return _Oper()(_M_expr1[__i], _M_expr2); } - - size_t size() const { return _M_expr1.size(); } - - private: - const _Clos& _M_expr1; - const _Vt& _M_expr2; - }; - - template<class _Oper, class _Clos> - class _BinBase1 - { - public: - typedef typename _Clos::value_type _Vt; - typedef typename __fun<_Oper, _Vt>::result_type value_type; - - _BinBase1(const _Vt& __t, const _Clos& __e) - : _M_expr1(__t), _M_expr2(__e) {} - - value_type operator[](size_t __i) const - { return _Oper()(_M_expr1, _M_expr2[__i]); } - - size_t size() const { return _M_expr2.size(); } - - private: - const _Vt& _M_expr1; - const _Clos& _M_expr2; - }; - - template<class _Oper, class _Dom1, class _Dom2> - struct _BinClos<_Oper, _Expr, _Expr, _Dom1, _Dom2> - : _BinBase<_Oper,_Dom1,_Dom2> - { - typedef _BinBase<_Oper,_Dom1,_Dom2> _Base; - typedef typename _Base::value_type value_type; - - _BinClos(const _Dom1& __e1, const _Dom2& __e2) : _Base(__e1, __e2) {} - }; - - template<class _Oper, typename _Tp> - struct _BinClos<_Oper,_ValArray,_ValArray,_Tp,_Tp> - : _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> > - { - typedef _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> > _Base; - typedef _Tp value_type; - - _BinClos(const valarray<_Tp>& __v, const valarray<_Tp>& __w) - : _Base(__v, __w) {} - }; - - template<class _Oper, class _Dom> - struct _BinClos<_Oper,_Expr,_ValArray,_Dom,typename _Dom::value_type> - : _BinBase<_Oper,_Dom,valarray<typename _Dom::value_type> > - { - typedef typename _Dom::value_type _Tp; - typedef _BinBase<_Oper,_Dom,valarray<_Tp> > _Base; - typedef typename _Base::value_type value_type; - - _BinClos(const _Dom& __e1, const valarray<_Tp>& __e2) - : _Base(__e1, __e2) {} - }; - - template<class _Oper, class _Dom> - struct _BinClos<_Oper,_ValArray,_Expr,typename _Dom::value_type,_Dom> - : _BinBase<_Oper,valarray<typename _Dom::value_type>,_Dom> - { - typedef typename _Dom::value_type _Tp; - typedef _BinBase<_Oper,valarray<_Tp>,_Dom> _Base; - typedef typename _Base::value_type value_type; - - _BinClos(const valarray<_Tp>& __e1, const _Dom& __e2) - : _Base(__e1, __e2) {} - }; - - template<class _Oper, class _Dom> - struct _BinClos<_Oper,_Expr,_Constant,_Dom,typename _Dom::value_type> - : _BinBase2<_Oper,_Dom> - { - typedef typename _Dom::value_type _Tp; - typedef _BinBase2<_Oper,_Dom> _Base; - typedef typename _Base::value_type value_type; - - _BinClos(const _Dom& __e1, const _Tp& __e2) : _Base(__e1, __e2) {} - }; - - template<class _Oper, class _Dom> - struct _BinClos<_Oper,_Constant,_Expr,typename _Dom::value_type,_Dom> - : _BinBase1<_Oper,_Dom> - { - typedef typename _Dom::value_type _Tp; - typedef _BinBase1<_Oper,_Dom> _Base; - typedef typename _Base::value_type value_type; - - _BinClos(const _Tp& __e1, const _Dom& __e2) : _Base(__e1, __e2) {} - }; - - template<class _Oper, typename _Tp> - struct _BinClos<_Oper,_ValArray,_Constant,_Tp,_Tp> - : _BinBase2<_Oper,valarray<_Tp> > - { - typedef _BinBase2<_Oper,valarray<_Tp> > _Base; - typedef typename _Base::value_type value_type; - - _BinClos(const valarray<_Tp>& __v, const _Tp& __t) : _Base(__v, __t) {} - }; - - template<class _Oper, typename _Tp> - struct _BinClos<_Oper,_Constant,_ValArray,_Tp,_Tp> - : _BinBase1<_Oper,valarray<_Tp> > - { - typedef _BinBase1<_Oper,valarray<_Tp> > _Base; - typedef typename _Base::value_type value_type; - - _BinClos(const _Tp& __t, const valarray<_Tp>& __v) : _Base(__t, __v) {} - }; - - - // - // slice_array closure. - // - template<typename _Dom> class _SBase { - public: - typedef typename _Dom::value_type value_type; - - _SBase (const _Dom& __e, const slice& __s) - : _M_expr (__e), _M_slice (__s) {} - value_type operator[] (size_t __i) const - { return _M_expr[_M_slice.start () + __i * _M_slice.stride ()]; } - size_t size() const { return _M_slice.size (); } - - private: - const _Dom& _M_expr; - const slice& _M_slice; - }; - - template<typename _Tp> class _SBase<_Array<_Tp> > { - public: - typedef _Tp value_type; - - _SBase (_Array<_Tp> __a, const slice& __s) - : _M_array (__a._M_data+__s.start()), _M_size (__s.size()), - _M_stride (__s.stride()) {} - value_type operator[] (size_t __i) const - { return _M_array._M_data[__i * _M_stride]; } - size_t size() const { return _M_size; } - - private: - const _Array<_Tp> _M_array; - const size_t _M_size; - const size_t _M_stride; - }; - - template<class _Dom> struct _SClos<_Expr,_Dom> : _SBase<_Dom> { - typedef _SBase<_Dom> _Base; - typedef typename _Base::value_type value_type; - - _SClos (const _Dom& __e, const slice& __s) : _Base (__e, __s) {} - }; - - template<typename _Tp> - struct _SClos<_ValArray,_Tp> : _SBase<_Array<_Tp> > { - typedef _SBase<_Array<_Tp> > _Base; - typedef _Tp value_type; - - _SClos (_Array<_Tp> __a, const slice& __s) : _Base (__a, __s) {} - }; - -} // std:: - - -#endif /* _CPP_VALARRAY_BEFORE_H */ - -// Local Variables: -// mode:c++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/vector.tcc b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/vector.tcc deleted file mode 100644 index 786afab2ec9..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/vector.tcc +++ /dev/null @@ -1,414 +0,0 @@ -// Vector implementation (out of line) -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file vector.tcc - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _VECTOR_TCC -#define _VECTOR_TCC 1 - -namespace _GLIBCXX_STD -{ - template<typename _Tp, typename _Alloc> - void - vector<_Tp,_Alloc>:: - reserve(size_type __n) - { - if (__n > this->max_size()) - __throw_length_error(__N("vector::reserve")); - if (this->capacity() < __n) - { - const size_type __old_size = size(); - pointer __tmp = _M_allocate_and_copy(__n, - this->_M_impl._M_start, - this->_M_impl._M_finish); - std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish); - _M_deallocate(this->_M_impl._M_start, - this->_M_impl._M_end_of_storage - this->_M_impl._M_start); - this->_M_impl._M_start = __tmp; - this->_M_impl._M_finish = __tmp + __old_size; - this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; - } - } - - template<typename _Tp, typename _Alloc> - typename vector<_Tp,_Alloc>::iterator - vector<_Tp,_Alloc>:: - insert(iterator __position, const value_type& __x) - { - size_type __n = __position - begin(); - if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage && __position == end()) - { - std::_Construct(this->_M_impl._M_finish, __x); - ++this->_M_impl._M_finish; - } - else - _M_insert_aux(__position, __x); - return begin() + __n; - } - - template<typename _Tp, typename _Alloc> - typename vector<_Tp,_Alloc>::iterator - vector<_Tp,_Alloc>:: - erase(iterator __position) - { - if (__position + 1 != end()) - std::copy(__position + 1, end(), __position); - --this->_M_impl._M_finish; - std::_Destroy(this->_M_impl._M_finish); - return __position; - } - - template<typename _Tp, typename _Alloc> - typename vector<_Tp,_Alloc>::iterator - vector<_Tp,_Alloc>:: - erase(iterator __first, iterator __last) - { - iterator __i(std::copy(__last, end(), __first)); - std::_Destroy(__i, end()); - this->_M_impl._M_finish = this->_M_impl._M_finish - (__last - __first); - return __first; - } - - template<typename _Tp, typename _Alloc> - vector<_Tp,_Alloc>& - vector<_Tp,_Alloc>:: - operator=(const vector<_Tp,_Alloc>& __x) - { - if (&__x != this) - { - const size_type __xlen = __x.size(); - if (__xlen > capacity()) - { - pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(), __x.end()); - std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish); - _M_deallocate(this->_M_impl._M_start, - this->_M_impl._M_end_of_storage - this->_M_impl._M_start); - this->_M_impl._M_start = __tmp; - this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen; - } - else if (size() >= __xlen) - { - iterator __i(std::copy(__x.begin(), __x.end(), begin())); - std::_Destroy(__i, end()); - } - else - { - std::copy(__x.begin(), __x.begin() + size(), this->_M_impl._M_start); - std::uninitialized_copy(__x.begin() + size(), __x.end(), this->_M_impl._M_finish); - } - this->_M_impl._M_finish = this->_M_impl._M_start + __xlen; - } - return *this; - } - - template<typename _Tp, typename _Alloc> - void - vector<_Tp,_Alloc>:: - _M_fill_assign(size_t __n, const value_type& __val) - { - if (__n > capacity()) - { - vector __tmp(__n, __val, get_allocator()); - __tmp.swap(*this); - } - else if (__n > size()) - { - std::fill(begin(), end(), __val); - this->_M_impl._M_finish - = std::uninitialized_fill_n(this->_M_impl._M_finish, __n - size(), __val); - } - else - erase(fill_n(begin(), __n, __val), end()); - } - - template<typename _Tp, typename _Alloc> template<typename _InputIterator> - void - vector<_Tp,_Alloc>:: - _M_assign_aux(_InputIterator __first, _InputIterator __last, input_iterator_tag) - { - iterator __cur(begin()); - for ( ; __first != __last && __cur != end(); ++__cur, ++__first) - *__cur = *__first; - if (__first == __last) - erase(__cur, end()); - else - insert(end(), __first, __last); - } - - template<typename _Tp, typename _Alloc> template<typename _ForwardIterator> - void - vector<_Tp,_Alloc>:: - _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) - { - size_type __len = std::distance(__first, __last); - - if (__len > capacity()) - { - pointer __tmp(_M_allocate_and_copy(__len, __first, __last)); - std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish); - _M_deallocate(this->_M_impl._M_start, - this->_M_impl._M_end_of_storage - this->_M_impl._M_start); - this->_M_impl._M_start = __tmp; - this->_M_impl._M_end_of_storage = this->_M_impl._M_finish = this->_M_impl._M_start + __len; - } - else if (size() >= __len) - { - iterator __new_finish(std::copy(__first, __last, this->_M_impl._M_start)); - std::_Destroy(__new_finish, end()); - this->_M_impl._M_finish = __new_finish.base(); - } - else - { - _ForwardIterator __mid = __first; - std::advance(__mid, size()); - std::copy(__first, __mid, this->_M_impl._M_start); - this->_M_impl._M_finish = std::uninitialized_copy(__mid, __last, this->_M_impl._M_finish); - } - } - - template<typename _Tp, typename _Alloc> - void - vector<_Tp,_Alloc>:: - _M_insert_aux(iterator __position, const _Tp& __x) - { - if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) - { - std::_Construct(this->_M_impl._M_finish, *(this->_M_impl._M_finish - 1)); - ++this->_M_impl._M_finish; - _Tp __x_copy = __x; - std::copy_backward(__position, - iterator(this->_M_impl._M_finish-2), - iterator(this->_M_impl._M_finish-1)); - *__position = __x_copy; - } - else - { - const size_type __old_size = size(); - const size_type __len = __old_size != 0 ? 2 * __old_size : 1; - iterator __new_start(this->_M_allocate(__len)); - iterator __new_finish(__new_start); - try - { - __new_finish = std::uninitialized_copy(iterator(this->_M_impl._M_start), - __position, - __new_start); - std::_Construct(__new_finish.base(), __x); - ++__new_finish; - __new_finish = std::uninitialized_copy(__position, - iterator(this->_M_impl._M_finish), - __new_finish); - } - catch(...) - { - std::_Destroy(__new_start,__new_finish); - _M_deallocate(__new_start.base(),__len); - __throw_exception_again; - } - std::_Destroy(begin(), end()); - _M_deallocate(this->_M_impl._M_start, - this->_M_impl._M_end_of_storage - this->_M_impl._M_start); - this->_M_impl._M_start = __new_start.base(); - this->_M_impl._M_finish = __new_finish.base(); - this->_M_impl._M_end_of_storage = __new_start.base() + __len; - } - } - - template<typename _Tp, typename _Alloc> - void - vector<_Tp,_Alloc>:: - _M_fill_insert(iterator __position, size_type __n, const value_type& __x) - { - if (__n != 0) - { - if (size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_finish) >= __n) - { - value_type __x_copy = __x; - const size_type __elems_after = end() - __position; - iterator __old_finish(this->_M_impl._M_finish); - if (__elems_after > __n) - { - std::uninitialized_copy(this->_M_impl._M_finish - __n, - this->_M_impl._M_finish, - this->_M_impl._M_finish); - this->_M_impl._M_finish += __n; - std::copy_backward(__position, __old_finish - __n, __old_finish); - std::fill(__position, __position + __n, __x_copy); - } - else - { - std::uninitialized_fill_n(this->_M_impl._M_finish, - __n - __elems_after, - __x_copy); - this->_M_impl._M_finish += __n - __elems_after; - std::uninitialized_copy(__position, __old_finish, this->_M_impl._M_finish); - this->_M_impl._M_finish += __elems_after; - std::fill(__position, __old_finish, __x_copy); - } - } - else - { - const size_type __old_size = size(); - const size_type __len = __old_size + std::max(__old_size, __n); - iterator __new_start(this->_M_allocate(__len)); - iterator __new_finish(__new_start); - try - { - __new_finish = std::uninitialized_copy(begin(), __position, - __new_start); - __new_finish = std::uninitialized_fill_n(__new_finish, __n, __x); - __new_finish = std::uninitialized_copy(__position, end(), - __new_finish); - } - catch(...) - { - std::_Destroy(__new_start,__new_finish); - _M_deallocate(__new_start.base(),__len); - __throw_exception_again; - } - std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish); - _M_deallocate(this->_M_impl._M_start, - this->_M_impl._M_end_of_storage - this->_M_impl._M_start); - this->_M_impl._M_start = __new_start.base(); - this->_M_impl._M_finish = __new_finish.base(); - this->_M_impl._M_end_of_storage = __new_start.base() + __len; - } - } - } - - template<typename _Tp, typename _Alloc> template<typename _InputIterator> - void - vector<_Tp,_Alloc>:: - _M_range_insert(iterator __pos, - _InputIterator __first, _InputIterator __last, - input_iterator_tag) - { - for ( ; __first != __last; ++__first) - { - __pos = insert(__pos, *__first); - ++__pos; - } - } - - template<typename _Tp, typename _Alloc> template<typename _ForwardIterator> - void - vector<_Tp,_Alloc>:: - _M_range_insert(iterator __position,_ForwardIterator __first, - _ForwardIterator __last, forward_iterator_tag) - { - if (__first != __last) - { - size_type __n = std::distance(__first, __last); - if (size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_finish) >= __n) - { - const size_type __elems_after = end() - __position; - iterator __old_finish(this->_M_impl._M_finish); - if (__elems_after > __n) - { - std::uninitialized_copy(this->_M_impl._M_finish - __n, - this->_M_impl._M_finish, - this->_M_impl._M_finish); - this->_M_impl._M_finish += __n; - std::copy_backward(__position, __old_finish - __n, __old_finish); - std::copy(__first, __last, __position); - } - else - { - _ForwardIterator __mid = __first; - std::advance(__mid, __elems_after); - std::uninitialized_copy(__mid, __last, this->_M_impl._M_finish); - this->_M_impl._M_finish += __n - __elems_after; - std::uninitialized_copy(__position, __old_finish, this->_M_impl._M_finish); - this->_M_impl._M_finish += __elems_after; - std::copy(__first, __mid, __position); - } - } - else - { - const size_type __old_size = size(); - const size_type __len = __old_size + std::max(__old_size, __n); - iterator __new_start(this->_M_allocate(__len)); - iterator __new_finish(__new_start); - try - { - __new_finish = std::uninitialized_copy(iterator(this->_M_impl._M_start), - __position, __new_start); - __new_finish = std::uninitialized_copy(__first, __last, - __new_finish); - __new_finish = std::uninitialized_copy(__position, - iterator(this->_M_impl._M_finish), - __new_finish); - } - catch(...) - { - std::_Destroy(__new_start,__new_finish); - _M_deallocate(__new_start.base(), __len); - __throw_exception_again; - } - std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish); - _M_deallocate(this->_M_impl._M_start, - this->_M_impl._M_end_of_storage - this->_M_impl._M_start); - this->_M_impl._M_start = __new_start.base(); - this->_M_impl._M_finish = __new_finish.base(); - this->_M_impl._M_end_of_storage = __new_start.base() + __len; - } - } - } -} // namespace std - -#endif /* _VECTOR_TCC */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bitset b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bitset deleted file mode 100644 index 01e3f904e47..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bitset +++ /dev/null @@ -1,1229 +0,0 @@ -// <bitset> -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1998 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file bitset - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_BITSET -#define _GLIBCXX_BITSET 1 - -#pragma GCC system_header - -#include <cstddef> // For size_t -#include <cstring> // For memset -#include <limits> // For numeric_limits -#include <string> -#include <bits/functexcept.h> // For invalid_argument, out_of_range, - // overflow_error -#include <ostream> // For ostream (operator<<) -#include <istream> // For istream (operator>>) - -#define _GLIBCXX_BITSET_BITS_PER_WORD numeric_limits<unsigned long>::digits -#define _GLIBCXX_BITSET_WORDS(__n) \ - ((__n) < 1 ? 0 : ((__n) + _GLIBCXX_BITSET_BITS_PER_WORD - 1)/_GLIBCXX_BITSET_BITS_PER_WORD) - -namespace _GLIBCXX_STD -{ - /** - * @if maint - * Base class, general case. It is a class inveriant that _Nw will be - * nonnegative. - * - * See documentation for bitset. - * @endif - */ - template<size_t _Nw> - struct _Base_bitset - { - typedef unsigned long _WordT; - - /// 0 is the least significant word. - _WordT _M_w[_Nw]; - - _Base_bitset() { _M_do_reset(); } - _Base_bitset(unsigned long __val) - { - _M_do_reset(); - _M_w[0] = __val; - } - - static size_t - _S_whichword(size_t __pos ) - { return __pos / _GLIBCXX_BITSET_BITS_PER_WORD; } - - static size_t - _S_whichbyte(size_t __pos ) - { return (__pos % _GLIBCXX_BITSET_BITS_PER_WORD) / __CHAR_BIT__; } - - static size_t - _S_whichbit(size_t __pos ) - { return __pos % _GLIBCXX_BITSET_BITS_PER_WORD; } - - static _WordT - _S_maskbit(size_t __pos ) - { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); } - - _WordT& - _M_getword(size_t __pos) - { return _M_w[_S_whichword(__pos)]; } - - _WordT - _M_getword(size_t __pos) const - { return _M_w[_S_whichword(__pos)]; } - - _WordT& - _M_hiword() { return _M_w[_Nw - 1]; } - - _WordT - _M_hiword() const { return _M_w[_Nw - 1]; } - - void - _M_do_and(const _Base_bitset<_Nw>& __x) - { - for (size_t __i = 0; __i < _Nw; __i++) - _M_w[__i] &= __x._M_w[__i]; - } - - void - _M_do_or(const _Base_bitset<_Nw>& __x) - { - for (size_t __i = 0; __i < _Nw; __i++) - _M_w[__i] |= __x._M_w[__i]; - } - - void - _M_do_xor(const _Base_bitset<_Nw>& __x) - { - for (size_t __i = 0; __i < _Nw; __i++) - _M_w[__i] ^= __x._M_w[__i]; - } - - void - _M_do_left_shift(size_t __shift); - - void - _M_do_right_shift(size_t __shift); - - void - _M_do_flip() - { - for (size_t __i = 0; __i < _Nw; __i++) - _M_w[__i] = ~_M_w[__i]; - } - - void - _M_do_set() - { - for (size_t __i = 0; __i < _Nw; __i++) - _M_w[__i] = ~static_cast<_WordT>(0); - } - - void - _M_do_reset() { memset(_M_w, 0, _Nw * sizeof(_WordT)); } - - bool - _M_is_equal(const _Base_bitset<_Nw>& __x) const - { - for (size_t __i = 0; __i < _Nw; ++__i) - { - if (_M_w[__i] != __x._M_w[__i]) - return false; - } - return true; - } - - bool - _M_is_any() const - { - for (size_t __i = 0; __i < _Nw; __i++) - { - if (_M_w[__i] != static_cast<_WordT>(0)) - return true; - } - return false; - } - - size_t - _M_do_count() const - { - size_t __result = 0; - for (size_t __i = 0; __i < _Nw; __i++) - __result += __builtin_popcountl(_M_w[__i]); - return __result; - } - - unsigned long - _M_do_to_ulong() const; - - // find first "on" bit - size_t - _M_do_find_first(size_t __not_found) const; - - // find the next "on" bit that follows "prev" - size_t - _M_do_find_next(size_t __prev, size_t __not_found) const; - }; - - // Definitions of non-inline functions from _Base_bitset. - template<size_t _Nw> - void - _Base_bitset<_Nw>::_M_do_left_shift(size_t __shift) - { - if (__builtin_expect(__shift != 0, 1)) - { - const size_t __wshift = __shift / _GLIBCXX_BITSET_BITS_PER_WORD; - const size_t __offset = __shift % _GLIBCXX_BITSET_BITS_PER_WORD; - - if (__offset == 0) - for (size_t __n = _Nw - 1; __n >= __wshift; --__n) - _M_w[__n] = _M_w[__n - __wshift]; - else - { - const size_t __sub_offset = _GLIBCXX_BITSET_BITS_PER_WORD - __offset; - for (size_t __n = _Nw - 1; __n > __wshift; --__n) - _M_w[__n] = (_M_w[__n - __wshift] << __offset) | - (_M_w[__n - __wshift - 1] >> __sub_offset); - _M_w[__wshift] = _M_w[0] << __offset; - } - - std::fill(_M_w + 0, _M_w + __wshift, static_cast<_WordT>(0)); - } - } - - template<size_t _Nw> - void - _Base_bitset<_Nw>::_M_do_right_shift(size_t __shift) - { - if (__builtin_expect(__shift != 0, 1)) - { - const size_t __wshift = __shift / _GLIBCXX_BITSET_BITS_PER_WORD; - const size_t __offset = __shift % _GLIBCXX_BITSET_BITS_PER_WORD; - const size_t __limit = _Nw - __wshift - 1; - - if (__offset == 0) - for (size_t __n = 0; __n <= __limit; ++__n) - _M_w[__n] = _M_w[__n + __wshift]; - else - { - const size_t __sub_offset = _GLIBCXX_BITSET_BITS_PER_WORD - __offset; - for (size_t __n = 0; __n < __limit; ++__n) - _M_w[__n] = (_M_w[__n + __wshift] >> __offset) | - (_M_w[__n + __wshift + 1] << __sub_offset); - _M_w[__limit] = _M_w[_Nw-1] >> __offset; - } - - std::fill(_M_w + __limit + 1, _M_w + _Nw, static_cast<_WordT>(0)); - } - } - - template<size_t _Nw> - unsigned long - _Base_bitset<_Nw>::_M_do_to_ulong() const - { - for (size_t __i = 1; __i < _Nw; ++__i) - if (_M_w[__i]) - __throw_overflow_error(__N("_Base_bitset::_M_do_to_ulong")); - return _M_w[0]; - } - - template<size_t _Nw> - size_t - _Base_bitset<_Nw>::_M_do_find_first(size_t __not_found) const - { - for (size_t __i = 0; __i < _Nw; __i++) - { - _WordT __thisword = _M_w[__i]; - if (__thisword != static_cast<_WordT>(0)) - return __i * _GLIBCXX_BITSET_BITS_PER_WORD - + __builtin_ctzl(__thisword); - } - // not found, so return an indication of failure. - return __not_found; - } - - template<size_t _Nw> - size_t - _Base_bitset<_Nw>::_M_do_find_next(size_t __prev, size_t __not_found) const - { - // make bound inclusive - ++__prev; - - // check out of bounds - if (__prev >= _Nw * _GLIBCXX_BITSET_BITS_PER_WORD) - return __not_found; - - // search first word - size_t __i = _S_whichword(__prev); - _WordT __thisword = _M_w[__i]; - - // mask off bits below bound - __thisword &= (~static_cast<_WordT>(0)) << _S_whichbit(__prev); - - if (__thisword != static_cast<_WordT>(0)) - return __i * _GLIBCXX_BITSET_BITS_PER_WORD - + __builtin_ctzl(__thisword); - - // check subsequent words - __i++; - for ( ; __i < _Nw; __i++ ) - { - __thisword = _M_w[__i]; - if (__thisword != static_cast<_WordT>(0)) - return __i * _GLIBCXX_BITSET_BITS_PER_WORD - + __builtin_ctzl(__thisword); - } - // not found, so return an indication of failure. - return __not_found; - } // end _M_do_find_next - - - /** - * @if maint - * Base class, specialization for a single word. - * - * See documentation for bitset. - * @endif - */ - template<> - struct _Base_bitset<1> - { - typedef unsigned long _WordT; - _WordT _M_w; - - _Base_bitset( void ) : _M_w(0) {} - _Base_bitset(unsigned long __val) : _M_w(__val) {} - - static size_t - _S_whichword(size_t __pos ) - { return __pos / _GLIBCXX_BITSET_BITS_PER_WORD; } - - static size_t - _S_whichbyte(size_t __pos ) - { return (__pos % _GLIBCXX_BITSET_BITS_PER_WORD) / __CHAR_BIT__; } - - static size_t - _S_whichbit(size_t __pos ) - { return __pos % _GLIBCXX_BITSET_BITS_PER_WORD; } - - static _WordT - _S_maskbit(size_t __pos ) - { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); } - - _WordT& - _M_getword(size_t) { return _M_w; } - - _WordT - _M_getword(size_t) const { return _M_w; } - - _WordT& - _M_hiword() { return _M_w; } - - _WordT - _M_hiword() const { return _M_w; } - - void - _M_do_and(const _Base_bitset<1>& __x) { _M_w &= __x._M_w; } - - void - _M_do_or(const _Base_bitset<1>& __x) { _M_w |= __x._M_w; } - - void - _M_do_xor(const _Base_bitset<1>& __x) { _M_w ^= __x._M_w; } - - void - _M_do_left_shift(size_t __shift) { _M_w <<= __shift; } - - void - _M_do_right_shift(size_t __shift) { _M_w >>= __shift; } - - void - _M_do_flip() { _M_w = ~_M_w; } - - void - _M_do_set() { _M_w = ~static_cast<_WordT>(0); } - - void - _M_do_reset() { _M_w = 0; } - - bool - _M_is_equal(const _Base_bitset<1>& __x) const - { return _M_w == __x._M_w; } - - bool - _M_is_any() const { return _M_w != 0; } - - size_t - _M_do_count() const { return __builtin_popcountl(_M_w); } - - unsigned long - _M_do_to_ulong() const { return _M_w; } - - size_t - _M_do_find_first(size_t __not_found) const - { - if (_M_w != 0) - return __builtin_ctzl(_M_w); - else - return __not_found; - } - - // find the next "on" bit that follows "prev" - size_t - _M_do_find_next(size_t __prev, size_t __not_found) const - { - ++__prev; - if (__prev >= ((size_t) _GLIBCXX_BITSET_BITS_PER_WORD)) - return __not_found; - - _WordT __x = _M_w >> __prev; - if (__x != 0) - return __builtin_ctzl(__x) + __prev; - else - return __not_found; - } - }; - - - /** - * @if maint - * Base class, specialization for no storage (zero-length %bitset). - * - * See documentation for bitset. - * @endif - */ - template<> - struct _Base_bitset<0> - { - typedef unsigned long _WordT; - - _Base_bitset() {} - _Base_bitset(unsigned long) {} - - static size_t - _S_whichword(size_t __pos ) - { return __pos / _GLIBCXX_BITSET_BITS_PER_WORD; } - - static size_t - _S_whichbyte(size_t __pos ) - { return (__pos % _GLIBCXX_BITSET_BITS_PER_WORD) / __CHAR_BIT__; } - - static size_t - _S_whichbit(size_t __pos ) - { return __pos % _GLIBCXX_BITSET_BITS_PER_WORD; } - - static _WordT - _S_maskbit(size_t __pos ) - { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); } - - // This would normally give access to the data. The bounds-checking - // in the bitset class will prevent the user from getting this far, - // but (1) it must still return an lvalue to compile, and (2) the - // user might call _Unchecked_set directly, in which case this /needs/ - // to fail. Let's not penalize zero-length users unless they actually - // make an unchecked call; all the memory ugliness is therefore - // localized to this single should-never-get-this-far function. - _WordT& - _M_getword(size_t) const - { - __throw_out_of_range(__N("_Base_bitset::_M_getword")); - return *new _WordT; - } - - _WordT - _M_hiword() const { return 0; } - - void - _M_do_and(const _Base_bitset<0>&) { } - - void - _M_do_or(const _Base_bitset<0>&) { } - - void - _M_do_xor(const _Base_bitset<0>&) { } - - void - _M_do_left_shift(size_t) { } - - void - _M_do_right_shift(size_t) { } - - void - _M_do_flip() { } - - void - _M_do_set() { } - - void - _M_do_reset() { } - - // Are all empty bitsets equal to each other? Are they equal to - // themselves? How to compare a thing which has no state? What is - // the sound of one zero-length bitset clapping? - bool - _M_is_equal(const _Base_bitset<0>&) const { return true; } - - bool - _M_is_any() const { return false; } - - size_t - _M_do_count() const { return 0; } - - unsigned long - _M_do_to_ulong() const { return 0; } - - // Normally "not found" is the size, but that could also be - // misinterpreted as an index in this corner case. Oh well. - size_t - _M_do_find_first(size_t) const { return 0; } - - size_t - _M_do_find_next(size_t, size_t) const { return 0; } - }; - - - // Helper class to zero out the unused high-order bits in the highest word. - template<size_t _Extrabits> - struct _Sanitize - { - static void _S_do_sanitize(unsigned long& __val) - { __val &= ~((~static_cast<unsigned long>(0)) << _Extrabits); } - }; - - template<> - struct _Sanitize<0> - { static void _S_do_sanitize(unsigned long) { } }; - - - /** - * @brief The %bitset class represents a @e fixed-size sequence of bits. - * - * @ingroup Containers - * - * (Note that %bitset does @e not meet the formal requirements of a - * <a href="tables.html#65">container</a>. Mainly, it lacks iterators.) - * - * The template argument, @a Nb, may be any non-negative number, - * specifying the number of bits (e.g., "0", "12", "1024*1024"). - * - * In the general unoptimized case, storage is allocated in word-sized - * blocks. Let B be the number of bits in a word, then (Nb+(B-1))/B - * words will be used for storage. B - Nb%B bits are unused. (They are - * the high-order bits in the highest word.) It is a class invariant - * that those unused bits are always zero. - * - * If you think of %bitset as "a simple array of bits," be aware that - * your mental picture is reversed: a %bitset behaves the same way as - * bits in integers do, with the bit at index 0 in the "least significant - * / right-hand" position, and the bit at index Nb-1 in the "most - * significant / left-hand" position. Thus, unlike other containers, a - * %bitset's index "counts from right to left," to put it very loosely. - * - * This behavior is preserved when translating to and from strings. For - * example, the first line of the following program probably prints - * "b('a') is 0001100001" on a modern ASCII system. - * - * @code - * #include <bitset> - * #include <iostream> - * #include <sstream> - * - * using namespace std; - * - * int main() - * { - * long a = 'a'; - * bitset<10> b(a); - * - * cout << "b('a') is " << b << endl; - * - * ostringstream s; - * s << b; - * string str = s.str(); - * cout << "index 3 in the string is " << str[3] << " but\n" - * << "index 3 in the bitset is " << b[3] << endl; - * } - * @endcode - * - * Also see http://gcc.gnu.org/onlinedocs/libstdc++/ext/sgiexts.html#ch23 - * for a description of extensions. - * - * @if maint - * Most of the actual code isn't contained in %bitset<> itself, but in the - * base class _Base_bitset. The base class works with whole words, not with - * individual bits. This allows us to specialize _Base_bitset for the - * important special case where the %bitset is only a single word. - * - * Extra confusion can result due to the fact that the storage for - * _Base_bitset @e is a regular array, and is indexed as such. This is - * carefully encapsulated. - * @endif - */ - template<size_t _Nb> - class bitset : private _Base_bitset<_GLIBCXX_BITSET_WORDS(_Nb)> - { - private: - typedef _Base_bitset<_GLIBCXX_BITSET_WORDS(_Nb)> _Base; - typedef unsigned long _WordT; - - void - _M_do_sanitize() - { - _Sanitize<_Nb%_GLIBCXX_BITSET_BITS_PER_WORD>:: - _S_do_sanitize(this->_M_hiword()); - } - - public: - /** - * This encapsulates the concept of a single bit. An instance of this - * class is a proxy for an actual bit; this way the individual bit - * operations are done as faster word-size bitwise instructions. - * - * Most users will never need to use this class directly; conversions - * to and from bool are automatic and should be transparent. Overloaded - * operators help to preserve the illusion. - * - * (On a typical system, this "bit %reference" is 64 times the size of - * an actual bit. Ha.) - */ - class reference - { - friend class bitset; - - _WordT *_M_wp; - size_t _M_bpos; - - // left undefined - reference(); - - public: - reference(bitset& __b, size_t __pos) - { - _M_wp = &__b._M_getword(__pos); - _M_bpos = _Base::_S_whichbit(__pos); - } - - ~reference() { } - - // For b[i] = __x; - reference& - operator=(bool __x) - { - if ( __x ) - *_M_wp |= _Base::_S_maskbit(_M_bpos); - else - *_M_wp &= ~_Base::_S_maskbit(_M_bpos); - return *this; - } - - // For b[i] = b[__j]; - reference& - operator=(const reference& __j) - { - if ( (*(__j._M_wp) & _Base::_S_maskbit(__j._M_bpos)) ) - *_M_wp |= _Base::_S_maskbit(_M_bpos); - else - *_M_wp &= ~_Base::_S_maskbit(_M_bpos); - return *this; - } - - // Flips the bit - bool - operator~() const - { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) == 0; } - - // For __x = b[i]; - operator bool() const - { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) != 0; } - - // For b[i].flip(); - reference& - flip() - { - *_M_wp ^= _Base::_S_maskbit(_M_bpos); - return *this; - } - }; - friend class reference; - - // 23.3.5.1 constructors: - /// All bits set to zero. - bitset() { } - - /// Initial bits bitwise-copied from a single word (others set to zero). - bitset(unsigned long __val) : _Base(__val) - { _M_do_sanitize(); } - - /** - * @brief Use a subset of a string. - * @param s A string of '0' and '1' characters. - * @param position Index of the first character in @a s to use; defaults - * to zero. - * @throw std::out_of_range If @a pos is bigger the size of @a s. - * @throw std::invalid_argument If a character appears in the string - * which is neither '0' nor '1'. - */ - template<class _CharT, class _Traits, class _Alloc> - explicit bitset(const basic_string<_CharT, _Traits, _Alloc>& __s, - size_t __position = 0) : _Base() - { - if (__position > __s.size()) - __throw_out_of_range(__N("bitset::bitset initial position " - "not valid")); - _M_copy_from_string(__s, __position, - basic_string<_CharT, _Traits, _Alloc>::npos); - } - - /** - * @brief Use a subset of a string. - * @param s A string of '0' and '1' characters. - * @param position Index of the first character in @a s to use. - * @param n The number of characters to copy. - * @throw std::out_of_range If @a pos is bigger the size of @a s. - * @throw std::invalid_argument If a character appears in the string - * which is neither '0' nor '1'. - */ - template<class _CharT, class _Traits, class _Alloc> - bitset(const basic_string<_CharT, _Traits, _Alloc>& __s, - size_t __position, size_t __n) : _Base() - { - if (__position > __s.size()) - __throw_out_of_range(__N("bitset::bitset initial position " - "not valid")); - _M_copy_from_string(__s, __position, __n); - } - - // 23.3.5.2 bitset operations: - //@{ - /** - * @brief Operations on bitsets. - * @param rhs A same-sized bitset. - * - * These should be self-explanatory. - */ - bitset<_Nb>& - operator&=(const bitset<_Nb>& __rhs) - { - this->_M_do_and(__rhs); - return *this; - } - - bitset<_Nb>& - operator|=(const bitset<_Nb>& __rhs) - { - this->_M_do_or(__rhs); - return *this; - } - - bitset<_Nb>& - operator^=(const bitset<_Nb>& __rhs) - { - this->_M_do_xor(__rhs); - return *this; - } - //@} - - //@{ - /** - * @brief Operations on bitsets. - * @param position The number of places to shift. - * - * These should be self-explanatory. - */ - bitset<_Nb>& - operator<<=(size_t __position) - { - if (__builtin_expect(__position < _Nb, 1)) - { - this->_M_do_left_shift(__position); - this->_M_do_sanitize(); - } - else - this->_M_do_reset(); - return *this; - } - - bitset<_Nb>& - operator>>=(size_t __position) - { - if (__builtin_expect(__position < _Nb, 1)) - { - this->_M_do_right_shift(__position); - this->_M_do_sanitize(); - } - else - this->_M_do_reset(); - return *this; - } - //@} - - //@{ - /** - * These versions of single-bit set, reset, flip, and test are - * extensions from the SGI version. They do no range checking. - * @ingroup SGIextensions - */ - bitset<_Nb>& - _Unchecked_set(size_t __pos) - { - this->_M_getword(__pos) |= _Base::_S_maskbit(__pos); - return *this; - } - - bitset<_Nb>& - _Unchecked_set(size_t __pos, int __val) - { - if (__val) - this->_M_getword(__pos) |= _Base::_S_maskbit(__pos); - else - this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos); - return *this; - } - - bitset<_Nb>& - _Unchecked_reset(size_t __pos) - { - this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos); - return *this; - } - - bitset<_Nb>& - _Unchecked_flip(size_t __pos) - { - this->_M_getword(__pos) ^= _Base::_S_maskbit(__pos); - return *this; - } - - bool - _Unchecked_test(size_t __pos) const - { - return (this->_M_getword(__pos) & _Base::_S_maskbit(__pos)) - != static_cast<_WordT>(0); - } - //@} - - // Set, reset, and flip. - /** - * @brief Sets every bit to true. - */ - bitset<_Nb>& - set() - { - this->_M_do_set(); - this->_M_do_sanitize(); - return *this; - } - - /** - * @brief Sets a given bit to a particular value. - * @param position The index of the bit. - * @param val Either true or false, defaults to true. - * @throw std::out_of_range If @a pos is bigger the size of the %set. - */ - bitset<_Nb>& - set(size_t __position, bool __val = true) - { - if (__position >= _Nb) - __throw_out_of_range(__N("bitset::set")); - return _Unchecked_set(__position, __val); - } - - /** - * @brief Sets every bit to false. - */ - bitset<_Nb>& - reset() - { - this->_M_do_reset(); - return *this; - } - - /** - * @brief Sets a given bit to false. - * @param position The index of the bit. - * @throw std::out_of_range If @a pos is bigger the size of the %set. - * - * Same as writing @c set(pos,false). - */ - bitset<_Nb>& - reset(size_t __position) - { - if (__position >= _Nb) - __throw_out_of_range(__N("bitset::reset")); - return _Unchecked_reset(__position); - } - - /** - * @brief Toggles every bit to its opposite value. - */ - bitset<_Nb>& - flip() - { - this->_M_do_flip(); - this->_M_do_sanitize(); - return *this; - } - - /** - * @brief Toggles a given bit to its opposite value. - * @param position The index of the bit. - * @throw std::out_of_range If @a pos is bigger the size of the %set. - */ - bitset<_Nb>& - flip(size_t __position) - { - if (__position >= _Nb) - __throw_out_of_range(__N("bitset::flip")); - return _Unchecked_flip(__position); - } - - /// See the no-argument flip(). - bitset<_Nb> - operator~() const { return bitset<_Nb>(*this).flip(); } - - //@{ - /** - * @brief Array-indexing support. - * @param position Index into the %bitset. - * @return A bool for a 'const %bitset'. For non-const bitsets, an - * instance of the reference proxy class. - * @note These operators do no range checking and throw no exceptions, - * as required by DR 11 to the standard. - * - * @if maint - * _GLIBCXX_RESOLVE_LIB_DEFECTS Note that this implementation already - * resolves DR 11 (items 1 and 2), but does not do the range-checking - * required by that DR's resolution. -pme - * The DR has since been changed: range-checking is a precondition - * (users' responsibility), and these functions must not throw. -pme - * @endif - */ - reference - operator[](size_t __position) { return reference(*this,__position); } - - bool - operator[](size_t __position) const { return _Unchecked_test(__position); } - //@} - - /** - * @brief Retuns a numerical interpretation of the %bitset. - * @return The integral equivalent of the bits. - * @throw std::overflow_error If there are too many bits to be - * represented in an @c unsigned @c long. - */ - unsigned long - to_ulong() const { return this->_M_do_to_ulong(); } - - /** - * @brief Retuns a character interpretation of the %bitset. - * @return The string equivalent of the bits. - * - * Note the ordering of the bits: decreasing character positions - * correspond to increasing bit positions (see the main class notes for - * an example). - * - * Also note that you must specify the string's template parameters - * explicitly. Given a bitset @c bs and a string @s: - * @code - * s = bs.to_string<char,char_traits<char>,allocator<char> >(); - * @endcode - */ - template<class _CharT, class _Traits, class _Alloc> - basic_string<_CharT, _Traits, _Alloc> - to_string() const - { - basic_string<_CharT, _Traits, _Alloc> __result; - _M_copy_to_string(__result); - return __result; - } - - // Helper functions for string operations. - template<class _CharT, class _Traits, class _Alloc> - void - _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s, - size_t, size_t); - - template<class _CharT, class _Traits, class _Alloc> - void - _M_copy_to_string(basic_string<_CharT,_Traits,_Alloc>&) const; - - /// Returns the number of bits which are set. - size_t - count() const { return this->_M_do_count(); } - - /// Returns the total number of bits. - size_t - size() const { return _Nb; } - - //@{ - /// These comparisons for equality/inequality are, well, @e bitwise. - bool - operator==(const bitset<_Nb>& __rhs) const - { return this->_M_is_equal(__rhs); } - - bool - operator!=(const bitset<_Nb>& __rhs) const - { return !this->_M_is_equal(__rhs); } - //@} - - /** - * @brief Tests the value of a bit. - * @param position The index of a bit. - * @return The value at @a pos. - * @throw std::out_of_range If @a pos is bigger the size of the %set. - */ - bool - test(size_t __position) const - { - if (__position >= _Nb) - __throw_out_of_range(__N("bitset::test")); - return _Unchecked_test(__position); - } - - /** - * @brief Tests whether any of the bits are on. - * @return True if at least one bit is set. - */ - bool - any() const { return this->_M_is_any(); } - - /** - * @brief Tests whether any of the bits are on. - * @return True if none of the bits are set. - */ - bool - none() const { return !this->_M_is_any(); } - - //@{ - /// Self-explanatory. - bitset<_Nb> - operator<<(size_t __position) const - { return bitset<_Nb>(*this) <<= __position; } - - bitset<_Nb> - operator>>(size_t __position) const - { return bitset<_Nb>(*this) >>= __position; } - //@} - - /** - * @brief Finds the index of the first "on" bit. - * @return The index of the first bit set, or size() if not found. - * @ingroup SGIextensions - * @sa _Find_next - */ - size_t - _Find_first() const - { return this->_M_do_find_first(_Nb); } - - /** - * @brief Finds the index of the next "on" bit after prev. - * @return The index of the next bit set, or size() if not found. - * @param prev Where to start searching. - * @ingroup SGIextensions - * @sa _Find_first - */ - size_t - _Find_next(size_t __prev ) const - { return this->_M_do_find_next(__prev, _Nb); } - }; - - // Definitions of non-inline member functions. - template<size_t _Nb> - template<class _CharT, class _Traits, class _Alloc> - void - bitset<_Nb>::_M_copy_from_string(const basic_string<_CharT, _Traits, - _Alloc>& __s, size_t __pos, size_t __n) - { - reset(); - const size_t __nbits = std::min(_Nb, std::min(__n, __s.size() - __pos)); - for (size_t __i = 0; __i < __nbits; ++__i) - { - switch(__s[__pos + __nbits - __i - 1]) - { - case '0': - break; - case '1': - set(__i); - break; - default: - __throw_invalid_argument(__N("bitset::_M_copy_from_string")); - } - } - } - - template<size_t _Nb> - template<class _CharT, class _Traits, class _Alloc> - void - bitset<_Nb>::_M_copy_to_string(basic_string<_CharT, _Traits, - _Alloc>& __s) const - { - __s.assign(_Nb, '0'); - for (size_t __i = 0; __i < _Nb; ++__i) - if (_Unchecked_test(__i)) - __s[_Nb - 1 - __i] = '1'; - } - - // 23.3.5.3 bitset operations: - //@{ - /** - * @brief Global bitwise operations on bitsets. - * @param x A bitset. - * @param y A bitset of the same size as @a x. - * @return A new bitset. - * - * These should be self-explanatory. - */ - template<size_t _Nb> - inline bitset<_Nb> - operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) - { - bitset<_Nb> __result(__x); - __result &= __y; - return __result; - } - - template<size_t _Nb> - inline bitset<_Nb> - operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) - { - bitset<_Nb> __result(__x); - __result |= __y; - return __result; - } - - template <size_t _Nb> - inline bitset<_Nb> - operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) - { - bitset<_Nb> __result(__x); - __result ^= __y; - return __result; - } - //@} - - //@{ - /** - * @brief Global I/O operators for bitsets. - * - * Direct I/O between streams and bitsets is supported. Output is - * straightforward. Input will skip whitespace, only accept '0' and '1' - * characters, and will only extract as many digits as the %bitset will - * hold. - */ - template<class _CharT, class _Traits, size_t _Nb> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) - { - typedef typename _Traits::char_type char_type; - basic_string<_CharT, _Traits> __tmp; - __tmp.reserve(_Nb); - - ios_base::iostate __state = ios_base::goodbit; - typename basic_istream<_CharT, _Traits>::sentry __sentry(__is); - if (__sentry) - { - try - { - basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf(); - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 303. Bitset input operator underspecified - const char_type __zero = __is.widen('0'); - const char_type __one = __is.widen('1'); - for (size_t __i = 0; __i < _Nb; ++__i) - { - static typename _Traits::int_type __eof = _Traits::eof(); - - typename _Traits::int_type __c1 = __buf->sbumpc(); - if (_Traits::eq_int_type(__c1, __eof)) - { - __state |= ios_base::eofbit; - break; - } - else - { - char_type __c2 = _Traits::to_char_type(__c1); - if (__c2 == __zero) - __tmp.push_back('0'); - else if (__c2 == __one) - __tmp.push_back('1'); - else if (_Traits::eq_int_type(__buf->sputbackc(__c2), - __eof)) - { - __state |= ios_base::failbit; - break; - } - } - } - } - catch(...) - { __is._M_setstate(ios_base::badbit); } - } - - if (__tmp.empty() && _Nb) - __state |= ios_base::failbit; - else - __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb); - if (__state) - __is.setstate(__state); - return __is; - } - - template <class _CharT, class _Traits, size_t _Nb> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x) - { - basic_string<_CharT, _Traits> __tmp; - __x._M_copy_to_string(__tmp); - return __os << __tmp; - } - //@} -} // namespace std - -#undef _GLIBCXX_BITSET_WORDS -#undef _GLIBCXX_BITSET_BITS_PER_WORD - -#ifdef _GLIBCXX_DEBUG -# include <debug/bitset> -#endif - -#endif /* _GLIBCXX_BITSET */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cassert b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cassert deleted file mode 100644 index 9fc1079b82a..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cassert +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 19.2 Assertions -// - -/** @file cassert - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c assert.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -// No include guards on this header... - -#pragma GCC system_header - -#include <assert.h> diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cctype b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cctype deleted file mode 100644 index 65a4214657c..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cctype +++ /dev/null @@ -1,83 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: <ccytpe> -// - -/** @file cctype - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c ctype.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CCTYPE -#define _GLIBCXX_CCTYPE 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <ctype.h> - -// Get rid of those macros defined in <ctype.h> in lieu of real functions. -#undef isalnum -#undef isalpha -#undef iscntrl -#undef isdigit -#undef isgraph -#undef islower -#undef isprint -#undef ispunct -#undef isspace -#undef isupper -#undef isxdigit -#undef tolower -#undef toupper - -namespace std -{ - using ::isalnum; - using ::isalpha; - using ::iscntrl; - using ::isdigit; - using ::isgraph; - using ::islower; - using ::isprint; - using ::ispunct; - using ::isspace; - using ::isupper; - using ::isxdigit; - using ::tolower; - using ::toupper; -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cerrno b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cerrno deleted file mode 100644 index 7915e14ba27..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cerrno +++ /dev/null @@ -1,55 +0,0 @@ -// The -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 19.3 Error numbers -// - -/** @file cerrno - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c errno.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CERRNO -#define _GLIBCXX_CERRNO 1 - -#pragma GCC system_header - -#include <errno.h> - -// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 -#ifndef errno -#define errno errno -#endif - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cfloat b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cfloat deleted file mode 100644 index 4c5bb00f204..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cfloat +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 18.2.2 Implementation properties: C library -// - -/** @file cfloat - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c float.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CFLOAT -#define _GLIBCXX_CFLOAT 1 - -#pragma GCC system_header - -#include <float.h> - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ciso646 b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ciso646 deleted file mode 100644 index 0993a0a7d6f..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ciso646 +++ /dev/null @@ -1,37 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file ciso646 - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c iso646.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/climits b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/climits deleted file mode 100644 index f4e1d8f77fa..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/climits +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2002 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 18.2.2 Implementation properties: C library -// - -/** @file climits - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c limits.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CLIMITS -#define _GLIBCXX_CLIMITS 1 - -#pragma GCC system_header - -#include <limits.h> - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/clocale b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/clocale deleted file mode 100644 index 988b84924af..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/clocale +++ /dev/null @@ -1,62 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 18.2.2 Implementation properties: C library -// - -/** @file clocale - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c locale.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CLOCALE -#define _GLIBCXX_CLOCALE 1 - -#pragma GCC system_header - -#include <locale.h> - -// Get rid of those macros defined in <locale.h> in lieu of real functions. -#undef setlocale -#undef localeconv - -namespace std -{ - using ::lconv; - using ::setlocale; - using ::localeconv; -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cmath b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cmath deleted file mode 100644 index 66866b2cc3a..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cmath +++ /dev/null @@ -1,595 +0,0 @@ -// -*- C++ -*- C forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 26.5 C library -// - -/** @file cmath - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c math.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CMATH -#define _GLIBCXX_CMATH 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/cpp_type_traits.h> - -#include <math.h> - -// Get rid of those macros defined in <math.h> in lieu of real functions. -#undef abs -#undef div -#undef acos -#undef asin -#undef atan -#undef atan2 -#undef ceil -#undef cos -#undef cosh -#undef exp -#undef fabs -#undef floor -#undef fmod -#undef frexp -#undef ldexp -#undef log -#undef log10 -#undef modf -#undef pow -#undef sin -#undef sinh -#undef sqrt -#undef tan -#undef tanh - - -namespace std -{ - // Forward declaration of a helper function. This really should be - // an `exported' forward declaration. - template<typename _Tp> _Tp __cmath_power(_Tp, unsigned int); - - inline double - abs(double __x) - { return __builtin_fabs(__x); } - - inline float - abs(float __x) - { return __builtin_fabsf(__x); } - - inline long double - abs(long double __x) - { return __builtin_fabsl(__x); } - - using ::acos; - - inline float - acos(float __x) - { return __builtin_acosf(__x); } - - inline long double - acos(long double __x) - { return __builtin_acosl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - acos(_Tp __x) - { - return __builtin_acos(__x); - } - - using ::asin; - - inline float - asin(float __x) - { return __builtin_asinf(__x); } - - inline long double - asin(long double __x) - { return __builtin_asinl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - asin(_Tp __x) - { return __builtin_asin(__x); } - - using ::atan; - - inline float - atan(float __x) - { return __builtin_atanf(__x); } - - inline long double - atan(long double __x) - { return __builtin_atanl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - atan(_Tp __x) - { return __builtin_atan(__x); } - - using ::atan2; - - inline float - atan2(float __y, float __x) - { return __builtin_atan2f(__y, __x); } - - inline long double - atan2(long double __y, long double __x) - { return __builtin_atan2l(__y, __x); } - - template<typename _Tp, typename _Up> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type - && __is_integer<_Up>::_M_type>::_M_type - atan2(_Tp __y, _Up __x) - { return __builtin_atan2(__y, __x); } - - using ::ceil; - - inline float - ceil(float __x) - { return __builtin_ceilf(__x); } - - inline long double - ceil(long double __x) - { return __builtin_ceill(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - ceil(_Tp __x) - { return __builtin_ceil(__x); } - - using ::cos; - - inline float - cos(float __x) - { return __builtin_cosf(__x); } - - inline long double - cos(long double __x) - { return __builtin_cosl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - cos(_Tp __x) - { return __builtin_cos(__x); } - - using ::cosh; - - inline float - cosh(float __x) - { return __builtin_coshf(__x); } - - inline long double - cosh(long double __x) - { return __builtin_coshl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - cosh(_Tp __x) - { return __builtin_cosh(__x); } - - using ::exp; - - inline float - exp(float __x) - { return __builtin_expf(__x); } - - inline long double - exp(long double __x) - { return __builtin_expl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - exp(_Tp __x) - { return __builtin_exp(__x); } - - using ::fabs; - - inline float - fabs(float __x) - { return __builtin_fabsf(__x); } - - inline long double - fabs(long double __x) - { return __builtin_fabsl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - fabs(_Tp __x) - { return __builtin_fabs(__x); } - - using ::floor; - - inline float - floor(float __x) - { return __builtin_floorf(__x); } - - inline long double - floor(long double __x) - { return __builtin_floorl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - floor(_Tp __x) - { return __builtin_floor(__x); } - - using ::fmod; - - inline float - fmod(float __x, float __y) - { return __builtin_fmodf(__x, __y); } - - inline long double - fmod(long double __x, long double __y) - { return __builtin_fmodl(__x, __y); } - - using ::frexp; - - inline float - frexp(float __x, int* __exp) - { return __builtin_frexpf(__x, __exp); } - - inline long double - frexp(long double __x, int* __exp) - { return __builtin_frexpl(__x, __exp); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - frexp(_Tp __x, int* __exp) - { return __builtin_frexp(__x, __exp); } - - using ::ldexp; - - inline float - ldexp(float __x, int __exp) - { return __builtin_ldexpf(__x, __exp); } - - inline long double - ldexp(long double __x, int __exp) - { return __builtin_ldexpl(__x, __exp); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - ldexp(_Tp __x, int __exp) - { return __builtin_ldexp(__x, __exp); } - - using ::log; - - inline float - log(float __x) - { return __builtin_logf(__x); } - - inline long double - log(long double __x) - { return __builtin_logl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - log(_Tp __x) - { return __builtin_log(__x); } - - using ::log10; - - inline float - log10(float __x) - { return __builtin_log10f(__x); } - - inline long double - log10(long double __x) - { return __builtin_log10l(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - log10(_Tp __x) - { return __builtin_log10(__x); } - - using ::modf; - - inline float - modf(float __x, float* __iptr) - { return __builtin_modff(__x, __iptr); } - - inline long double - modf(long double __x, long double* __iptr) - { return __builtin_modfl(__x, __iptr); } - - template<typename _Tp> - inline _Tp - __pow_helper(_Tp __x, int __n) - { - return __n < 0 - ? _Tp(1)/__cmath_power(__x, -__n) - : __cmath_power(__x, __n); - } - - using ::pow; - - inline float - pow(float __x, float __y) - { return __builtin_powf(__x, __y); } - - inline long double - pow(long double __x, long double __y) - { return __builtin_powl(__x, __y); } - - inline double - pow(double __x, int __i) - { return __pow_helper(__x, __i); } - - inline float - pow(float __x, int __n) - { return __pow_helper(__x, __n); } - - inline long double - pow(long double __x, int __n) - { return __pow_helper(__x, __n); } - - using ::sin; - - inline float - sin(float __x) - { return __builtin_sinf(__x); } - - inline long double - sin(long double __x) - { return __builtin_sinl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - sin(_Tp __x) - { return __builtin_sin(__x); } - - using ::sinh; - - inline float - sinh(float __x) - { return __builtin_sinhf(__x); } - - inline long double - sinh(long double __x) - { return __builtin_sinhl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - sinh(_Tp __x) - { return __builtin_sinh(__x); } - - using ::sqrt; - - inline float - sqrt(float __x) - { return __builtin_sqrtf(__x); } - - inline long double - sqrt(long double __x) - { return __builtin_sqrtl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - sqrt(_Tp __x) - { return __builtin_sqrt(__x); } - - using ::tan; - - inline float - tan(float __x) - { return __builtin_tanf(__x); } - - inline long double - tan(long double __x) - { return __builtin_tanl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - tan(_Tp __x) - { return __builtin_tan(__x); } - - using ::tanh; - - inline float - tanh(float __x) - { return __builtin_tanhf(__x); } - - inline long double - tanh(long double __x) - { return __builtin_tanhl(__x); } - - template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type - tanh(_Tp __x) - { return __builtin_tanh(__x); } -} - -#if _GLIBCXX_USE_C99_MATH -#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC -// These are possible macros imported from C99-land. For strict -// conformance, remove possible C99-injected names from the global -// namespace, and sequester them in the __gnu_cxx extension namespace. -namespace __gnu_cxx -{ - template<typename _Tp> - int - __capture_fpclassify(_Tp __f) { return fpclassify(__f); } - - template<typename _Tp> - int - __capture_isfinite(_Tp __f) { return isfinite(__f); } - - template<typename _Tp> - int - __capture_isinf(_Tp __f) { return isinf(__f); } - - template<typename _Tp> - int - __capture_isnan(_Tp __f) { return isnan(__f); } - - template<typename _Tp> - int - __capture_isnormal(_Tp __f) { return isnormal(__f); } - - template<typename _Tp> - int - __capture_signbit(_Tp __f) { return signbit(__f); } - - template<typename _Tp> - int - __capture_isgreater(_Tp __f1, _Tp __f2) - { return isgreater(__f1, __f2); } - - template<typename _Tp> - int - __capture_isgreaterequal(_Tp __f1, _Tp __f2) - { return isgreaterequal(__f1, __f2); } - - template<typename _Tp> - int - __capture_isless(_Tp __f1, _Tp __f2) { return isless(__f1, __f2); } - - template<typename _Tp> - int - __capture_islessequal(_Tp __f1, _Tp __f2) - { return islessequal(__f1, __f2); } - - template<typename _Tp> - int - __capture_islessgreater(_Tp __f1, _Tp __f2) - { return islessgreater(__f1, __f2); } - - template<typename _Tp> - int - __capture_isunordered(_Tp __f1, _Tp __f2) - { return isunordered(__f1, __f2); } -} - -// Only undefine the C99 FP macros, if actually captured for namespace movement -#undef fpclassify -#undef isfinite -#undef isinf -#undef isnan -#undef isnormal -#undef signbit -#undef isgreater -#undef isgreaterequal -#undef isless -#undef islessequal -#undef islessgreater -#undef isunordered -#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ -#endif - -#if _GLIBCXX_USE_C99_MATH -#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC -namespace __gnu_cxx -{ - template<typename _Tp> - int - fpclassify(_Tp __f) { return __capture_fpclassify(__f); } - - template<typename _Tp> - int - isfinite(_Tp __f) { return __capture_isfinite(__f); } - - template<typename _Tp> - int - isinf(_Tp __f) { return __capture_isinf(__f); } - - template<typename _Tp> - int - isnan(_Tp __f) { return __capture_isnan(__f); } - - template<typename _Tp> - int - isnormal(_Tp __f) { return __capture_isnormal(__f); } - - template<typename _Tp> - int - signbit(_Tp __f) { return __capture_signbit(__f); } - - template<typename _Tp> - int - isgreater(_Tp __f1, _Tp __f2) { return __capture_isgreater(__f1, __f2); } - - template<typename _Tp> - int - isgreaterequal(_Tp __f1, _Tp __f2) - { return __capture_isgreaterequal(__f1, __f2); } - - template<typename _Tp> - int - isless(_Tp __f1, _Tp __f2) { return __capture_isless(__f1, __f2); } - - template<typename _Tp> - int - islessequal(_Tp __f1, _Tp __f2) - { return __capture_islessequal(__f1, __f2); } - - template<typename _Tp> - int - islessgreater(_Tp __f1, _Tp __f2) - { return __capture_islessgreater(__f1, __f2); } - - template<typename _Tp> - int - isunordered(_Tp __f1, _Tp __f2) - { return __capture_isunordered(__f1, __f2); } -} - -namespace std -{ - using __gnu_cxx::fpclassify; - using __gnu_cxx::isfinite; - using __gnu_cxx::isinf; - using __gnu_cxx::isnan; - using __gnu_cxx::isnormal; - using __gnu_cxx::signbit; - using __gnu_cxx::isgreater; - using __gnu_cxx::isgreaterequal; - using __gnu_cxx::isless; - using __gnu_cxx::islessequal; - using __gnu_cxx::islessgreater; - using __gnu_cxx::isunordered; -} -#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ -#endif - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/cmath.tcc> -#endif - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/complex b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/complex deleted file mode 100644 index 244ed284f69..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/complex +++ /dev/null @@ -1,1226 +0,0 @@ -// The template and inlines for the -*- C++ -*- complex number classes. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 26.2 Complex Numbers -// Note: this is not a conforming implementation. -// Initially implemented by Ulrich Drepper <drepper@cygnus.com> -// Improved by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr> -// - -/** @file complex - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_COMPLEX -#define _GLIBCXX_COMPLEX 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/cpp_type_traits.h> -#include <cmath> -#include <sstream> - -namespace std -{ - // Forward declarations - template<typename _Tp> class complex; - template<> class complex<float>; - template<> class complex<double>; - template<> class complex<long double>; - - /// Return magnitude of @a z. - template<typename _Tp> _Tp abs(const complex<_Tp>&); - /// Return phase angle of @a z. - template<typename _Tp> _Tp arg(const complex<_Tp>&); - /// Return @a z magnitude squared. - template<typename _Tp> _Tp norm(const complex<_Tp>&); - - /// Return complex conjugate of @a z. - template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&); - /// Return complex with magnitude @a rho and angle @a theta. - template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp& = 0); - - // Transcendentals: - /// Return complex cosine of @a z. - template<typename _Tp> complex<_Tp> cos(const complex<_Tp>&); - /// Return complex hyperbolic cosine of @a z. - template<typename _Tp> complex<_Tp> cosh(const complex<_Tp>&); - /// Return complex base e exponential of @a z. - template<typename _Tp> complex<_Tp> exp(const complex<_Tp>&); - /// Return complex natural logarithm of @a z. - template<typename _Tp> complex<_Tp> log(const complex<_Tp>&); - /// Return complex base 10 logarithm of @a z. - template<typename _Tp> complex<_Tp> log10(const complex<_Tp>&); - /// Return complex cosine of @a z. - template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, int); - /// Return @a x to the @a y'th power. - template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, const _Tp&); - /// Return @a x to the @a y'th power. - template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, - const complex<_Tp>&); - /// Return @a x to the @a y'th power. - template<typename _Tp> complex<_Tp> pow(const _Tp&, const complex<_Tp>&); - /// Return complex sine of @a z. - template<typename _Tp> complex<_Tp> sin(const complex<_Tp>&); - /// Return complex hyperbolic sine of @a z. - template<typename _Tp> complex<_Tp> sinh(const complex<_Tp>&); - /// Return complex square root of @a z. - template<typename _Tp> complex<_Tp> sqrt(const complex<_Tp>&); - /// Return complex tangent of @a z. - template<typename _Tp> complex<_Tp> tan(const complex<_Tp>&); - /// Return complex hyperbolic tangent of @a z. - template<typename _Tp> complex<_Tp> tanh(const complex<_Tp>&); - //@} - - - // 26.2.2 Primary template class complex - /** - * Template to represent complex numbers. - * - * Specializations for float, double, and long double are part of the - * library. Results with any other type are not guaranteed. - * - * @param Tp Type of real and imaginary values. - */ - template<typename _Tp> - class complex - { - public: - /// Value typedef. - typedef _Tp value_type; - - /// Default constructor. First parameter is x, second parameter is y. - /// Unspecified parameters default to 0. - complex(const _Tp& = _Tp(), const _Tp & = _Tp()); - - // Lets the compiler synthesize the copy constructor - // complex (const complex<_Tp>&); - /// Copy constructor. - template<typename _Up> - complex(const complex<_Up>&); - - /// Return real part of complex number. - _Tp& real(); - /// Return real part of complex number. - const _Tp& real() const; - /// Return imaginary part of complex number. - _Tp& imag(); - /// Return imaginary part of complex number. - const _Tp& imag() const; - - /// Assign this complex number to scalar @a t. - complex<_Tp>& operator=(const _Tp&); - /// Add @a t to this complex number. - complex<_Tp>& operator+=(const _Tp&); - /// Subtract @a t from this complex number. - complex<_Tp>& operator-=(const _Tp&); - /// Multiply this complex number by @a t. - complex<_Tp>& operator*=(const _Tp&); - /// Divide this complex number by @a t. - complex<_Tp>& operator/=(const _Tp&); - - // Lets the compiler synthesize the - // copy and assignment operator - // complex<_Tp>& operator= (const complex<_Tp>&); - /// Assign this complex number to complex @a z. - template<typename _Up> - complex<_Tp>& operator=(const complex<_Up>&); - /// Add @a z to this complex number. - template<typename _Up> - complex<_Tp>& operator+=(const complex<_Up>&); - /// Subtract @a z from this complex number. - template<typename _Up> - complex<_Tp>& operator-=(const complex<_Up>&); - /// Multiply this complex number by @a z. - template<typename _Up> - complex<_Tp>& operator*=(const complex<_Up>&); - /// Divide this complex number by @a z. - template<typename _Up> - complex<_Tp>& operator/=(const complex<_Up>&); - - private: - _Tp _M_real; - _Tp _M_imag; - }; - - template<typename _Tp> - inline _Tp& - complex<_Tp>::real() { return _M_real; } - - template<typename _Tp> - inline const _Tp& - complex<_Tp>::real() const { return _M_real; } - - template<typename _Tp> - inline _Tp& - complex<_Tp>::imag() { return _M_imag; } - - template<typename _Tp> - inline const _Tp& - complex<_Tp>::imag() const { return _M_imag; } - - template<typename _Tp> - inline - complex<_Tp>::complex(const _Tp& __r, const _Tp& __i) - : _M_real(__r), _M_imag(__i) { } - - template<typename _Tp> - template<typename _Up> - inline - complex<_Tp>::complex(const complex<_Up>& __z) - : _M_real(__z.real()), _M_imag(__z.imag()) { } - - template<typename _Tp> - complex<_Tp>& - complex<_Tp>::operator=(const _Tp& __t) - { - _M_real = __t; - _M_imag = _Tp(); - return *this; - } - - // 26.2.5/1 - template<typename _Tp> - inline complex<_Tp>& - complex<_Tp>::operator+=(const _Tp& __t) - { - _M_real += __t; - return *this; - } - - // 26.2.5/3 - template<typename _Tp> - inline complex<_Tp>& - complex<_Tp>::operator-=(const _Tp& __t) - { - _M_real -= __t; - return *this; - } - - // 26.2.5/5 - template<typename _Tp> - complex<_Tp>& - complex<_Tp>::operator*=(const _Tp& __t) - { - _M_real *= __t; - _M_imag *= __t; - return *this; - } - - // 26.2.5/7 - template<typename _Tp> - complex<_Tp>& - complex<_Tp>::operator/=(const _Tp& __t) - { - _M_real /= __t; - _M_imag /= __t; - return *this; - } - - template<typename _Tp> - template<typename _Up> - complex<_Tp>& - complex<_Tp>::operator=(const complex<_Up>& __z) - { - _M_real = __z.real(); - _M_imag = __z.imag(); - return *this; - } - - // 26.2.5/9 - template<typename _Tp> - template<typename _Up> - complex<_Tp>& - complex<_Tp>::operator+=(const complex<_Up>& __z) - { - _M_real += __z.real(); - _M_imag += __z.imag(); - return *this; - } - - // 26.2.5/11 - template<typename _Tp> - template<typename _Up> - complex<_Tp>& - complex<_Tp>::operator-=(const complex<_Up>& __z) - { - _M_real -= __z.real(); - _M_imag -= __z.imag(); - return *this; - } - - // 26.2.5/13 - // XXX: This is a grammar school implementation. - template<typename _Tp> - template<typename _Up> - complex<_Tp>& - complex<_Tp>::operator*=(const complex<_Up>& __z) - { - const _Tp __r = _M_real * __z.real() - _M_imag * __z.imag(); - _M_imag = _M_real * __z.imag() + _M_imag * __z.real(); - _M_real = __r; - return *this; - } - - // 26.2.5/15 - // XXX: This is a grammar school implementation. - template<typename _Tp> - template<typename _Up> - complex<_Tp>& - complex<_Tp>::operator/=(const complex<_Up>& __z) - { - const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag(); - const _Tp __n = std::norm(__z); - _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n; - _M_real = __r / __n; - return *this; - } - - // Operators: - //@{ - /// Return new complex value @a x plus @a y. - template<typename _Tp> - inline complex<_Tp> - operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) - { - complex<_Tp> __r = __x; - __r += __y; - return __r; - } - - template<typename _Tp> - inline complex<_Tp> - operator+(const complex<_Tp>& __x, const _Tp& __y) - { - complex<_Tp> __r = __x; - __r.real() += __y; - return __r; - } - - template<typename _Tp> - inline complex<_Tp> - operator+(const _Tp& __x, const complex<_Tp>& __y) - { - complex<_Tp> __r = __y; - __r.real() += __x; - return __r; - } - //@} - - //@{ - /// Return new complex value @a x minus @a y. - template<typename _Tp> - inline complex<_Tp> - operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) - { - complex<_Tp> __r = __x; - __r -= __y; - return __r; - } - - template<typename _Tp> - inline complex<_Tp> - operator-(const complex<_Tp>& __x, const _Tp& __y) - { - complex<_Tp> __r = __x; - __r.real() -= __y; - return __r; - } - - template<typename _Tp> - inline complex<_Tp> - operator-(const _Tp& __x, const complex<_Tp>& __y) - { - complex<_Tp> __r(__x, -__y.imag()); - __r.real() -= __y.real(); - return __r; - } - //@} - - //@{ - /// Return new complex value @a x times @a y. - template<typename _Tp> - inline complex<_Tp> - operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) - { - complex<_Tp> __r = __x; - __r *= __y; - return __r; - } - - template<typename _Tp> - inline complex<_Tp> - operator*(const complex<_Tp>& __x, const _Tp& __y) - { - complex<_Tp> __r = __x; - __r *= __y; - return __r; - } - - template<typename _Tp> - inline complex<_Tp> - operator*(const _Tp& __x, const complex<_Tp>& __y) - { - complex<_Tp> __r = __y; - __r *= __x; - return __r; - } - //@} - - //@{ - /// Return new complex value @a x divided by @a y. - template<typename _Tp> - inline complex<_Tp> - operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) - { - complex<_Tp> __r = __x; - __r /= __y; - return __r; - } - - template<typename _Tp> - inline complex<_Tp> - operator/(const complex<_Tp>& __x, const _Tp& __y) - { - complex<_Tp> __r = __x; - __r /= __y; - return __r; - } - - template<typename _Tp> - inline complex<_Tp> - operator/(const _Tp& __x, const complex<_Tp>& __y) - { - complex<_Tp> __r = __x; - __r /= __y; - return __r; - } - //@} - - /// Return @a x. - template<typename _Tp> - inline complex<_Tp> - operator+(const complex<_Tp>& __x) - { return __x; } - - /// Return complex negation of @a x. - template<typename _Tp> - inline complex<_Tp> - operator-(const complex<_Tp>& __x) - { return complex<_Tp>(-__x.real(), -__x.imag()); } - - //@{ - /// Return true if @a x is equal to @a y. - template<typename _Tp> - inline bool - operator==(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return __x.real() == __y.real() && __x.imag() == __y.imag(); } - - template<typename _Tp> - inline bool - operator==(const complex<_Tp>& __x, const _Tp& __y) - { return __x.real() == __y && __x.imag() == _Tp(); } - - template<typename _Tp> - inline bool - operator==(const _Tp& __x, const complex<_Tp>& __y) - { return __x == __y.real() && _Tp() == __y.imag(); } - //@} - - //@{ - /// Return false if @a x is equal to @a y. - template<typename _Tp> - inline bool - operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return __x.real() != __y.real() || __x.imag() != __y.imag(); } - - template<typename _Tp> - inline bool - operator!=(const complex<_Tp>& __x, const _Tp& __y) - { return __x.real() != __y || __x.imag() != _Tp(); } - - template<typename _Tp> - inline bool - operator!=(const _Tp& __x, const complex<_Tp>& __y) - { return __x != __y.real() || _Tp() != __y.imag(); } - //@} - - /// Extraction operator for complex values. - template<typename _Tp, typename _CharT, class _Traits> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) - { - _Tp __re_x, __im_x; - _CharT __ch; - __is >> __ch; - if (__ch == '(') - { - __is >> __re_x >> __ch; - if (__ch == ',') - { - __is >> __im_x >> __ch; - if (__ch == ')') - __x = complex<_Tp>(__re_x, __im_x); - else - __is.setstate(ios_base::failbit); - } - else if (__ch == ')') - __x = __re_x; - else - __is.setstate(ios_base::failbit); - } - else - { - __is.putback(__ch); - __is >> __re_x; - __x = __re_x; - } - return __is; - } - - /// Insertion operator for complex values. - template<typename _Tp, typename _CharT, class _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x) - { - basic_ostringstream<_CharT, _Traits> __s; - __s.flags(__os.flags()); - __s.imbue(__os.getloc()); - __s.precision(__os.precision()); - __s << '(' << __x.real() << ',' << __x.imag() << ')'; - return __os << __s.str(); - } - - // Values - template<typename _Tp> - inline _Tp& - real(complex<_Tp>& __z) - { return __z.real(); } - - template<typename _Tp> - inline const _Tp& - real(const complex<_Tp>& __z) - { return __z.real(); } - - template<typename _Tp> - inline _Tp& - imag(complex<_Tp>& __z) - { return __z.imag(); } - - template<typename _Tp> - inline const _Tp& - imag(const complex<_Tp>& __z) - { return __z.imag(); } - - template<typename _Tp> - inline _Tp - abs(const complex<_Tp>& __z) - { - _Tp __x = __z.real(); - _Tp __y = __z.imag(); - const _Tp __s = std::max(abs(__x), abs(__y)); - if (__s == _Tp()) // well ... - return __s; - __x /= __s; - __y /= __s; - return __s * sqrt(__x * __x + __y * __y); - } - - template<typename _Tp> - inline _Tp - arg(const complex<_Tp>& __z) - { return atan2(__z.imag(), __z.real()); } - - // 26.2.7/5: norm(__z) returns the squared magintude of __z. - // As defined, norm() is -not- a norm is the common mathematical - // sens used in numerics. The helper class _Norm_helper<> tries to - // distinguish between builtin floating point and the rest, so as - // to deliver an answer as close as possible to the real value. - template<bool> - struct _Norm_helper - { - template<typename _Tp> - static inline _Tp _S_do_it(const complex<_Tp>& __z) - { - const _Tp __x = __z.real(); - const _Tp __y = __z.imag(); - return __x * __x + __y * __y; - } - }; - - template<> - struct _Norm_helper<true> - { - template<typename _Tp> - static inline _Tp _S_do_it(const complex<_Tp>& __z) - { - _Tp __res = std::abs(__z); - return __res * __res; - } - }; - - template<typename _Tp> - inline _Tp - norm(const complex<_Tp>& __z) - { - return _Norm_helper<__is_floating<_Tp>::_M_type && !_GLIBCXX_FAST_MATH>::_S_do_it(__z); - } - - template<typename _Tp> - inline complex<_Tp> - polar(const _Tp& __rho, const _Tp& __theta) - { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); } - - template<typename _Tp> - inline complex<_Tp> - conj(const complex<_Tp>& __z) - { return complex<_Tp>(__z.real(), -__z.imag()); } - - // Transcendentals - template<typename _Tp> - inline complex<_Tp> - cos(const complex<_Tp>& __z) - { - const _Tp __x = __z.real(); - const _Tp __y = __z.imag(); - return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y)); - } - - template<typename _Tp> - inline complex<_Tp> - cosh(const complex<_Tp>& __z) - { - const _Tp __x = __z.real(); - const _Tp __y = __z.imag(); - return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y)); - } - - template<typename _Tp> - inline complex<_Tp> - exp(const complex<_Tp>& __z) - { return std::polar(exp(__z.real()), __z.imag()); } - - template<typename _Tp> - inline complex<_Tp> - log(const complex<_Tp>& __z) - { return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); } - - template<typename _Tp> - inline complex<_Tp> - log10(const complex<_Tp>& __z) - { return std::log(__z) / log(_Tp(10.0)); } - - template<typename _Tp> - inline complex<_Tp> - sin(const complex<_Tp>& __z) - { - const _Tp __x = __z.real(); - const _Tp __y = __z.imag(); - return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y)); - } - - template<typename _Tp> - inline complex<_Tp> - sinh(const complex<_Tp>& __z) - { - const _Tp __x = __z.real(); - const _Tp __y = __z.imag(); - return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y)); - } - - template<typename _Tp> - complex<_Tp> - sqrt(const complex<_Tp>& __z) - { - _Tp __x = __z.real(); - _Tp __y = __z.imag(); - - if (__x == _Tp()) - { - _Tp __t = sqrt(abs(__y) / 2); - return complex<_Tp>(__t, __y < _Tp() ? -__t : __t); - } - else - { - _Tp __t = sqrt(2 * (std::abs(__z) + abs(__x))); - _Tp __u = __t / 2; - return __x > _Tp() - ? complex<_Tp>(__u, __y / __t) - : complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u); - } - } - - template<typename _Tp> - inline complex<_Tp> - tan(const complex<_Tp>& __z) - { - return std::sin(__z) / std::cos(__z); - } - - template<typename _Tp> - inline complex<_Tp> - tanh(const complex<_Tp>& __z) - { - return std::sinh(__z) / std::cosh(__z); - } - - template<typename _Tp> - inline complex<_Tp> - pow(const complex<_Tp>& __z, int __n) - { - return std::__pow_helper(__z, __n); - } - - template<typename _Tp> - complex<_Tp> - pow(const complex<_Tp>& __x, const _Tp& __y) - { - if (__x.imag() == _Tp() && __x.real() > _Tp()) - return pow(__x.real(), __y); - - complex<_Tp> __t = std::log(__x); - return std::polar(exp(__y * __t.real()), __y * __t.imag()); - } - - template<typename _Tp> - inline complex<_Tp> - pow(const complex<_Tp>& __x, const complex<_Tp>& __y) - { - return __x == _Tp() ? _Tp() : std::exp(__y * std::log(__x)); - } - - template<typename _Tp> - inline complex<_Tp> - pow(const _Tp& __x, const complex<_Tp>& __y) - { - return __x > _Tp() ? std::polar(pow(__x, __y.real()), - __y.imag() * log(__x)) - : std::pow(complex<_Tp>(__x, _Tp()), __y); - } - - // 26.2.3 complex specializations - // complex<float> specialization - template<> class complex<float> - { - public: - typedef float value_type; - - complex(float = 0.0f, float = 0.0f); - - explicit complex(const complex<double>&); - explicit complex(const complex<long double>&); - - float& real(); - const float& real() const; - float& imag(); - const float& imag() const; - - complex<float>& operator=(float); - complex<float>& operator+=(float); - complex<float>& operator-=(float); - complex<float>& operator*=(float); - complex<float>& operator/=(float); - - // Let's the compiler synthetize the copy and assignment - // operator. It always does a pretty good job. - // complex& operator= (const complex&); - template<typename _Tp> - complex<float>&operator=(const complex<_Tp>&); - template<typename _Tp> - complex<float>& operator+=(const complex<_Tp>&); - template<class _Tp> - complex<float>& operator-=(const complex<_Tp>&); - template<class _Tp> - complex<float>& operator*=(const complex<_Tp>&); - template<class _Tp> - complex<float>&operator/=(const complex<_Tp>&); - - private: - typedef __complex__ float _ComplexT; - _ComplexT _M_value; - - complex(_ComplexT __z) : _M_value(__z) { } - - friend class complex<double>; - friend class complex<long double>; - }; - - inline float& - complex<float>::real() - { return __real__ _M_value; } - - inline const float& - complex<float>::real() const - { return __real__ _M_value; } - - inline float& - complex<float>::imag() - { return __imag__ _M_value; } - - inline const float& - complex<float>::imag() const - { return __imag__ _M_value; } - - inline - complex<float>::complex(float r, float i) - { - __real__ _M_value = r; - __imag__ _M_value = i; - } - - inline complex<float>& - complex<float>::operator=(float __f) - { - __real__ _M_value = __f; - __imag__ _M_value = 0.0f; - return *this; - } - - inline complex<float>& - complex<float>::operator+=(float __f) - { - __real__ _M_value += __f; - return *this; - } - - inline complex<float>& - complex<float>::operator-=(float __f) - { - __real__ _M_value -= __f; - return *this; - } - - inline complex<float>& - complex<float>::operator*=(float __f) - { - _M_value *= __f; - return *this; - } - - inline complex<float>& - complex<float>::operator/=(float __f) - { - _M_value /= __f; - return *this; - } - - template<typename _Tp> - inline complex<float>& - complex<float>::operator=(const complex<_Tp>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<float>& - complex<float>::operator+=(const complex<_Tp>& __z) - { - __real__ _M_value += __z.real(); - __imag__ _M_value += __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<float>& - complex<float>::operator-=(const complex<_Tp>& __z) - { - __real__ _M_value -= __z.real(); - __imag__ _M_value -= __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<float>& - complex<float>::operator*=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value *= __t; - return *this; - } - - template<typename _Tp> - inline complex<float>& - complex<float>::operator/=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value /= __t; - return *this; - } - - // 26.2.3 complex specializations - // complex<double> specialization - template<> class complex<double> - { - public: - typedef double value_type; - - complex(double = 0.0, double = 0.0); - - complex(const complex<float>&); - explicit complex(const complex<long double>&); - - double& real(); - const double& real() const; - double& imag(); - const double& imag() const; - - complex<double>& operator=(double); - complex<double>& operator+=(double); - complex<double>& operator-=(double); - complex<double>& operator*=(double); - complex<double>& operator/=(double); - - // The compiler will synthetize this, efficiently. - // complex& operator= (const complex&); - template<typename _Tp> - complex<double>& operator=(const complex<_Tp>&); - template<typename _Tp> - complex<double>& operator+=(const complex<_Tp>&); - template<typename _Tp> - complex<double>& operator-=(const complex<_Tp>&); - template<typename _Tp> - complex<double>& operator*=(const complex<_Tp>&); - template<typename _Tp> - complex<double>& operator/=(const complex<_Tp>&); - - private: - typedef __complex__ double _ComplexT; - _ComplexT _M_value; - - complex(_ComplexT __z) : _M_value(__z) { } - - friend class complex<float>; - friend class complex<long double>; - }; - - inline double& - complex<double>::real() - { return __real__ _M_value; } - - inline const double& - complex<double>::real() const - { return __real__ _M_value; } - - inline double& - complex<double>::imag() - { return __imag__ _M_value; } - - inline const double& - complex<double>::imag() const - { return __imag__ _M_value; } - - inline - complex<double>::complex(double __r, double __i) - { - __real__ _M_value = __r; - __imag__ _M_value = __i; - } - - inline complex<double>& - complex<double>::operator=(double __d) - { - __real__ _M_value = __d; - __imag__ _M_value = 0.0; - return *this; - } - - inline complex<double>& - complex<double>::operator+=(double __d) - { - __real__ _M_value += __d; - return *this; - } - - inline complex<double>& - complex<double>::operator-=(double __d) - { - __real__ _M_value -= __d; - return *this; - } - - inline complex<double>& - complex<double>::operator*=(double __d) - { - _M_value *= __d; - return *this; - } - - inline complex<double>& - complex<double>::operator/=(double __d) - { - _M_value /= __d; - return *this; - } - - template<typename _Tp> - inline complex<double>& - complex<double>::operator=(const complex<_Tp>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<double>& - complex<double>::operator+=(const complex<_Tp>& __z) - { - __real__ _M_value += __z.real(); - __imag__ _M_value += __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<double>& - complex<double>::operator-=(const complex<_Tp>& __z) - { - __real__ _M_value -= __z.real(); - __imag__ _M_value -= __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<double>& - complex<double>::operator*=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value *= __t; - return *this; - } - - template<typename _Tp> - inline complex<double>& - complex<double>::operator/=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value /= __t; - return *this; - } - - // 26.2.3 complex specializations - // complex<long double> specialization - template<> class complex<long double> - { - public: - typedef long double value_type; - - complex(long double = 0.0L, long double = 0.0L); - - complex(const complex<float>&); - complex(const complex<double>&); - - long double& real(); - const long double& real() const; - long double& imag(); - const long double& imag() const; - - complex<long double>& operator= (long double); - complex<long double>& operator+= (long double); - complex<long double>& operator-= (long double); - complex<long double>& operator*= (long double); - complex<long double>& operator/= (long double); - - // The compiler knows how to do this efficiently - // complex& operator= (const complex&); - template<typename _Tp> - complex<long double>& operator=(const complex<_Tp>&); - template<typename _Tp> - complex<long double>& operator+=(const complex<_Tp>&); - template<typename _Tp> - complex<long double>& operator-=(const complex<_Tp>&); - template<typename _Tp> - complex<long double>& operator*=(const complex<_Tp>&); - template<typename _Tp> - complex<long double>& operator/=(const complex<_Tp>&); - - private: - typedef __complex__ long double _ComplexT; - _ComplexT _M_value; - - complex(_ComplexT __z) : _M_value(__z) { } - - friend class complex<float>; - friend class complex<double>; - }; - - inline - complex<long double>::complex(long double __r, long double __i) - { - __real__ _M_value = __r; - __imag__ _M_value = __i; - } - - inline long double& - complex<long double>::real() - { return __real__ _M_value; } - - inline const long double& - complex<long double>::real() const - { return __real__ _M_value; } - - inline long double& - complex<long double>::imag() - { return __imag__ _M_value; } - - inline const long double& - complex<long double>::imag() const - { return __imag__ _M_value; } - - inline complex<long double>& - complex<long double>::operator=(long double __r) - { - __real__ _M_value = __r; - __imag__ _M_value = 0.0L; - return *this; - } - - inline complex<long double>& - complex<long double>::operator+=(long double __r) - { - __real__ _M_value += __r; - return *this; - } - - inline complex<long double>& - complex<long double>::operator-=(long double __r) - { - __real__ _M_value -= __r; - return *this; - } - - inline complex<long double>& - complex<long double>::operator*=(long double __r) - { - _M_value *= __r; - return *this; - } - - inline complex<long double>& - complex<long double>::operator/=(long double __r) - { - _M_value /= __r; - return *this; - } - - template<typename _Tp> - inline complex<long double>& - complex<long double>::operator=(const complex<_Tp>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<long double>& - complex<long double>::operator+=(const complex<_Tp>& __z) - { - __real__ _M_value += __z.real(); - __imag__ _M_value += __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<long double>& - complex<long double>::operator-=(const complex<_Tp>& __z) - { - __real__ _M_value -= __z.real(); - __imag__ _M_value -= __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<long double>& - complex<long double>::operator*=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value *= __t; - return *this; - } - - template<typename _Tp> - inline complex<long double>& - complex<long double>::operator/=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value /= __t; - return *this; - } - - // These bits have to be at the end of this file, so that the - // specializations have all been defined. - // ??? No, they have to be there because of compiler limitation at - // inlining. It suffices that class specializations be defined. - inline - complex<float>::complex(const complex<double>& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex<float>::complex(const complex<long double>& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex<double>::complex(const complex<float>& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex<double>::complex(const complex<long double>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - } - - inline - complex<long double>::complex(const complex<float>& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex<long double>::complex(const complex<double>& __z) - : _M_value(_ComplexT(__z._M_value)) { } -} // namespace std - -#endif /* _GLIBCXX_COMPLEX */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/csetjmp b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/csetjmp deleted file mode 100644 index d5fe073f0fc..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/csetjmp +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 20.4.6 C library -// - -/** @file csetjmp - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c setjmp.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CSETJMP -#define _GLIBCXX_CSETJMP 1 - -#pragma GCC system_header - -#include <setjmp.h> - -// Get rid of those macros defined in <setjmp.h> in lieu of real functions. -#undef longjmp - -// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 -#ifndef setjmp -#define setjmp(env) setjmp (env) -#endif - -namespace std -{ - using ::jmp_buf; - using ::longjmp; -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/csignal b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/csignal deleted file mode 100644 index 5734cf6d29a..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/csignal +++ /dev/null @@ -1,61 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 20.4.6 C library -// - -/** @file csignal - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c signal.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CSIGNAL -#define _GLIBCXX_CSIGNAL 1 - -#pragma GCC system_header - -#include <signal.h> - -// Get rid of those macros defined in <signal.h> in lieu of real functions. -#undef raise - -namespace std -{ - using ::sig_atomic_t; - using ::signal; - using ::raise; -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdarg b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdarg deleted file mode 100644 index ca362e4b412..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdarg +++ /dev/null @@ -1,60 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 20.4.6 C library -// - -/** @file cstdarg - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c stdarg.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CSTDARG -#define _GLIBCXX_CSTDARG 1 - -#pragma GCC system_header - -#include <stdarg.h> - -// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 -#ifndef va_end -#define va_end(ap) va_end (ap) -#endif - -namespace std -{ - using ::va_list; -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstddef b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstddef deleted file mode 100644 index 4fa82c6aa9b..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstddef +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 18.1 Types -// - -/** @file cstddef - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c stddef.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CSTDDEF -#define _GLIBCXX_CSTDDEF 1 - -#pragma GCC system_header - -#include <stddef.h> - -namespace std -{ - using ::ptrdiff_t; - using ::size_t; -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdio b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdio deleted file mode 100644 index f31e58e6f24..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdio +++ /dev/null @@ -1,185 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.8.2 C Library files -// - -/** @file cstdio - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c stdio.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CSTDIO -#define _GLIBCXX_CSTDIO 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <cstddef> - -#include <stdio.h> - -// Get rid of those macros defined in <stdio.h> in lieu of real functions. -#undef clearerr -#undef fclose -#undef feof -#undef ferror -#undef fflush -#undef fgetc -#undef fgetpos -#undef fgets -#undef fopen -#undef fprintf -#undef fputc -#undef fputs -#undef fread -#undef freopen -#undef fscanf -#undef fseek -#undef fsetpos -#undef ftell -#undef fwrite -#undef getc -#undef getchar -#undef gets -#undef perror -#undef printf -#undef putc -#undef putchar -#undef puts -#undef remove -#undef rename -#undef rewind -#undef scanf -#undef setbuf -#undef setvbuf -#undef sprintf -#undef sscanf -#undef tmpfile -#undef tmpnam -#undef ungetc -#undef vfprintf -#undef vprintf -#undef vsprintf - -namespace std -{ - using ::FILE; - using ::fpos_t; - - using ::clearerr; - using ::fclose; - using ::feof; - using ::ferror; - using ::fflush; - using ::fgetc; - using ::fgetpos; - using ::fgets; - using ::fopen; - using ::fprintf; - using ::fputc; - using ::fputs; - using ::fread; - using ::freopen; - using ::fscanf; - using ::fseek; - using ::fsetpos; - using ::ftell; - using ::fwrite; - using ::getc; - using ::getchar; - using ::gets; - using ::perror; - using ::printf; - using ::putc; - using ::putchar; - using ::puts; - using ::remove; - using ::rename; - using ::rewind; - using ::scanf; - using ::setbuf; - using ::setvbuf; - using ::sprintf; - using ::sscanf; - using ::tmpfile; - using ::tmpnam; - using ::ungetc; - using ::vfprintf; - using ::vprintf; - using ::vsprintf; -} - -#if _GLIBCXX_USE_C99 - -#undef snprintf -#undef vfscanf -#undef vscanf -#undef vsnprintf -#undef vsscanf - -namespace __gnu_cxx -{ -#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC - extern "C" int - (snprintf)(char * restrict, size_t, const char * restrict, ...); - extern "C" int - (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list); - extern "C" int (vscanf)(const char * restrict, __gnuc_va_list); - extern "C" int - (vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list); - extern "C" int - (vsscanf)(const char * restrict, const char * restrict, __gnuc_va_list); -#endif -#if !_GLIBCXX_USE_C99_DYNAMIC - using ::snprintf; - using ::vfscanf; - using ::vscanf; - using ::vsnprintf; - using ::vsscanf; -#endif -} - -namespace std -{ - using __gnu_cxx::snprintf; - using __gnu_cxx::vfscanf; - using __gnu_cxx::vscanf; - using __gnu_cxx::vsnprintf; - using __gnu_cxx::vsscanf; -} -#endif - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdlib b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdlib deleted file mode 100644 index d2d6e37064b..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdlib +++ /dev/null @@ -1,204 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 20.4.6 C library -// - -/** @file cstdlib - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c stdlib.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CSTDLIB -#define _GLIBCXX_CSTDLIB 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <cstddef> - -#include <stdlib.h> - -// Get rid of those macros defined in <stdlib.h> in lieu of real functions. -#undef abort -#undef abs -#undef atexit -#undef atof -#undef atoi -#undef atol -#undef bsearch -#undef calloc -#undef div -#undef exit -#undef free -#undef getenv -#undef labs -#undef ldiv -#undef malloc -#undef mblen -#undef mbstowcs -#undef mbtowc -#undef qsort -#undef rand -#undef realloc -#undef srand -#undef strtod -#undef strtol -#undef strtoul -#undef system -#undef wcstombs -#undef wctomb - -namespace std -{ - using ::div_t; - using ::ldiv_t; - - using ::abort; - using ::abs; - using ::atexit; - using ::atof; - using ::atoi; - using ::atol; - using ::bsearch; - using ::calloc; - using ::div; - using ::exit; - using ::free; - using ::getenv; - using ::labs; - using ::ldiv; - using ::malloc; -#ifdef _GLIBCXX_HAVE_MBSTATE_T - using ::mblen; - using ::mbstowcs; - using ::mbtowc; -#endif // _GLIBCXX_HAVE_MBSTATE_T - using ::qsort; - using ::rand; - using ::realloc; - using ::srand; - using ::strtod; - using ::strtol; - using ::strtoul; - using ::system; -#ifdef _GLIBCXX_USE_WCHAR_T - using ::wcstombs; - using ::wctomb; -#endif // _GLIBCXX_USE_WCHAR_T - - inline long - abs(long __i) { return labs(__i); } - - inline ldiv_t - div(long __i, long __j) { return ldiv(__i, __j); } -} - -#if _GLIBCXX_USE_C99 - -#undef _Exit -#undef llabs -#undef lldiv -#undef atoll -#undef strtoll -#undef strtoull -#undef strtof -#undef strtold - -namespace __gnu_cxx -{ -#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - using ::lldiv_t; -#endif -#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC - extern "C" void (_Exit)(int); -#endif -#if !_GLIBCXX_USE_C99_DYNAMIC - using ::_Exit; -#endif - - inline long long - abs(long long __x) { return __x >= 0 ? __x : -__x; } - - inline long long - llabs(long long __x) { return __x >= 0 ? __x : -__x; } - -#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - inline lldiv_t - div(long long __n, long long __d) - { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } - - inline lldiv_t - lldiv(long long __n, long long __d) - { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } -#endif - -#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - extern "C" long long int (atoll)(const char *); - extern "C" long long int - (strtoll)(const char * restrict, char ** restrict, int); - extern "C" unsigned long long int - (strtoull)(const char * restrict, char ** restrict, int); -#endif -#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - using ::atoll; - using ::strtoll; - using ::strtoull; -#endif - using ::strtof; - using ::strtold; -} - -namespace std -{ -#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - using __gnu_cxx::lldiv_t; -#endif - using __gnu_cxx::_Exit; - using __gnu_cxx::abs; - using __gnu_cxx::llabs; -#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - using __gnu_cxx::div; - using __gnu_cxx::lldiv; -#endif - using __gnu_cxx::atoll; - using __gnu_cxx::strtof; - using __gnu_cxx::strtoll; - using __gnu_cxx::strtoull; - using __gnu_cxx::strtold; -} -#endif - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstring b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstring deleted file mode 100644 index dad40c290ad..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstring +++ /dev/null @@ -1,128 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 20.4.6 C library -// - -/** @file cstring - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c string.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CSTRING -#define _GLIBCXX_CSTRING 1 - -#pragma GCC system_header - -#include <cstddef> - -#include <string.h> - -// Get rid of those macros defined in <string.h> in lieu of real functions. -#undef memcpy -#undef memmove -#undef strcpy -#undef strncpy -#undef strcat -#undef strncat -#undef memcmp -#undef strcmp -#undef strcoll -#undef strncmp -#undef strxfrm -#undef memchr -#undef strchr -#undef strcspn -#undef strpbrk -#undef strrchr -#undef strspn -#undef strstr -#undef strtok -#undef memset -#undef strerror -#undef strlen - -namespace std -{ - using ::memcpy; - using ::memmove; - using ::strcpy; - using ::strncpy; - using ::strcat; - using ::strncat; - using ::memcmp; - using ::strcmp; - using ::strcoll; - using ::strncmp; - using ::strxfrm; - using ::strcspn; - using ::strspn; - using ::strtok; - using ::memset; - using ::strerror; - using ::strlen; - - using ::memchr; - - inline void* - memchr(void* __p, int __c, size_t __n) - { return memchr(const_cast<const void*>(__p), __c, __n); } - - using ::strchr; - - inline char* - strchr(char* __s1, int __n) - { return __builtin_strchr(const_cast<const char*>(__s1), __n); } - - using ::strpbrk; - - inline char* - strpbrk(char* __s1, const char* __s2) - { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); } - - using ::strrchr; - - inline char* - strrchr(char* __s1, int __n) - { return __builtin_strrchr(const_cast<const char*>(__s1), __n); } - - using ::strstr; - - inline char* - strstr(char* __s1, const char* __s2) - { return __builtin_strstr(const_cast<const char*>(__s1), __s2); } -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ctime b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ctime deleted file mode 100644 index fe890dfd580..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ctime +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 20.5 Date and time -// - -/** @file ctime - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c time.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CTIME -#define _GLIBCXX_CTIME 1 - -#pragma GCC system_header - -#include <cstddef> - -#include <time.h> - -// Get rid of those macros defined in <time.h> in lieu of real functions. -#undef clock -#undef difftime -#undef mktime -#undef time -#undef asctime -#undef ctime -#undef gmtime -#undef localtime -#undef strftime - -namespace std -{ - using ::clock_t; - using ::time_t; - using ::tm; - - using ::clock; - using ::difftime; - using ::mktime; - using ::time; - using ::asctime; - using ::ctime; - using ::gmtime; - using ::localtime; - using ::strftime; -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cwchar b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cwchar deleted file mode 100644 index bbd5af02bff..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cwchar +++ /dev/null @@ -1,273 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 21.4 -// - -/** @file cwchar - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c wchar.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CWCHAR -#define _GLIBCXX_CWCHAR 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <cstddef> -#include <ctime> - -#if _GLIBCXX_HAVE_WCHAR_H -#include <wchar.h> -#endif - -// Need to do a bit of trickery here with mbstate_t as char_traits -// assumes it is in wchar.h, regardless of wchar_t specializations. -#ifndef _GLIBCXX_HAVE_MBSTATE_T -extern "C" -{ - typedef struct - { - int __fill[6]; - } mbstate_t; -} -#endif - -namespace std -{ - using ::mbstate_t; -} - -// Get rid of those macros defined in <wchar.h> in lieu of real functions. -#undef btowc -#undef fgetwc -#undef fgetws -#undef fputwc -#undef fputws -#undef fwide -#undef fwprintf -#undef fwscanf -#undef getwc -#undef getwchar -#undef mbrlen -#undef mbrtowc -#undef mbsinit -#undef mbsrtowcs -#undef putwc -#undef putwchar -#undef swprintf -#undef swscanf -#undef ungetwc -#undef vfwprintf -#if _GLIBCXX_HAVE_VFWSCANF -# undef vfwscanf -#endif -#undef vswprintf -#if _GLIBCXX_HAVE_VSWSCANF -# undef vswscanf -#endif -#undef vwprintf -#if _GLIBCXX_HAVE_VWSCANF -# undef vwscanf -#endif -#undef wcrtomb -#undef wcscat -#undef wcschr -#undef wcscmp -#undef wcscoll -#undef wcscpy -#undef wcscspn -#undef wcsftime -#undef wcslen -#undef wcsncat -#undef wcsncmp -#undef wcsncpy -#undef wcspbrk -#undef wcsrchr -#undef wcsrtombs -#undef wcsspn -#undef wcsstr -#undef wcstod -#if _GLIBCXX_HAVE_WCSTOF -# undef wcstof -#endif -#undef wcstok -#undef wcstol -#undef wcstoul -#undef wcsxfrm -#undef wctob -#undef wmemchr -#undef wmemcmp -#undef wmemcpy -#undef wmemmove -#undef wmemset -#undef wprintf -#undef wscanf - -#if _GLIBCXX_USE_WCHAR_T || _GLIBCXX_USE_WSTRING -namespace std -{ - using ::wint_t; - - using ::btowc; - using ::fgetwc; - using ::fgetws; - using ::fputwc; - using ::fputws; - using ::fwide; - using ::fwprintf; - using ::fwscanf; - using ::getwc; - using ::getwchar; - using ::mbrlen; - using ::mbrtowc; - using ::mbsinit; - using ::mbsrtowcs; - using ::putwc; - using ::putwchar; - using ::swprintf; - using ::swscanf; - using ::ungetwc; - using ::vfwprintf; -#if _GLIBCXX_HAVE_VFWSCANF - using ::vfwscanf; -#endif - using ::vswprintf; -#if _GLIBCXX_HAVE_VSWSCANF - using ::vswscanf; -#endif - using ::vwprintf; -#if _GLIBCXX_HAVE_VWSCANF - using ::vwscanf; -#endif - using ::wcrtomb; - using ::wcscat; - using ::wcscmp; - using ::wcscoll; - using ::wcscpy; - using ::wcscspn; - using ::wcsftime; - using ::wcslen; - using ::wcsncat; - using ::wcsncmp; - using ::wcsncpy; - using ::wcsrtombs; - using ::wcsspn; - using ::wcstod; -#if _GLIBCXX_HAVE_WCSTOF - using ::wcstof; -#endif - using ::wcstok; - using ::wcstol; - using ::wcstoul; - using ::wcsxfrm; - using ::wctob; - using ::wmemcmp; - using ::wmemcpy; - using ::wmemmove; - using ::wmemset; - using ::wprintf; - using ::wscanf; - - using ::wcschr; - - inline wchar_t* - wcschr(wchar_t* __p, wchar_t __c) - { return wcschr(const_cast<const wchar_t*>(__p), __c); } - - using ::wcspbrk; - - inline wchar_t* - wcspbrk(wchar_t* __s1, wchar_t* __s2) - { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); } - - using ::wcsrchr; - - inline wchar_t* - wcsrchr(wchar_t* __p, wchar_t __c) - { return wcsrchr(const_cast<const wchar_t*>(__p), __c); } - - using ::wcsstr; - - inline wchar_t* - wcsstr(wchar_t* __s1, const wchar_t* __s2) - { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); } - - using ::wmemchr; - - inline wchar_t* - wmemchr(wchar_t* __p, wchar_t __c, size_t __n) - { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); } -} - -#if _GLIBCXX_USE_C99 - -#undef wcstold -#undef wcstoll -#undef wcstoull - -namespace __gnu_cxx -{ -#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC - extern "C" long double - (wcstold)(const wchar_t * restrict, wchar_t ** restrict); -#endif -#if !_GLIBCXX_USE_C99_DYNAMIC - using ::wcstold; -#endif -#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - extern "C" long long int - (wcstoll)(const wchar_t * restrict, wchar_t ** restrict, int); - extern "C" unsigned long long int - (wcstoull)(const wchar_t * restrict, wchar_t ** restrict, int); -#endif -#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - using ::wcstoll; - using ::wcstoull; -#endif -} - -namespace std -{ - using __gnu_cxx::wcstold; - using __gnu_cxx::wcstoll; - using __gnu_cxx::wcstoull; -} -#endif - -#endif //_GLIBCXX_USE_WCHAR_T - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cwctype b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cwctype deleted file mode 100644 index ab709479a38..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cwctype +++ /dev/null @@ -1,110 +0,0 @@ -// -*- C++ -*- forwarding header. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: <cwctype> -// - -/** @file cwctype - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c wctype.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _GLIBCXX_CWCTYPE -#define _GLIBCXX_CWCTYPE 1 - -#pragma GCC system_header - -#include <bits/c++config.h> - -#if _GLIBCXX_HAVE_WCTYPE_H -#include <wctype.h> -#endif - -// Get rid of those macros defined in <wctype.h> in lieu of real functions. -#undef iswalnum -#undef iswalpha -#if _GLIBCXX_HAVE_ISWBLANK -# undef iswblank -#endif -#undef iswcntrl -#undef iswdigit -#undef iswgraph -#undef iswlower -#undef iswprint -#undef iswprint -#undef iswpunct -#undef iswspace -#undef iswupper -#undef iswxdigit -#undef iswctype -#undef towlower -#undef towupper -#undef towctrans -#undef wctrans -#undef wctype - -#if _GLIBCXX_USE_WCHAR_T || _GLIBCXX_USE_WSTRING -namespace std -{ - using ::wint_t; // cwchar - - using ::wctype_t; - using ::wctrans_t; - - using ::iswalnum; - using ::iswalpha; -#if _GLIBCXX_HAVE_ISWBLANK - using ::iswblank; -#endif - using ::iswcntrl; - using ::iswdigit; - using ::iswgraph; - using ::iswlower; - using ::iswprint; - using ::iswprint; - using ::iswpunct; - using ::iswspace; - using ::iswupper; - using ::iswxdigit; - using ::iswctype; - using ::towlower; - using ::towupper; - using ::towctrans; - using ::wctrans; - using ::wctype; -} -#endif //_GLIBCXX_USE_WCHAR_T - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cxxabi.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cxxabi.h deleted file mode 100644 index 35535491035..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cxxabi.h +++ /dev/null @@ -1,528 +0,0 @@ -// new abi support -*- C++ -*- - -// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of GCC. -// -// GCC is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2, or (at your option) -// any later version. -// -// GCC is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GCC; see the file COPYING. If not, write to -// the Free Software Foundation, 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com> - -/* This file declares the new abi entry points into the runtime. It is not - normally necessary for user programs to include this header, or use the - entry points directly. However, this header is available should that be - needed. - - Some of the entry points are intended for both C and C++, thus this header - is includable from both C and C++. Though the C++ specific parts are not - available in C, naturally enough. */ - -#ifndef _CXXABI_H -#define _CXXABI_H 1 - -#include <stddef.h> - -#ifdef __cplusplus -namespace __cxxabiv1 -{ - extern "C" - { -#endif - - // Allocate array. - void* - __cxa_vec_new(size_t __element_count, size_t __element_size, - size_t __padding_size, void (*__constructor) (void*), - void (*__destructor) (void*)); - - void* - __cxa_vec_new2(size_t __element_count, size_t __element_size, - size_t __padding_size, void (*__constructor) (void*), - void (*__destructor) (void*), void *(*__alloc) (size_t), - void (*__dealloc) (void*)); - - void* - __cxa_vec_new3(size_t __element_count, size_t __element_size, - size_t __padding_size, void (*__constructor) (void*), - void (*__destructor) (void*), void *(*__alloc) (size_t), - void (*__dealloc) (void*, size_t)); - - // Construct array. - void - __cxa_vec_ctor(void* __array_address, size_t __element_count, - size_t __element_size, void (*__constructor) (void*), - void (*__destructor) (void*)); - - void - __cxa_vec_cctor(void* dest_array, void* src_array, size_t element_count, - size_t element_size, void (*constructor) (void*, void*), - void (*destructor) (void*)); - - // Destruct array. - void - __cxa_vec_dtor(void* __array_address, size_t __element_count, - size_t __element_size, void (*__destructor) (void*)); - - void - __cxa_vec_cleanup(void* __array_address, size_t __element_count, - size_t __element_size, void (*__destructor) (void*)); - - // Destruct and release array. - void - __cxa_vec_delete(void* __array_address, size_t __element_size, - size_t __padding_size, void (*__destructor) (void*)); - - void - __cxa_vec_delete2(void* __array_address, size_t __element_size, - size_t __padding_size, void (*__destructor) (void*), - void (*__dealloc) (void*)); - - void - __cxa_vec_delete3(void* __array_address, size_t __element_size, - size_t __padding_size, void (*__destructor) (void*), - void (*__dealloc) (void*, size_t)); - - // The ABI requires a 64-bit type. - __extension__ typedef int __guard __attribute__((mode (__DI__))); - - int - __cxa_guard_acquire(__guard*); - - void - __cxa_guard_release(__guard*); - - void - __cxa_guard_abort(__guard*); - - // Pure virtual functions. - void - __cxa_pure_virtual(void); - - // Exception handling. - void - __cxa_bad_cast(); - - void - __cxa_bad_typeid(); - - // DSO destruction. - int - __cxa_atexit(void (*)(void*), void*, void*); - - int - __cxa_finalize(void*); - - // Demangling routines. - char* - __cxa_demangle(const char* __mangled_name, char* __output_buffer, - size_t* __length, int* __status); -#ifdef __cplusplus - } -} // namespace __cxxabiv1 -#endif - -#ifdef __cplusplus - -#include <typeinfo> - -namespace __cxxabiv1 -{ - // Type information for int, float etc. - class __fundamental_type_info : public std::type_info - { - public: - explicit - __fundamental_type_info(const char* __n) : std::type_info(__n) { } - - virtual - ~__fundamental_type_info(); - }; - - // Type information for array objects. - class __array_type_info : public std::type_info - { - public: - explicit - __array_type_info(const char* __n) : std::type_info(__n) { } - - virtual - ~__array_type_info(); - }; - - // Type information for functions (both member and non-member). - class __function_type_info : public std::type_info - { - public: - explicit - __function_type_info(const char* __n) : std::type_info(__n) { } - - virtual - ~__function_type_info(); - - protected: - // Implementation defined member function. - virtual bool - __is_function_p() const; - }; - - // Type information for enumerations. - class __enum_type_info : public std::type_info - { - public: - explicit - __enum_type_info(const char* __n) : std::type_info(__n) { } - - virtual - ~__enum_type_info(); - }; - - // Common type information for simple pointers and pointers to member. - class __pbase_type_info : public std::type_info - { - public: - unsigned int __flags; // Qualification of the target object. - const std::type_info* __pointee; // Type of pointed to object. - - explicit - __pbase_type_info(const char* __n, int __quals, - const std::type_info* __type) - : std::type_info(__n), __flags(__quals), __pointee(__type) - { } - - virtual - ~__pbase_type_info(); - - // Implementation defined type. - enum __masks - { - __const_mask = 0x1, - __volatile_mask = 0x2, - __restrict_mask = 0x4, - __incomplete_mask = 0x8, - __incomplete_class_mask = 0x10 - }; - - protected: - __pbase_type_info(const __pbase_type_info&); - - __pbase_type_info& - operator=(const __pbase_type_info&); - - // Implementation defined member functions. - virtual bool - __do_catch(const std::type_info* __thr_type, void** __thr_obj, - unsigned int __outer) const; - - inline virtual bool - __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, - unsigned __outer) const; - }; - - // Type information for simple pointers. - class __pointer_type_info : public __pbase_type_info - { - public: - explicit - __pointer_type_info(const char* __n, int __quals, - const std::type_info* __type) - : __pbase_type_info (__n, __quals, __type) { } - - - virtual - ~__pointer_type_info(); - - protected: - // Implementation defined member functions. - virtual bool - __is_pointer_p() const; - - virtual bool - __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, - unsigned __outer) const; - }; - - class __class_type_info; - - // Type information for a pointer to member variable. - class __pointer_to_member_type_info : public __pbase_type_info - { - public: - __class_type_info* __context; // Class of the member. - - explicit - __pointer_to_member_type_info(const char* __n, int __quals, - const std::type_info* __type, - __class_type_info* __klass) - : __pbase_type_info(__n, __quals, __type), __context(__klass) { } - - virtual - ~__pointer_to_member_type_info(); - - protected: - __pointer_to_member_type_info(const __pointer_to_member_type_info&); - - __pointer_to_member_type_info& - operator=(const __pointer_to_member_type_info&); - - // Implementation defined member function. - virtual bool - __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, - unsigned __outer) const; - }; - - // Helper class for __vmi_class_type. - class __base_class_type_info - { - public: - const __class_type_info* __base_type; // Base class type. - long __offset_flags; // Offset and info. - - enum __offset_flags_masks - { - __virtual_mask = 0x1, - __public_mask = 0x2, - __hwm_bit = 2, - __offset_shift = 8 // Bits to shift offset. - }; - - // Implementation defined member functions. - bool - __is_virtual_p() const - { return __offset_flags & __virtual_mask; } - - bool - __is_public_p() const - { return __offset_flags & __public_mask; } - - ptrdiff_t - __offset() const - { - // This shift, being of a signed type, is implementation - // defined. GCC implements such shifts as arithmetic, which is - // what we want. - return static_cast<ptrdiff_t>(__offset_flags) >> __offset_shift; - } - }; - - // Type information for a class. - class __class_type_info : public std::type_info - { - public: - explicit - __class_type_info (const char *__n) : type_info(__n) { } - - virtual - ~__class_type_info (); - - // Implementation defined types. - // The type sub_kind tells us about how a base object is contained - // within a derived object. We often do this lazily, hence the - // UNKNOWN value. At other times we may use NOT_CONTAINED to mean - // not publicly contained. - enum __sub_kind - { - // We have no idea. - __unknown = 0, - - // Not contained within us (in some circumstances this might - // mean not contained publicly) - __not_contained, - - // Contained ambiguously. - __contained_ambig, - - // Via a virtual path. - __contained_virtual_mask = __base_class_type_info::__virtual_mask, - - // Via a public path. - __contained_public_mask = __base_class_type_info::__public_mask, - - // Contained within us. - __contained_mask = 1 << __base_class_type_info::__hwm_bit, - - __contained_private = __contained_mask, - __contained_public = __contained_mask | __contained_public_mask - }; - - struct __upcast_result; - struct __dyncast_result; - - protected: - // Implementation defined member functions. - virtual bool - __do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const; - - virtual bool - __do_catch(const type_info* __thr_type, void** __thr_obj, - unsigned __outer) const; - - public: - // Helper for upcast. See if DST is us, or one of our bases. - // Return false if not found, true if found. - virtual bool - __do_upcast(const __class_type_info* __dst, const void* __obj, - __upcast_result& __restrict __result) const; - - // Indicate whether SRC_PTR of type SRC_TYPE is contained publicly - // within OBJ_PTR. OBJ_PTR points to a base object of our type, - // which is the destination type. SRC2DST indicates how SRC - // objects might be contained within this type. If SRC_PTR is one - // of our SRC_TYPE bases, indicate the virtuality. Returns - // not_contained for non containment or private containment. - inline __sub_kind - __find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, - const __class_type_info* __src_type, - const void* __src_ptr) const; - - // Helper for dynamic cast. ACCESS_PATH gives the access from the - // most derived object to this base. DST_TYPE indicates the - // desired type we want. OBJ_PTR points to a base of our type - // within the complete object. SRC_TYPE indicates the static type - // started from and SRC_PTR points to that base within the most - // derived object. Fill in RESULT with what we find. Return true - // if we have located an ambiguous match. - virtual bool - __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path, - const __class_type_info* __dst_type, const void* __obj_ptr, - const __class_type_info* __src_type, const void* __src_ptr, - __dyncast_result& __result) const; - - // Helper for find_public_subobj. SRC2DST indicates how SRC_TYPE - // bases are inherited by the type started from -- which is not - // necessarily the current type. The current type will be a base - // of the destination type. OBJ_PTR points to the current base. - virtual __sub_kind - __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, - const __class_type_info* __src_type, - const void* __src_ptr) const; - }; - - // Type information for a class with a single non-virtual base. - class __si_class_type_info : public __class_type_info - { - public: - const __class_type_info* __base_type; - - explicit - __si_class_type_info(const char *__n, const __class_type_info *__base) - : __class_type_info(__n), __base_type(__base) { } - - virtual - ~__si_class_type_info(); - - protected: - __si_class_type_info(const __si_class_type_info&); - - __si_class_type_info& - operator=(const __si_class_type_info&); - - // Implementation defined member functions. - virtual bool - __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path, - const __class_type_info* __dst_type, const void* __obj_ptr, - const __class_type_info* __src_type, const void* __src_ptr, - __dyncast_result& __result) const; - - virtual __sub_kind - __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, - const __class_type_info* __src_type, - const void* __sub_ptr) const; - - virtual bool - __do_upcast(const __class_type_info*__dst, const void*__obj, - __upcast_result& __restrict __result) const; - }; - - // Type information for a class with multiple and/or virtual bases. - class __vmi_class_type_info : public __class_type_info - { - public: - unsigned int __flags; // Details about the class hierarchy. - unsigned int __base_count; // Dumber of direct bases. - - // The array of bases uses the trailing array struct hack so this - // class is not constructable with a normal constructor. It is - // internally generated by the compiler. - __base_class_type_info __base_info[1]; // Array of bases. - - explicit - __vmi_class_type_info(const char* __n, int ___flags) - : __class_type_info(__n), __flags(___flags), __base_count(0) { } - - virtual - ~__vmi_class_type_info(); - - // Implementation defined types. - enum __flags_masks - { - __non_diamond_repeat_mask = 0x1, // Distinct instance of repeated base. - __diamond_shaped_mask = 0x2, // Diamond shaped multiple inheritance. - __flags_unknown_mask = 0x10 - }; - - protected: - // Implementation defined member functions. - virtual bool - __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path, - const __class_type_info* __dst_type, const void* __obj_ptr, - const __class_type_info* __src_type, const void* __src_ptr, - __dyncast_result& __result) const; - - virtual __sub_kind - __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, - const __class_type_info* __src_type, - const void* __src_ptr) const; - - virtual bool - __do_upcast(const __class_type_info* __dst, const void* __obj, - __upcast_result& __restrict __result) const; - }; - - // Dynamic cast runtime. - // src2dst has the following possible values - // >-1: src_type is a unique public non-virtual base of dst_type - // dst_ptr + src2dst == src_ptr - // -1: unspecified relationship - // -2: src_type is not a public base of dst_type - // -3: src_type is a multiple public non-virtual base of dst_type - extern "C" void* - __dynamic_cast(const void* __src_ptr, // Starting object. - const __class_type_info* __src_type, // Static type of object. - const __class_type_info* __dst_type, // Desired target type. - ptrdiff_t __src2dst); // How src and dst are related. - - - // Returns the type_info for the currently handled exception [15.3/8], or - // null if there is none. - extern "C" std::type_info* - __cxa_current_exception_type(); -} // namespace __cxxabiv1 - -// User programs should use the alias `abi'. -namespace abi = __cxxabiv1; - -#endif // __cplusplus - -#endif // __CXXABI_H diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/deque b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/deque deleted file mode 100644 index 80817f632aa..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/deque +++ /dev/null @@ -1,81 +0,0 @@ -// <deque> -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file deque - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_DEQUE -#define _GLIBCXX_DEQUE 1 - -#pragma GCC system_header - -#include <bits/functexcept.h> -#include <bits/stl_algobase.h> -#include <bits/allocator.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_deque.h> - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/deque.tcc> -#endif - -#ifdef _GLIBCXX_DEBUG -# include <debug/deque> -#endif - -#endif /* _GLIBCXX_DEQUE */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/exception b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/exception deleted file mode 100644 index 6a1a1946036..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/exception +++ /dev/null @@ -1,120 +0,0 @@ -// Exception Handling support header for -*- C++ -*- - -// Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002 -// Free Software Foundation -// -// This file is part of GCC. -// -// GCC is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2, or (at your option) -// any later version. -// -// GCC is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GCC; see the file COPYING. If not, write to -// the Free Software Foundation, 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file exception - * This header defines several types and functions relating to the - * handling of exceptions in a C++ program. - */ - -#ifndef __EXCEPTION__ -#define __EXCEPTION__ - -extern "C++" { - -namespace std -{ - /** - * @brief Base class for all library exceptions. - * - * This is the base class for all exceptions thrown by the standard - * library, and by certain language expressions. You are free to derive - * your own %exception classes, or use a different hierarchy, or to - * throw non-class data (e.g., fundamental types). - */ - class exception - { - public: - exception() throw() { } - virtual ~exception() throw(); - /** Returns a C-style character string describing the general cause - * of the current error. */ - virtual const char* what() const throw(); - }; - - /** If an %exception is thrown which is not listed in a function's - * %exception specification, one of these may be thrown. */ - class bad_exception : public exception - { - public: - bad_exception() throw() { } - // This declaration is not useless: - // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - virtual ~bad_exception() throw(); - }; - - /// If you write a replacement %terminate handler, it must be of this type. - typedef void (*terminate_handler) (); - /// If you write a replacement %unexpected handler, it must be of this type. - typedef void (*unexpected_handler) (); - - /// Takes a new handler function as an argument, returns the old function. - terminate_handler set_terminate(terminate_handler) throw(); - /** The runtime will call this function if %exception handling must be - * abandoned for any reason. It can also be called by the user. */ - void terminate() __attribute__ ((__noreturn__)); - - /// Takes a new handler function as an argument, returns the old function. - unexpected_handler set_unexpected(unexpected_handler) throw(); - /** The runtime will call this function if an %exception is thrown which - * violates the function's %exception specification. */ - void unexpected() __attribute__ ((__noreturn__)); - - /** [18.6.4]/1: "Returns true after completing evaluation of a - * throw-expression until either completing initialization of the - * exception-declaration in the matching handler or entering @c unexpected() - * due to the throw; or after entering @c terminate() for any reason - * other than an explicit call to @c terminate(). [Note: This includes - * stack unwinding [15.2]. end note]" - * - * 2: "When @c uncaught_exception() is true, throwing an %exception can - * result in a call of @c terminate() (15.5.1)." - */ - bool uncaught_exception() throw(); -} // namespace std - -namespace __gnu_cxx -{ - /** A replacement for the standard terminate_handler which prints more - information about the terminating exception (if any) on stderr. Call - @code - std::set_terminate (__gnu_cxx::__verbose_terminate_handler) - @endcode - to use. For more info, see - http://gcc.gnu.org/onlinedocs/libstdc++/19_diagnostics/howto.html#4 - - In 3.4 and later, this is on by default. - */ - void __verbose_terminate_handler (); -} // namespace __gnu_cxx - -} // extern "C++" - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/exception_defines.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/exception_defines.h deleted file mode 100644 index 1466486dc6b..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/exception_defines.h +++ /dev/null @@ -1,47 +0,0 @@ -// -fno-exceptions Support -*- C++ -*- - -// Copyright (C) 2001, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 19.1 Exception classes -// - -#ifndef _EXCEPTION_DEFINES_H -#define _EXCEPTION_DEFINES_H 1 - -#ifndef __EXCEPTIONS -// Iff -fno-exceptions, transform error handling code to work without it. -# define try if (true) -# define catch(X) if (false) -# define __throw_exception_again -#else -// Else proceed normally. -# define __throw_exception_again throw -#endif - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/algorithm b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/algorithm deleted file mode 100644 index 07ac4cbe4d3..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/algorithm +++ /dev/null @@ -1,518 +0,0 @@ -// Algorithm extensions -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file ext/algorithm - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _EXT_ALGORITHM -#define _EXT_ALGORITHM 1 - -#pragma GCC system_header - -#include <algorithm> - -namespace __gnu_cxx -{ - using std::ptrdiff_t; - using std::min; - using std::pair; - using std::input_iterator_tag; - using std::random_access_iterator_tag; - using std::iterator_traits; - - //-------------------------------------------------- - // copy_n (not part of the C++ standard) - - template<typename _InputIterator, typename _Size, typename _OutputIterator> - pair<_InputIterator, _OutputIterator> - __copy_n(_InputIterator __first, _Size __count, - _OutputIterator __result, - input_iterator_tag) - { - for ( ; __count > 0; --__count) { - *__result = *__first; - ++__first; - ++__result; - } - return pair<_InputIterator, _OutputIterator>(__first, __result); - } - - template<typename _RAIterator, typename _Size, typename _OutputIterator> - inline pair<_RAIterator, _OutputIterator> - __copy_n(_RAIterator __first, _Size __count, - _OutputIterator __result, - random_access_iterator_tag) - { - _RAIterator __last = __first + __count; - return pair<_RAIterator, _OutputIterator>(__last, - std::copy(__first, __last, __result)); - } - - /** - * @brief Copies the range [first,first+count) into [result,result+count). - * @param first An input iterator. - * @param count The number of elements to copy. - * @param result An output iterator. - * @return A std::pair composed of first+count and result+count. - * - * This is an SGI extension. - * This inline function will boil down to a call to @c memmove whenever - * possible. Failing that, if random access iterators are passed, then the - * loop count will be known (and therefore a candidate for compiler - * optimizations such as unrolling). - * @ingroup SGIextensions - */ - template<typename _InputIterator, typename _Size, typename _OutputIterator> - inline pair<_InputIterator, _OutputIterator> - copy_n(_InputIterator __first, _Size __count, _OutputIterator __result) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>) - - return __copy_n(__first, __count, __result, - std::__iterator_category(__first)); - } - - template<typename _InputIterator1, typename _InputIterator2> - int - __lexicographical_compare_3way(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2) - { - while (__first1 != __last1 && __first2 != __last2) { - if (*__first1 < *__first2) - return -1; - if (*__first2 < *__first1) - return 1; - ++__first1; - ++__first2; - } - if (__first2 == __last2) { - return !(__first1 == __last1); - } - else { - return -1; - } - } - - inline int - __lexicographical_compare_3way(const unsigned char* __first1, - const unsigned char* __last1, - const unsigned char* __first2, - const unsigned char* __last2) - { - const ptrdiff_t __len1 = __last1 - __first1; - const ptrdiff_t __len2 = __last2 - __first2; - const int __result = std::memcmp(__first1, __first2, min(__len1, __len2)); - return __result != 0 ? __result - : (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1)); - } - - inline int - __lexicographical_compare_3way(const char* __first1, const char* __last1, - const char* __first2, const char* __last2) - { -#if CHAR_MAX == SCHAR_MAX - return __lexicographical_compare_3way( - (const signed char*) __first1, - (const signed char*) __last1, - (const signed char*) __first2, - (const signed char*) __last2); -#else - return __lexicographical_compare_3way((const unsigned char*) __first1, - (const unsigned char*) __last1, - (const unsigned char*) __first2, - (const unsigned char*) __last2); -#endif - } - - /** - * @brief @c memcmp on steroids. - * @param first1 An input iterator. - * @param last1 An input iterator. - * @param first2 An input iterator. - * @param last2 An input iterator. - * @return An int, as with @c memcmp. - * - * The return value will be less than zero if the first range is - * "lexigraphically less than" the second, greater than zero if the second - * range is "lexigraphically less than" the first, and zero otherwise. - * This is an SGI extension. - * @ingroup SGIextensions - */ - template<typename _InputIterator1, typename _InputIterator2> - int - lexicographical_compare_3way(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIterator1>::value_type>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIterator2>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - __glibcxx_requires_valid_range(__first2, __last2); - - return __lexicographical_compare_3way(__first1, __last1, __first2, __last2); - } - - // count and count_if: this version, whose return type is void, was present - // in the HP STL, and is retained as an extension for backward compatibility. - - template<typename _InputIterator, typename _Tp, typename _Size> - void - count(_InputIterator __first, _InputIterator __last, - const _Tp& __value, - _Size& __n) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_EqualityComparableConcept< - typename iterator_traits<_InputIterator>::value_type >) - __glibcxx_function_requires(_EqualityComparableConcept<_Tp>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first) - if (*__first == __value) - ++__n; - } - - template<typename _InputIterator, typename _Predicate, typename _Size> - void - count_if(_InputIterator __first, _InputIterator __last, - _Predicate __pred, - _Size& __n) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_InputIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - for ( ; __first != __last; ++__first) - if (__pred(*__first)) - ++__n; - } - - // random_sample and random_sample_n (extensions, not part of the standard). - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - template<typename _ForwardIterator, typename _OutputIterator, typename _Distance> - _OutputIterator - random_sample_n(_ForwardIterator __first, _ForwardIterator __last, - _OutputIterator __out, const _Distance __n) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - _Distance __remaining = std::distance(__first, __last); - _Distance __m = min(__n, __remaining); - - while (__m > 0) { - if ((std::rand() % __remaining) < __m) { - *__out = *__first; - ++__out; - --__m; - } - - --__remaining; - ++__first; - } - return __out; - } - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - template<typename _ForwardIterator, typename _OutputIterator, typename _Distance, - typename _RandomNumberGenerator> - _OutputIterator - random_sample_n(_ForwardIterator __first, _ForwardIterator __last, - _OutputIterator __out, const _Distance __n, - _RandomNumberGenerator& __rand) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_function_requires(_UnaryFunctionConcept< - _RandomNumberGenerator, _Distance, _Distance>) - __glibcxx_requires_valid_range(__first, __last); - - _Distance __remaining = std::distance(__first, __last); - _Distance __m = min(__n, __remaining); - - while (__m > 0) { - if (__rand(__remaining) < __m) { - *__out = *__first; - ++__out; - --__m; - } - - --__remaining; - ++__first; - } - return __out; - } - - template<typename _InputIterator, typename _RandomAccessIterator, typename _Distance> - _RandomAccessIterator - __random_sample(_InputIterator __first, _InputIterator __last, - _RandomAccessIterator __out, - const _Distance __n) - { - _Distance __m = 0; - _Distance __t = __n; - for ( ; __first != __last && __m < __n; ++__m, ++__first) - __out[__m] = *__first; - - while (__first != __last) { - ++__t; - _Distance __M = std::rand() % (__t); - if (__M < __n) - __out[__M] = *__first; - ++__first; - } - - return __out + __m; - } - - template<typename _InputIterator, typename _RandomAccessIterator, - typename _RandomNumberGenerator, typename _Distance> - _RandomAccessIterator - __random_sample(_InputIterator __first, _InputIterator __last, - _RandomAccessIterator __out, - _RandomNumberGenerator& __rand, - const _Distance __n) - { - // concept requirements - __glibcxx_function_requires(_UnaryFunctionConcept< - _RandomNumberGenerator, _Distance, _Distance>) - - _Distance __m = 0; - _Distance __t = __n; - for ( ; __first != __last && __m < __n; ++__m, ++__first) - __out[__m] = *__first; - - while (__first != __last) { - ++__t; - _Distance __M = __rand(__t); - if (__M < __n) - __out[__M] = *__first; - ++__first; - } - - return __out + __m; - } - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - template<typename _InputIterator, typename _RandomAccessIterator> - inline _RandomAccessIterator - random_sample(_InputIterator __first, _InputIterator __last, - _RandomAccessIterator __out_first, _RandomAccessIterator __out_last) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_requires_valid_range(__first, __last); - __glibcxx_requires_valid_range(__out_first, __out_last); - - return __random_sample(__first, __last, - __out_first, __out_last - __out_first); - } - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - template<typename _InputIterator, typename _RandomAccessIterator, - typename _RandomNumberGenerator> - inline _RandomAccessIterator - random_sample(_InputIterator __first, _InputIterator __last, - _RandomAccessIterator __out_first, _RandomAccessIterator __out_last, - _RandomNumberGenerator& __rand) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>) - __glibcxx_requires_valid_range(__first, __last); - __glibcxx_requires_valid_range(__out_first, __out_last); - - return __random_sample(__first, __last, - __out_first, __rand, - __out_last - __out_first); - } - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - template<typename _RandomAccessIterator> - inline bool - is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) - { - // concept requirements - __glibcxx_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - return std::__is_heap(__first, __last - __first); - } - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - template<typename _RandomAccessIterator, typename _StrictWeakOrdering> - inline bool - is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, - _StrictWeakOrdering __comp) - { - // concept requirements - __glibcxx_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering, - typename iterator_traits<_RandomAccessIterator>::value_type, - typename iterator_traits<_RandomAccessIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - return std::__is_heap(__first, __comp, __last - __first); - } - - // is_sorted, a predicated testing whether a range is sorted in - // nondescending order. This is an extension, not part of the C++ - // standard. - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - template<typename _ForwardIterator> - bool - is_sorted(_ForwardIterator __first, _ForwardIterator __last) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_LessThanComparableConcept< - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) - return true; - - _ForwardIterator __next = __first; - for (++__next; __next != __last; __first = __next, ++__next) { - if (*__next < *__first) - return false; - } - - return true; - } - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - template<typename _ForwardIterator, typename _StrictWeakOrdering> - bool - is_sorted(_ForwardIterator __first, _ForwardIterator __last, _StrictWeakOrdering __comp) - { - // concept requirements - __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) - __glibcxx_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering, - typename iterator_traits<_ForwardIterator>::value_type, - typename iterator_traits<_ForwardIterator>::value_type>) - __glibcxx_requires_valid_range(__first, __last); - - if (__first == __last) - return true; - - _ForwardIterator __next = __first; - for (++__next; __next != __last; __first = __next, ++__next) { - if (__comp(*__next, *__first)) - return false; - } - - return true; - } -} // namespace __gnu_cxx - -#endif /* _EXT_ALGORITHM */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/bitmap_allocator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/bitmap_allocator.h deleted file mode 100644 index 9a0d1620984..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/bitmap_allocator.h +++ /dev/null @@ -1,859 +0,0 @@ -// Bitmapped Allocator. -*- C++ -*- - -// Copyright (C) 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - - - -#if !defined _BITMAP_ALLOCATOR_H -#define _BITMAP_ALLOCATOR_H 1 - -#include <cstddef> -//For std::size_t, and ptrdiff_t. -#include <utility> -//For std::pair. -#include <algorithm> -//std::find_if, and std::lower_bound. -#include <vector> -//For the free list of exponentially growing memory blocks. At max, -//size of the vector should be not more than the number of bits in an -//integer or an unsigned integer. -#include <functional> -//For greater_equal, and less_equal. -#include <new> -//For operator new. -#include <bits/gthr.h> -//For __gthread_mutex_t, __gthread_mutex_lock and __gthread_mutex_unlock. -#include <ext/new_allocator.h> -//For __gnu_cxx::new_allocator for std::vector. - -#include <cassert> -#define NDEBUG - -//#define CHECK_FOR_ERRORS -//#define __CPU_HAS_BACKWARD_BRANCH_PREDICTION - -namespace __gnu_cxx -{ - namespace { -#if defined __GTHREADS - bool const __threads_enabled = __gthread_active_p(); -#endif - - } - -#if defined __GTHREADS - class _Mutex { - __gthread_mutex_t _M_mut; - //Prevent Copying and assignment. - _Mutex (_Mutex const&); - _Mutex& operator= (_Mutex const&); - public: - _Mutex () - { - if (__threads_enabled) - { -#if !defined __GTHREAD_MUTEX_INIT - __GTHREAD_MUTEX_INIT_FUNCTION(&_M_mut); -#else - __gthread_mutex_t __mtemp = __GTHREAD_MUTEX_INIT; - _M_mut = __mtemp; -#endif - } - } - ~_Mutex () - { - //Gthreads does not define a Mutex Destruction Function. - } - __gthread_mutex_t *_M_get() { return &_M_mut; } - }; - - class _Lock { - _Mutex* _M_pmt; - bool _M_locked; - //Prevent Copying and assignment. - _Lock (_Lock const&); - _Lock& operator= (_Lock const&); - public: - _Lock(_Mutex* __mptr) - : _M_pmt(__mptr), _M_locked(false) - { this->_M_lock(); } - void _M_lock() - { - if (__threads_enabled) - { - _M_locked = true; - __gthread_mutex_lock(_M_pmt->_M_get()); - } - } - void _M_unlock() - { - if (__threads_enabled) - { - if (__builtin_expect(_M_locked, true)) - { - __gthread_mutex_unlock(_M_pmt->_M_get()); - _M_locked = false; - } - } - } - ~_Lock() { this->_M_unlock(); } - }; -#endif - - - - namespace __aux_balloc { - static const unsigned int _Bits_Per_Byte = 8; - static const unsigned int _Bits_Per_Block = sizeof(unsigned int) * _Bits_Per_Byte; - - template <typename _Addr_Pair_t> - inline size_t __balloc_num_blocks (_Addr_Pair_t __ap) - { - return (__ap.second - __ap.first) + 1; - } - - template <typename _Addr_Pair_t> - inline size_t __balloc_num_bit_maps (_Addr_Pair_t __ap) - { - return __balloc_num_blocks(__ap) / _Bits_Per_Block; - } - - //T should be a pointer type. - template <typename _Tp> - class _Inclusive_between : public std::unary_function<typename std::pair<_Tp, _Tp>, bool> { - typedef _Tp pointer; - pointer _M_ptr_value; - typedef typename std::pair<_Tp, _Tp> _Block_pair; - - public: - _Inclusive_between (pointer __ptr) : _M_ptr_value(__ptr) { } - bool operator () (_Block_pair __bp) const throw () - { - if (std::less_equal<pointer> ()(_M_ptr_value, __bp.second) && - std::greater_equal<pointer> ()(_M_ptr_value, __bp.first)) - return true; - else - return false; - } - }; - - //Used to pass a Functor to functions by reference. - template <typename _Functor> - class _Functor_Ref : - public std::unary_function<typename _Functor::argument_type, typename _Functor::result_type> { - _Functor& _M_fref; - - public: - typedef typename _Functor::argument_type argument_type; - typedef typename _Functor::result_type result_type; - - _Functor_Ref (_Functor& __fref) : _M_fref(__fref) { } - result_type operator() (argument_type __arg) { return _M_fref (__arg); } - }; - - - //T should be a pointer type, and A is the Allocator for the vector. - template <typename _Tp, typename _Alloc> - class _Ffit_finder - : public std::unary_function<typename std::pair<_Tp, _Tp>, bool> { - typedef typename std::vector<std::pair<_Tp, _Tp>, _Alloc> _BPVector; - typedef typename _BPVector::difference_type _Counter_type; - typedef typename std::pair<_Tp, _Tp> _Block_pair; - - unsigned int *_M_pbitmap; - unsigned int _M_data_offset; - - public: - _Ffit_finder () - : _M_pbitmap (0), _M_data_offset (0) - { } - - bool operator() (_Block_pair __bp) throw() - { - //Set the _rover to the last unsigned integer, which is the - //bitmap to the first free block. Thus, the bitmaps are in exact - //reverse order of the actual memory layout. So, we count down - //the bimaps, which is the same as moving up the memory. - - //If the used count stored at the start of the Bit Map headers - //is equal to the number of Objects that the current Block can - //store, then there is definitely no space for another single - //object, so just return false. - _Counter_type __diff = __gnu_cxx::__aux_balloc::__balloc_num_bit_maps (__bp); - - assert (*(reinterpret_cast<unsigned int*>(__bp.first) - (__diff + 1)) <= - __gnu_cxx::__aux_balloc::__balloc_num_blocks (__bp)); - - if (*(reinterpret_cast<unsigned int*>(__bp.first) - (__diff + 1)) == - __gnu_cxx::__aux_balloc::__balloc_num_blocks (__bp)) - return false; - - unsigned int *__rover = reinterpret_cast<unsigned int*>(__bp.first) - 1; - for (_Counter_type __i = 0; __i < __diff; ++__i) - { - _M_data_offset = __i; - if (*__rover) - { - _M_pbitmap = __rover; - return true; - } - --__rover; - } - return false; - } - - unsigned int *_M_get () { return _M_pbitmap; } - unsigned int _M_offset () { return _M_data_offset * _Bits_Per_Block; } - }; - - //T should be a pointer type. - template <typename _Tp, typename _Alloc> - class _Bit_map_counter { - - typedef typename std::vector<std::pair<_Tp, _Tp>, _Alloc> _BPVector; - typedef typename _BPVector::size_type _Index_type; - typedef _Tp pointer; - - _BPVector& _M_vbp; - unsigned int *_M_curr_bmap; - unsigned int *_M_last_bmap_in_block; - _Index_type _M_curr_index; - - public: - //Use the 2nd parameter with care. Make sure that such an entry - //exists in the vector before passing that particular index to - //this ctor. - _Bit_map_counter (_BPVector& Rvbp, int __index = -1) - : _M_vbp(Rvbp) - { - this->_M_reset(__index); - } - - void _M_reset (int __index = -1) throw() - { - if (__index == -1) - { - _M_curr_bmap = 0; - _M_curr_index = (_Index_type)-1; - return; - } - - _M_curr_index = __index; - _M_curr_bmap = reinterpret_cast<unsigned int*>(_M_vbp[_M_curr_index].first) - 1; - - assert (__index <= (int)_M_vbp.size() - 1); - - _M_last_bmap_in_block = _M_curr_bmap - - ((_M_vbp[_M_curr_index].second - _M_vbp[_M_curr_index].first + 1) / _Bits_Per_Block - 1); - } - - //Dangerous Function! Use with extreme care. Pass to this - //function ONLY those values that are known to be correct, - //otherwise this will mess up big time. - void _M_set_internal_bit_map (unsigned int *__new_internal_marker) throw() - { - _M_curr_bmap = __new_internal_marker; - } - - bool _M_finished () const throw() - { - return (_M_curr_bmap == 0); - } - - _Bit_map_counter& operator++ () throw() - { - if (_M_curr_bmap == _M_last_bmap_in_block) - { - if (++_M_curr_index == _M_vbp.size()) - { - _M_curr_bmap = 0; - } - else - { - this->_M_reset (_M_curr_index); - } - } - else - { - --_M_curr_bmap; - } - return *this; - } - - unsigned int *_M_get () - { - return _M_curr_bmap; - } - - pointer _M_base () { return _M_vbp[_M_curr_index].first; } - unsigned int _M_offset () - { - return _Bits_Per_Block * ((reinterpret_cast<unsigned int*>(this->_M_base()) - _M_curr_bmap) - 1); - } - - unsigned int _M_where () { return _M_curr_index; } - }; - } - - //Generic Version of the bsf instruction. - typedef unsigned int _Bit_map_type; - static inline unsigned int _Bit_scan_forward (register _Bit_map_type __num) - { - return static_cast<unsigned int>(__builtin_ctz(__num)); - } - - struct _OOM_handler { - static std::new_handler _S_old_handler; - static bool _S_handled_oom; - typedef void (*_FL_clear_proc)(void); - static _FL_clear_proc _S_oom_fcp; - - _OOM_handler (_FL_clear_proc __fcp) - { - _S_oom_fcp = __fcp; - _S_old_handler = std::set_new_handler (_S_handle_oom_proc); - _S_handled_oom = false; - } - - static void _S_handle_oom_proc() - { - _S_oom_fcp(); - std::set_new_handler (_S_old_handler); - _S_handled_oom = true; - } - - ~_OOM_handler () - { - if (!_S_handled_oom) - std::set_new_handler (_S_old_handler); - } - }; - - std::new_handler _OOM_handler::_S_old_handler; - bool _OOM_handler::_S_handled_oom = false; - _OOM_handler::_FL_clear_proc _OOM_handler::_S_oom_fcp = 0; - - - class _BA_free_list_store { - struct _LT_pointer_compare { - template <typename _Tp> - bool operator() (_Tp* __pt, _Tp const& __crt) const throw() - { - return *__pt < __crt; - } - }; - -#if defined __GTHREADS - static _Mutex _S_bfl_mutex; -#endif - static std::vector<unsigned int*> _S_free_list; - typedef std::vector<unsigned int*>::iterator _FLIter; - - static void _S_validate_free_list(unsigned int *__addr) throw() - { - const unsigned int __max_size = 64; - if (_S_free_list.size() >= __max_size) - { - //Ok, the threshold value has been reached. - //We determine which block to remove from the list of free - //blocks. - if (*__addr >= *_S_free_list.back()) - { - //Ok, the new block is greater than or equal to the last - //block in the list of free blocks. We just free the new - //block. - operator delete((void*)__addr); - return; - } - else - { - //Deallocate the last block in the list of free lists, and - //insert the new one in it's correct position. - operator delete((void*)_S_free_list.back()); - _S_free_list.pop_back(); - } - } - - //Just add the block to the list of free lists - //unconditionally. - _FLIter __temp = std::lower_bound(_S_free_list.begin(), _S_free_list.end(), - *__addr, _LT_pointer_compare ()); - //We may insert the new free list before _temp; - _S_free_list.insert(__temp, __addr); - } - - static bool _S_should_i_give(unsigned int __block_size, unsigned int __required_size) throw() - { - const unsigned int __max_wastage_percentage = 36; - if (__block_size >= __required_size && - (((__block_size - __required_size) * 100 / __block_size) < __max_wastage_percentage)) - return true; - else - return false; - } - - public: - typedef _BA_free_list_store _BFL_type; - - static inline void _S_insert_free_list(unsigned int *__addr) throw() - { -#if defined __GTHREADS - _Lock __bfl_lock(&_S_bfl_mutex); -#endif - //Call _S_validate_free_list to decide what should be done with this - //particular free list. - _S_validate_free_list(--__addr); - } - - static unsigned int *_S_get_free_list(unsigned int __sz) throw (std::bad_alloc) - { -#if defined __GTHREADS - _Lock __bfl_lock(&_S_bfl_mutex); -#endif - _FLIter __temp = std::lower_bound(_S_free_list.begin(), _S_free_list.end(), - __sz, _LT_pointer_compare()); - if (__temp == _S_free_list.end() || !_S_should_i_give (**__temp, __sz)) - { - //We hold the lock because the OOM_Handler is a stateless - //entity. - _OOM_handler __set_handler(_BFL_type::_S_clear); - unsigned int *__ret_val = reinterpret_cast<unsigned int*> - (operator new (__sz + sizeof(unsigned int))); - *__ret_val = __sz; - return ++__ret_val; - } - else - { - unsigned int* __ret_val = *__temp; - _S_free_list.erase (__temp); - return ++__ret_val; - } - } - - //This function just clears the internal Free List, and gives back - //all the memory to the OS. - static void _S_clear() - { -#if defined __GTHREADS - _Lock __bfl_lock(&_S_bfl_mutex); -#endif - _FLIter __iter = _S_free_list.begin(); - while (__iter != _S_free_list.end()) - { - operator delete((void*)*__iter); - ++__iter; - } - _S_free_list.clear(); - } - - }; - -#if defined __GTHREADS - _Mutex _BA_free_list_store::_S_bfl_mutex; -#endif - std::vector<unsigned int*> _BA_free_list_store::_S_free_list; - - template <typename _Tp> class bitmap_allocator; - // specialize for void: - template <> class bitmap_allocator<void> { - public: - typedef void* pointer; - typedef const void* const_pointer; - // reference-to-void members are impossible. - typedef void value_type; - template <typename _Tp1> struct rebind { typedef bitmap_allocator<_Tp1> other; }; - }; - - template <typename _Tp> class bitmap_allocator : private _BA_free_list_store { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef _Tp* pointer; - typedef const _Tp* const_pointer; - typedef _Tp& reference; - typedef const _Tp& const_reference; - typedef _Tp value_type; - template <typename _Tp1> struct rebind { typedef bitmap_allocator<_Tp1> other; }; - - private: - static const unsigned int _Bits_Per_Byte = 8; - static const unsigned int _Bits_Per_Block = sizeof(unsigned int) * _Bits_Per_Byte; - - static inline void _S_bit_allocate(unsigned int *__pbmap, unsigned int __pos) throw() - { - unsigned int __mask = 1 << __pos; - __mask = ~__mask; - *__pbmap &= __mask; - } - - static inline void _S_bit_free(unsigned int *__pbmap, unsigned int __pos) throw() - { - unsigned int __mask = 1 << __pos; - *__pbmap |= __mask; - } - - static inline void *_S_memory_get(size_t __sz) throw (std::bad_alloc) - { - return operator new(__sz); - } - - static inline void _S_memory_put(void *__vptr) throw () - { - operator delete(__vptr); - } - - typedef typename std::pair<pointer, pointer> _Block_pair; - typedef typename __gnu_cxx::new_allocator<_Block_pair> _BPVec_allocator_type; - typedef typename std::vector<_Block_pair, _BPVec_allocator_type> _BPVector; - - -#if defined CHECK_FOR_ERRORS - //Complexity: O(lg(N)). Where, N is the number of block of size - //sizeof(value_type). - static void _S_check_for_free_blocks() throw() - { - typedef typename __gnu_cxx::__aux_balloc::_Ffit_finder<pointer, _BPVec_allocator_type> _FFF; - _FFF __fff; - typedef typename _BPVector::iterator _BPiter; - _BPiter __bpi = std::find_if(_S_mem_blocks.begin(), _S_mem_blocks.end(), - __gnu_cxx::__aux_balloc::_Functor_Ref<_FFF>(__fff)); - assert(__bpi == _S_mem_blocks.end()); - } -#endif - - - //Complexity: O(1), but internally depends upon the complexity of - //the function _BA_free_list_store::_S_get_free_list. The part - //where the bitmap headers are written is of worst case complexity: - //O(X),where X is the number of blocks of size sizeof(value_type) - //within the newly acquired block. Having a tight bound. - static void _S_refill_pool() throw (std::bad_alloc) - { -#if defined CHECK_FOR_ERRORS - _S_check_for_free_blocks(); -#endif - - const unsigned int __num_bit_maps = _S_block_size / _Bits_Per_Block; - const unsigned int __size_to_allocate = sizeof(unsigned int) + - _S_block_size * sizeof(value_type) + __num_bit_maps*sizeof(unsigned int); - - unsigned int *__temp = - reinterpret_cast<unsigned int*>(_BA_free_list_store::_S_get_free_list(__size_to_allocate)); - *__temp = 0; - ++__temp; - - //The Header information goes at the Beginning of the Block. - _Block_pair __bp = std::make_pair(reinterpret_cast<pointer>(__temp + __num_bit_maps), - reinterpret_cast<pointer>(__temp + __num_bit_maps) - + _S_block_size - 1); - - //Fill the Vector with this information. - _S_mem_blocks.push_back(__bp); - - unsigned int __bit_mask = 0; //0 Indicates all Allocated. - __bit_mask = ~__bit_mask; //1 Indicates all Free. - - for (unsigned int __i = 0; __i < __num_bit_maps; ++__i) - __temp[__i] = __bit_mask; - - //On some implementations, operator new might throw bad_alloc, or - //malloc might fail if the size passed is too large, therefore, we - //limit the size passed to malloc or operator new. - _S_block_size *= 2; - } - - static _BPVector _S_mem_blocks; - static unsigned int _S_block_size; - static __gnu_cxx::__aux_balloc::_Bit_map_counter<pointer, _BPVec_allocator_type> _S_last_request; - static typename _BPVector::size_type _S_last_dealloc_index; -#if defined __GTHREADS - static _Mutex _S_mut; -#endif - - //Complexity: Worst case complexity is O(N), but that is hardly ever - //hit. if and when this particular case is encountered, the next few - //cases are guaranteed to have a worst case complexity of O(1)! - //That's why this function performs very well on the average. you - //can consider this function to be having a complexity refrred to - //commonly as: Amortized Constant time. - static pointer _S_allocate_single_object() - { -#if defined __GTHREADS - _Lock __bit_lock(&_S_mut); -#endif - - //The algorithm is something like this: The last_requst variable - //points to the last accessed Bit Map. When such a condition - //occurs, we try to find a free block in the current bitmap, or - //succeeding bitmaps until the last bitmap is reached. If no free - //block turns up, we resort to First Fit method. - - //WARNING: Do not re-order the condition in the while statement - //below, because it relies on C++'s short-circuit - //evaluation. The return from _S_last_request->_M_get() will NOT - //be dereferenceable if _S_last_request->_M_finished() returns - //true. This would inevitibly lead to a NULL pointer dereference - //if tinkered with. - while (_S_last_request._M_finished() == false && (*(_S_last_request._M_get()) == 0)) - { - _S_last_request.operator++(); - } - - if (__builtin_expect(_S_last_request._M_finished() == true, false)) - { - //Fall Back to First Fit algorithm. - typedef typename __gnu_cxx::__aux_balloc::_Ffit_finder<pointer, _BPVec_allocator_type> _FFF; - _FFF __fff; - typedef typename _BPVector::iterator _BPiter; - _BPiter __bpi = std::find_if(_S_mem_blocks.begin(), _S_mem_blocks.end(), - __gnu_cxx::__aux_balloc::_Functor_Ref<_FFF>(__fff)); - - if (__bpi != _S_mem_blocks.end()) - { - //Search was successful. Ok, now mark the first bit from - //the right as 0, meaning Allocated. This bit is obtained - //by calling _M_get() on __fff. - unsigned int __nz_bit = _Bit_scan_forward(*__fff._M_get()); - _S_bit_allocate(__fff._M_get(), __nz_bit); - - _S_last_request._M_reset(__bpi - _S_mem_blocks.begin()); - - //Now, get the address of the bit we marked as allocated. - pointer __ret_val = __bpi->first + __fff._M_offset() + __nz_bit; - unsigned int *__puse_count = reinterpret_cast<unsigned int*>(__bpi->first) - - (__gnu_cxx::__aux_balloc::__balloc_num_bit_maps(*__bpi) + 1); - ++(*__puse_count); - return __ret_val; - } - else - { - //Search was unsuccessful. We Add more memory to the pool - //by calling _S_refill_pool(). - _S_refill_pool(); - - //_M_Reset the _S_last_request structure to the first free - //block's bit map. - _S_last_request._M_reset(_S_mem_blocks.size() - 1); - - //Now, mark that bit as allocated. - } - } - //_S_last_request holds a pointer to a valid bit map, that points - //to a free block in memory. - unsigned int __nz_bit = _Bit_scan_forward(*_S_last_request._M_get()); - _S_bit_allocate(_S_last_request._M_get(), __nz_bit); - - pointer __ret_val = _S_last_request._M_base() + _S_last_request._M_offset() + __nz_bit; - - unsigned int *__puse_count = reinterpret_cast<unsigned int*> - (_S_mem_blocks[_S_last_request._M_where()].first) - - (__gnu_cxx::__aux_balloc::__balloc_num_bit_maps(_S_mem_blocks[_S_last_request._M_where()]) + 1); - ++(*__puse_count); - return __ret_val; - } - - //Complexity: O(lg(N)), but the worst case is hit quite often! I - //need to do something about this. I'll be able to work on it, only - //when I have some solid figures from a few real apps. - static void _S_deallocate_single_object(pointer __p) throw() - { -#if defined __GTHREADS - _Lock __bit_lock(&_S_mut); -#endif - - typedef typename _BPVector::iterator _Iterator; - typedef typename _BPVector::difference_type _Difference_type; - - _Difference_type __diff; - int __displacement; - - assert(_S_last_dealloc_index >= 0); - - if (__gnu_cxx::__aux_balloc::_Inclusive_between<pointer>(__p)(_S_mem_blocks[_S_last_dealloc_index])) - { - assert(_S_last_dealloc_index <= _S_mem_blocks.size() - 1); - - //Initial Assumption was correct! - __diff = _S_last_dealloc_index; - __displacement = __p - _S_mem_blocks[__diff].first; - } - else - { - _Iterator _iter = (std::find_if(_S_mem_blocks.begin(), _S_mem_blocks.end(), - __gnu_cxx::__aux_balloc::_Inclusive_between<pointer>(__p))); - assert(_iter != _S_mem_blocks.end()); - - __diff = _iter - _S_mem_blocks.begin(); - __displacement = __p - _S_mem_blocks[__diff].first; - _S_last_dealloc_index = __diff; - } - - //Get the position of the iterator that has been found. - const unsigned int __rotate = __displacement % _Bits_Per_Block; - unsigned int *__bit_mapC = reinterpret_cast<unsigned int*>(_S_mem_blocks[__diff].first) - 1; - __bit_mapC -= (__displacement / _Bits_Per_Block); - - _S_bit_free(__bit_mapC, __rotate); - unsigned int *__puse_count = reinterpret_cast<unsigned int*> - (_S_mem_blocks[__diff].first) - - (__gnu_cxx::__aux_balloc::__balloc_num_bit_maps(_S_mem_blocks[__diff]) + 1); - - assert(*__puse_count != 0); - - --(*__puse_count); - - if (__builtin_expect(*__puse_count == 0, false)) - { - _S_block_size /= 2; - - //We may safely remove this block. - _Block_pair __bp = _S_mem_blocks[__diff]; - _S_insert_free_list(__puse_count); - _S_mem_blocks.erase(_S_mem_blocks.begin() + __diff); - - //We reset the _S_last_request variable to reflect the erased - //block. We do this to protect future requests after the last - //block has been removed from a particular memory Chunk, - //which in turn has been returned to the free list, and - //hence had been erased from the vector, so the size of the - //vector gets reduced by 1. - if ((_Difference_type)_S_last_request._M_where() >= __diff--) - { - _S_last_request._M_reset(__diff); - // assert(__diff >= 0); - } - - //If the Index into the vector of the region of memory that - //might hold the next address that will be passed to - //deallocated may have been invalidated due to the above - //erase procedure being called on the vector, hence we try - //to restore this invariant too. - if (_S_last_dealloc_index >= _S_mem_blocks.size()) - { - _S_last_dealloc_index =(__diff != -1 ? __diff : 0); - assert(_S_last_dealloc_index >= 0); - } - } - } - - public: - bitmap_allocator() throw() - { } - - bitmap_allocator(const bitmap_allocator&) { } - - template <typename _Tp1> bitmap_allocator(const bitmap_allocator<_Tp1>&) throw() - { } - - ~bitmap_allocator() throw() - { } - - //Complexity: O(1), but internally the complexity depends upon the - //complexity of the function(s) _S_allocate_single_object and - //_S_memory_get. - pointer allocate(size_type __n) - { - if (__builtin_expect(__n == 1, true)) - return _S_allocate_single_object(); - else - return reinterpret_cast<pointer>(_S_memory_get(__n * sizeof(value_type))); - } - - //Complexity: Worst case complexity is O(N) where N is the number of - //blocks of size sizeof(value_type) within the free lists that the - //allocator holds. However, this worst case is hit only when the - //user supplies a bogus argument to hint. If the hint argument is - //sensible, then the complexity drops to O(lg(N)), and in extreme - //cases, even drops to as low as O(1). So, if the user supplied - //argument is good, then this function performs very well. - pointer allocate(size_type __n, typename bitmap_allocator<void>::const_pointer) - { - return allocate(__n); - } - - void deallocate(pointer __p, size_type __n) throw() - { - if (__builtin_expect(__n == 1, true)) - _S_deallocate_single_object(__p); - else - _S_memory_put(__p); - } - - pointer address(reference r) const { return &r; } - const_pointer address(const_reference r) const { return &r; } - - size_type max_size(void) const throw() { return (size_type()-1)/sizeof(value_type); } - - void construct (pointer p, const_reference __data) - { - ::new(p) value_type(__data); - } - - void destroy (pointer p) - { - p->~value_type(); - } - - }; - - template <typename _Tp> - typename bitmap_allocator<_Tp>::_BPVector bitmap_allocator<_Tp>::_S_mem_blocks; - - template <typename _Tp> - unsigned int bitmap_allocator<_Tp>::_S_block_size = bitmap_allocator<_Tp>::_Bits_Per_Block; - - template <typename _Tp> - typename __gnu_cxx::bitmap_allocator<_Tp>::_BPVector::size_type - bitmap_allocator<_Tp>::_S_last_dealloc_index = 0; - - template <typename _Tp> - __gnu_cxx::__aux_balloc::_Bit_map_counter - <typename bitmap_allocator<_Tp>::pointer, typename bitmap_allocator<_Tp>::_BPVec_allocator_type> - bitmap_allocator<_Tp>::_S_last_request(_S_mem_blocks); - -#if defined __GTHREADS - template <typename _Tp> - __gnu_cxx::_Mutex - bitmap_allocator<_Tp>::_S_mut; -#endif - - template <typename _Tp1, typename _Tp2> - bool operator== (const bitmap_allocator<_Tp1>&, const bitmap_allocator<_Tp2>&) throw() - { - return true; - } - - template <typename _Tp1, typename _Tp2> - bool operator!= (const bitmap_allocator<_Tp1>&, const bitmap_allocator<_Tp2>&) throw() - { - return false; - } -} - - -#endif //_BITMAP_ALLOCATOR_H diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/debug_allocator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/debug_allocator.h deleted file mode 100644 index 7ea6fb42f98..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/debug_allocator.h +++ /dev/null @@ -1,121 +0,0 @@ -// Allocators -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1996-1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file ext/debug_allocator.h - * This file is a GNU extension to the Standard C++ Library. - * You should only include this header if you are using GCC 3 or later. - */ - -#ifndef _DEBUG_ALLOCATOR_H -#define _DEBUG_ALLOCATOR_H 1 - -#include <cstdlib> - -namespace __gnu_cxx -{ - /** - * @brief A meta-allocator with debugging bits, as per [20.4]. - * - * This is precisely the allocator defined in the C++ Standard. - * - all allocation calls operator new - * - all deallocation calls operator delete - * - * (See @link Allocators allocators info @endlink for more.) - */ - template<typename _Alloc> - class debug_allocator - { - public: - typedef typename _Alloc::size_type size_type; - typedef typename _Alloc::difference_type difference_type; - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - typedef typename _Alloc::value_type value_type; - - private: - // _M_extra is the number of objects that correspond to the - // extra space where debug information is stored. - size_type _M_extra; - - _Alloc _M_allocator; - - public: - debug_allocator() - { - const size_t __obj_size = sizeof(value_type); - _M_extra = (sizeof(size_type) + __obj_size - 1) / __obj_size; - } - - pointer - allocate(size_type __n) - { - pointer __res = _M_allocator.allocate(__n + _M_extra); - size_type* __ps = reinterpret_cast<size_type*>(__res); - *__ps = __n; - return __res + _M_extra; - } - - pointer - allocate(size_type __n, const void* __hint) - { - pointer __res = _M_allocator.allocate(__n + _M_extra, __hint); - size_type* __ps = reinterpret_cast<size_type*>(__res); - *__ps = __n; - return __res + _M_extra; - } - - void - deallocate(pointer __p, size_type __n) - { - if (!__p) - abort(); - pointer __real_p = __p - _M_extra; - if (*reinterpret_cast<size_type*>(__real_p) != __n) - abort(); - _M_allocator.deallocate(__real_p, __n + _M_extra); - } - }; -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/enc_filebuf.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/enc_filebuf.h deleted file mode 100644 index 39f4ef724d1..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/enc_filebuf.h +++ /dev/null @@ -1,68 +0,0 @@ -// filebuf with __enc_traits state type -*- C++ -*- - -// Copyright (C) 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#include <fstream> -#include <locale> - -namespace __gnu_cxx -{ - // Custom traits type with __enc_traits for the state type, and the - // associated fpos<__enc_traits> for the position type, all other - // bits equivalent to the required char_traits instantiations. - template<typename _CharT> - struct enc_char_traits: public std::char_traits<_CharT> - { - typedef std::__enc_traits state_type; - typedef typename std::fpos<state_type> pos_type; - }; - - template<typename _CharT> - class enc_filebuf - : public std::basic_filebuf<_CharT, enc_char_traits<_CharT> > - { - public: - typedef enc_char_traits<_CharT> traits_type; - typedef typename traits_type::state_type state_type; - typedef typename traits_type::pos_type pos_type; - - enc_filebuf(state_type& __state) - : std::basic_filebuf<_CharT, enc_char_traits<_CharT> >() - { - this->_M_state_beg = __state; - this->_M_state_beg._M_init(); - } - - private: - // concept requirements: - // Set state type to something useful. - // Something more than copyconstructible is needed here, so - // require default and copy constructible + assignment operator. - __glibcxx_class_requires(state_type, _SGIAssignableConcept) - }; -} // namespace __gnu_cxx diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/functional b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/functional deleted file mode 100644 index 1a378173177..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/functional +++ /dev/null @@ -1,395 +0,0 @@ -// Functional extensions -*- C++ -*- - -// Copyright (C) 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file ext/functional - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _EXT_FUNCTIONAL -#define _EXT_FUNCTIONAL 1 - -#pragma GCC system_header - -#include <functional> - -namespace __gnu_cxx -{ -using std::unary_function; -using std::binary_function; -using std::mem_fun1_t; -using std::const_mem_fun1_t; -using std::mem_fun1_ref_t; -using std::const_mem_fun1_ref_t; - -/** The @c identity_element functions are not part of the C++ standard; SGI - * provided them as an extension. Its argument is an operation, and its - * return value is the identity element for that operation. It is overloaded - * for addition and multiplication, and you can overload it for your own - * nefarious operations. - * - * @addtogroup SGIextensions - * @{ -*/ -/// An \link SGIextensions SGI extension \endlink. -template <class _Tp> inline _Tp identity_element(std::plus<_Tp>) { - return _Tp(0); -} -/// An \link SGIextensions SGI extension \endlink. -template <class _Tp> inline _Tp identity_element(std::multiplies<_Tp>) { - return _Tp(1); -} -/** @} */ - -/** As an extension to the binders, SGI provided composition functors and - * wrapper functions to aid in their creation. The @c unary_compose - * functor is constructed from two functions/functors, @c f and @c g. - * Calling @c operator() with a single argument @c x returns @c f(g(x)). - * The function @c compose1 takes the two functions and constructs a - * @c unary_compose variable for you. - * - * @c binary_compose is constructed from three functors, @c f, @c g1, - * and @c g2. Its @c operator() returns @c f(g1(x),g2(x)). The function - * @compose2 takes f, g1, and g2, and constructs the @c binary_compose - * instance for you. For example, if @c f returns an int, then - * \code - * int answer = (compose2(f,g1,g2))(x); - * \endcode - * is equivalent to - * \code - * int temp1 = g1(x); - * int temp2 = g2(x); - * int answer = f(temp1,temp2); - * \endcode - * But the first form is more compact, and can be passed around as a - * functor to other algorithms. - * - * @addtogroup SGIextensions - * @{ -*/ -/// An \link SGIextensions SGI extension \endlink. -template <class _Operation1, class _Operation2> -class unary_compose - : public unary_function<typename _Operation2::argument_type, - typename _Operation1::result_type> -{ -protected: - _Operation1 _M_fn1; - _Operation2 _M_fn2; -public: - unary_compose(const _Operation1& __x, const _Operation2& __y) - : _M_fn1(__x), _M_fn2(__y) {} - typename _Operation1::result_type - operator()(const typename _Operation2::argument_type& __x) const { - return _M_fn1(_M_fn2(__x)); - } -}; - -/// An \link SGIextensions SGI extension \endlink. -template <class _Operation1, class _Operation2> -inline unary_compose<_Operation1,_Operation2> -compose1(const _Operation1& __fn1, const _Operation2& __fn2) -{ - return unary_compose<_Operation1,_Operation2>(__fn1, __fn2); -} - -/// An \link SGIextensions SGI extension \endlink. -template <class _Operation1, class _Operation2, class _Operation3> -class binary_compose - : public unary_function<typename _Operation2::argument_type, - typename _Operation1::result_type> { -protected: - _Operation1 _M_fn1; - _Operation2 _M_fn2; - _Operation3 _M_fn3; -public: - binary_compose(const _Operation1& __x, const _Operation2& __y, - const _Operation3& __z) - : _M_fn1(__x), _M_fn2(__y), _M_fn3(__z) { } - typename _Operation1::result_type - operator()(const typename _Operation2::argument_type& __x) const { - return _M_fn1(_M_fn2(__x), _M_fn3(__x)); - } -}; - -/// An \link SGIextensions SGI extension \endlink. -template <class _Operation1, class _Operation2, class _Operation3> -inline binary_compose<_Operation1, _Operation2, _Operation3> -compose2(const _Operation1& __fn1, const _Operation2& __fn2, - const _Operation3& __fn3) -{ - return binary_compose<_Operation1,_Operation2,_Operation3> - (__fn1, __fn2, __fn3); -} -/** @} */ - -/** As an extension, SGI provided a functor called @c identity. When a - * functor is required but no operations are desired, this can be used as a - * pass-through. Its @c operator() returns its argument unchanged. - * - * @addtogroup SGIextensions -*/ -template <class _Tp> struct identity : public std::_Identity<_Tp> {}; - -/** @c select1st and @c select2nd are extensions provided by SGI. Their - * @c operator()s - * take a @c std::pair as an argument, and return either the first member - * or the second member, respectively. They can be used (especially with - * the composition functors) to "strip" data from a sequence before - * performing the remainder of an algorithm. - * - * @addtogroup SGIextensions - * @{ -*/ -/// An \link SGIextensions SGI extension \endlink. -template <class _Pair> struct select1st : public std::_Select1st<_Pair> {}; -/// An \link SGIextensions SGI extension \endlink. -template <class _Pair> struct select2nd : public std::_Select2nd<_Pair> {}; -/** @} */ - -// extension documented next -template <class _Arg1, class _Arg2> -struct _Project1st : public binary_function<_Arg1, _Arg2, _Arg1> { - _Arg1 operator()(const _Arg1& __x, const _Arg2&) const { return __x; } -}; - -template <class _Arg1, class _Arg2> -struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2> { - _Arg2 operator()(const _Arg1&, const _Arg2& __y) const { return __y; } -}; - -/** The @c operator() of the @c project1st functor takes two arbitrary - * arguments and returns the first one, while @c project2nd returns the - * second one. They are extensions provided by SGI. - * - * @addtogroup SGIextensions - * @{ -*/ - -/// An \link SGIextensions SGI extension \endlink. -template <class _Arg1, class _Arg2> -struct project1st : public _Project1st<_Arg1, _Arg2> {}; - -/// An \link SGIextensions SGI extension \endlink. -template <class _Arg1, class _Arg2> -struct project2nd : public _Project2nd<_Arg1, _Arg2> {}; -/** @} */ - -// extension documented next -template <class _Result> -struct _Constant_void_fun { - typedef _Result result_type; - result_type _M_val; - - _Constant_void_fun(const result_type& __v) : _M_val(__v) {} - const result_type& operator()() const { return _M_val; } -}; - -template <class _Result, class _Argument> -struct _Constant_unary_fun { - typedef _Argument argument_type; - typedef _Result result_type; - result_type _M_val; - - _Constant_unary_fun(const result_type& __v) : _M_val(__v) {} - const result_type& operator()(const _Argument&) const { return _M_val; } -}; - -template <class _Result, class _Arg1, class _Arg2> -struct _Constant_binary_fun { - typedef _Arg1 first_argument_type; - typedef _Arg2 second_argument_type; - typedef _Result result_type; - _Result _M_val; - - _Constant_binary_fun(const _Result& __v) : _M_val(__v) {} - const result_type& operator()(const _Arg1&, const _Arg2&) const { - return _M_val; - } -}; - -/** These three functors are each constructed from a single arbitrary - * variable/value. Later, their @c operator()s completely ignore any - * arguments passed, and return the stored value. - * - @c constant_void_fun's @c operator() takes no arguments - * - @c constant_unary_fun's @c operator() takes one argument (ignored) - * - @c constant_binary_fun's @c operator() takes two arguments (ignored) - * - * The helper creator functions @c constant0, @c constant1, and - * @c constant2 each take a "result" argument and construct variables of - * the appropriate functor type. - * - * @addtogroup SGIextensions - * @{ -*/ -/// An \link SGIextensions SGI extension \endlink. -template <class _Result> -struct constant_void_fun : public _Constant_void_fun<_Result> { - constant_void_fun(const _Result& __v) : _Constant_void_fun<_Result>(__v) {} -}; - -/// An \link SGIextensions SGI extension \endlink. -template <class _Result, - class _Argument = _Result> -struct constant_unary_fun : public _Constant_unary_fun<_Result, _Argument> -{ - constant_unary_fun(const _Result& __v) - : _Constant_unary_fun<_Result, _Argument>(__v) {} -}; - -/// An \link SGIextensions SGI extension \endlink. -template <class _Result, - class _Arg1 = _Result, - class _Arg2 = _Arg1> -struct constant_binary_fun - : public _Constant_binary_fun<_Result, _Arg1, _Arg2> -{ - constant_binary_fun(const _Result& __v) - : _Constant_binary_fun<_Result, _Arg1, _Arg2>(__v) {} -}; - -/// An \link SGIextensions SGI extension \endlink. -template <class _Result> -inline constant_void_fun<_Result> constant0(const _Result& __val) -{ - return constant_void_fun<_Result>(__val); -} - -/// An \link SGIextensions SGI extension \endlink. -template <class _Result> -inline constant_unary_fun<_Result,_Result> constant1(const _Result& __val) -{ - return constant_unary_fun<_Result,_Result>(__val); -} - -/// An \link SGIextensions SGI extension \endlink. -template <class _Result> -inline constant_binary_fun<_Result,_Result,_Result> -constant2(const _Result& __val) -{ - return constant_binary_fun<_Result,_Result,_Result>(__val); -} -/** @} */ - -/** The @c subtractive_rng class is documented on - * <a href="http://www.sgi.com/tech/stl/">SGI's site</a>. - * Note that this code assumes that @c int is 32 bits. - * - * @ingroup SGIextensions -*/ -class subtractive_rng : public unary_function<unsigned int, unsigned int> { -private: - unsigned int _M_table[55]; - size_t _M_index1; - size_t _M_index2; -public: - /// Returns a number less than the argument. - unsigned int operator()(unsigned int __limit) { - _M_index1 = (_M_index1 + 1) % 55; - _M_index2 = (_M_index2 + 1) % 55; - _M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2]; - return _M_table[_M_index1] % __limit; - } - - void _M_initialize(unsigned int __seed) - { - unsigned int __k = 1; - _M_table[54] = __seed; - size_t __i; - for (__i = 0; __i < 54; __i++) { - size_t __ii = (21 * (__i + 1) % 55) - 1; - _M_table[__ii] = __k; - __k = __seed - __k; - __seed = _M_table[__ii]; - } - for (int __loop = 0; __loop < 4; __loop++) { - for (__i = 0; __i < 55; __i++) - _M_table[__i] = _M_table[__i] - _M_table[(1 + __i + 30) % 55]; - } - _M_index1 = 0; - _M_index2 = 31; - } - - /// Ctor allowing you to initialize the seed. - subtractive_rng(unsigned int __seed) { _M_initialize(__seed); } - /// Default ctor; initializes its state with some number you don't see. - subtractive_rng() { _M_initialize(161803398u); } -}; - -// Mem_fun adaptor helper functions mem_fun1 and mem_fun1_ref, -// provided for backward compatibility, they are no longer part of -// the C++ standard. - -template <class _Ret, class _Tp, class _Arg> -inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg)) - { return mem_fun1_t<_Ret,_Tp,_Arg>(__f); } - -template <class _Ret, class _Tp, class _Arg> -inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg) const) - { return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); } - -template <class _Ret, class _Tp, class _Arg> -inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun1_ref(_Ret (_Tp::*__f)(_Arg)) - { return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); } - -template <class _Ret, class _Tp, class _Arg> -inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg> -mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const) - { return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); } -} // namespace __gnu_cxx - -#endif - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hash_fun.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hash_fun.h deleted file mode 100644 index 27453a6b006..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hash_fun.h +++ /dev/null @@ -1,122 +0,0 @@ -// 'struct hash' from SGI -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1996-1998 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -/** @file ext/hash_fun.h - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _HASH_FUN_H -#define _HASH_FUN_H 1 - -#include <cstddef> - -namespace __gnu_cxx -{ - using std::size_t; - - template <class _Key> struct hash { }; - - inline size_t - __stl_hash_string(const char* __s) - { - unsigned long __h = 0; - for ( ; *__s; ++__s) - __h = 5*__h + *__s; - return size_t(__h); - } - - template<> struct hash<char*> - { - size_t operator()(const char* __s) const - { return __stl_hash_string(__s); } - }; - - template<> struct hash<const char*> - { - size_t operator()(const char* __s) const - { return __stl_hash_string(__s); } - }; - - template<> struct hash<char> - { size_t operator()(char __x) const { return __x; } }; - - template<> struct hash<unsigned char> - { size_t operator()(unsigned char __x) const { return __x; } }; - - template<> struct hash<signed char> - { size_t operator()(unsigned char __x) const { return __x; } }; - - template<> struct hash<short> - { size_t operator()(short __x) const { return __x; } }; - - template<> struct hash<unsigned short> - { size_t operator()(unsigned short __x) const { return __x; } }; - - template<> struct hash<int> - { size_t operator()(int __x) const { return __x; } }; - - template<> struct hash<unsigned int> - { size_t operator()(unsigned int __x) const { return __x; } }; - - template<> struct hash<long> - { size_t operator()(long __x) const { return __x; } }; - - template<> struct hash<unsigned long> - { size_t operator()(unsigned long __x) const { return __x; } }; -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hash_map b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hash_map deleted file mode 100644 index 5032c7b3f21..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hash_map +++ /dev/null @@ -1,447 +0,0 @@ -// Hashing map implementation -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -/** @file ext/hash_map - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _HASH_MAP -#define _HASH_MAP 1 - -#include <ext/hashtable.h> -#include <bits/concept_check.h> - -namespace __gnu_cxx -{ - using std::equal_to; - using std::allocator; - using std::pair; - using std::_Select1st; - - // Forward declaration of equality operator; needed for friend - // declaration. - template<class _Key, class _Tp, class _HashFcn = hash<_Key>, - class _EqualKey = equal_to<_Key>, class _Alloc = allocator<_Tp> > - class hash_map; - - template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc> - inline bool operator==(const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&, - const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&); -/** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo -*/ -template <class _Key, class _Tp, class _HashFcn, class _EqualKey, - class _Alloc> -class hash_map -{ -private: - typedef hashtable<pair<const _Key,_Tp>,_Key,_HashFcn, - _Select1st<pair<const _Key,_Tp> >,_EqualKey,_Alloc> _Ht; - _Ht _M_ht; - -public: - typedef typename _Ht::key_type key_type; - typedef _Tp data_type; - typedef _Tp mapped_type; - typedef typename _Ht::value_type value_type; - typedef typename _Ht::hasher hasher; - typedef typename _Ht::key_equal key_equal; - - typedef typename _Ht::size_type size_type; - typedef typename _Ht::difference_type difference_type; - typedef typename _Ht::pointer pointer; - typedef typename _Ht::const_pointer const_pointer; - typedef typename _Ht::reference reference; - typedef typename _Ht::const_reference const_reference; - - typedef typename _Ht::iterator iterator; - typedef typename _Ht::const_iterator const_iterator; - - typedef typename _Ht::allocator_type allocator_type; - - hasher hash_funct() const { return _M_ht.hash_funct(); } - key_equal key_eq() const { return _M_ht.key_eq(); } - allocator_type get_allocator() const { return _M_ht.get_allocator(); } - -public: - hash_map() : _M_ht(100, hasher(), key_equal(), allocator_type()) {} - explicit hash_map(size_type __n) - : _M_ht(__n, hasher(), key_equal(), allocator_type()) {} - hash_map(size_type __n, const hasher& __hf) - : _M_ht(__n, __hf, key_equal(), allocator_type()) {} - hash_map(size_type __n, const hasher& __hf, const key_equal& __eql, - const allocator_type& __a = allocator_type()) - : _M_ht(__n, __hf, __eql, __a) {} - - template <class _InputIterator> - hash_map(_InputIterator __f, _InputIterator __l) - : _M_ht(100, hasher(), key_equal(), allocator_type()) - { _M_ht.insert_unique(__f, __l); } - template <class _InputIterator> - hash_map(_InputIterator __f, _InputIterator __l, size_type __n) - : _M_ht(__n, hasher(), key_equal(), allocator_type()) - { _M_ht.insert_unique(__f, __l); } - template <class _InputIterator> - hash_map(_InputIterator __f, _InputIterator __l, size_type __n, - const hasher& __hf) - : _M_ht(__n, __hf, key_equal(), allocator_type()) - { _M_ht.insert_unique(__f, __l); } - template <class _InputIterator> - hash_map(_InputIterator __f, _InputIterator __l, size_type __n, - const hasher& __hf, const key_equal& __eql, - const allocator_type& __a = allocator_type()) - : _M_ht(__n, __hf, __eql, __a) - { _M_ht.insert_unique(__f, __l); } - -public: - size_type size() const { return _M_ht.size(); } - size_type max_size() const { return _M_ht.max_size(); } - bool empty() const { return _M_ht.empty(); } - void swap(hash_map& __hs) { _M_ht.swap(__hs._M_ht); } - - template <class _K1, class _T1, class _HF, class _EqK, class _Al> - friend bool operator== (const hash_map<_K1, _T1, _HF, _EqK, _Al>&, - const hash_map<_K1, _T1, _HF, _EqK, _Al>&); - - iterator begin() { return _M_ht.begin(); } - iterator end() { return _M_ht.end(); } - const_iterator begin() const { return _M_ht.begin(); } - const_iterator end() const { return _M_ht.end(); } - -public: - pair<iterator,bool> insert(const value_type& __obj) - { return _M_ht.insert_unique(__obj); } - template <class _InputIterator> - void insert(_InputIterator __f, _InputIterator __l) - { _M_ht.insert_unique(__f,__l); } - pair<iterator,bool> insert_noresize(const value_type& __obj) - { return _M_ht.insert_unique_noresize(__obj); } - - iterator find(const key_type& __key) { return _M_ht.find(__key); } - const_iterator find(const key_type& __key) const - { return _M_ht.find(__key); } - - _Tp& operator[](const key_type& __key) { - return _M_ht.find_or_insert(value_type(__key, _Tp())).second; - } - - size_type count(const key_type& __key) const { return _M_ht.count(__key); } - - pair<iterator, iterator> equal_range(const key_type& __key) - { return _M_ht.equal_range(__key); } - pair<const_iterator, const_iterator> - equal_range(const key_type& __key) const - { return _M_ht.equal_range(__key); } - - size_type erase(const key_type& __key) {return _M_ht.erase(__key); } - void erase(iterator __it) { _M_ht.erase(__it); } - void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); } - void clear() { _M_ht.clear(); } - - void resize(size_type __hint) { _M_ht.resize(__hint); } - size_type bucket_count() const { return _M_ht.bucket_count(); } - size_type max_bucket_count() const { return _M_ht.max_bucket_count(); } - size_type elems_in_bucket(size_type __n) const - { return _M_ht.elems_in_bucket(__n); } -}; - -template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc> -inline bool -operator==(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1, - const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2) -{ - return __hm1._M_ht == __hm2._M_ht; -} - -template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc> -inline bool -operator!=(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1, - const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2) { - return !(__hm1 == __hm2); -} - -template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc> -inline void -swap(hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1, - hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2) -{ - __hm1.swap(__hm2); -} - -// Forward declaration of equality operator; needed for friend declaration. - -template <class _Key, class _Tp, - class _HashFcn = hash<_Key>, - class _EqualKey = equal_to<_Key>, - class _Alloc = allocator<_Tp> > -class hash_multimap; - -template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc> -inline bool -operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1, - const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2); - -/** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo -*/ -template <class _Key, class _Tp, class _HashFcn, class _EqualKey, class _Alloc> -class hash_multimap -{ - // concept requirements - __glibcxx_class_requires(_Key, _SGIAssignableConcept) - __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - __glibcxx_class_requires3(_HashFcn, size_t, _Key, _UnaryFunctionConcept) - __glibcxx_class_requires3(_EqualKey, _Key, _Key, _BinaryPredicateConcept) - -private: - typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFcn, - _Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc> - _Ht; - _Ht _M_ht; - -public: - typedef typename _Ht::key_type key_type; - typedef _Tp data_type; - typedef _Tp mapped_type; - typedef typename _Ht::value_type value_type; - typedef typename _Ht::hasher hasher; - typedef typename _Ht::key_equal key_equal; - - typedef typename _Ht::size_type size_type; - typedef typename _Ht::difference_type difference_type; - typedef typename _Ht::pointer pointer; - typedef typename _Ht::const_pointer const_pointer; - typedef typename _Ht::reference reference; - typedef typename _Ht::const_reference const_reference; - - typedef typename _Ht::iterator iterator; - typedef typename _Ht::const_iterator const_iterator; - - typedef typename _Ht::allocator_type allocator_type; - - hasher hash_funct() const { return _M_ht.hash_funct(); } - key_equal key_eq() const { return _M_ht.key_eq(); } - allocator_type get_allocator() const { return _M_ht.get_allocator(); } - -public: - hash_multimap() : _M_ht(100, hasher(), key_equal(), allocator_type()) {} - explicit hash_multimap(size_type __n) - : _M_ht(__n, hasher(), key_equal(), allocator_type()) {} - hash_multimap(size_type __n, const hasher& __hf) - : _M_ht(__n, __hf, key_equal(), allocator_type()) {} - hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql, - const allocator_type& __a = allocator_type()) - : _M_ht(__n, __hf, __eql, __a) {} - - template <class _InputIterator> - hash_multimap(_InputIterator __f, _InputIterator __l) - : _M_ht(100, hasher(), key_equal(), allocator_type()) - { _M_ht.insert_equal(__f, __l); } - template <class _InputIterator> - hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n) - : _M_ht(__n, hasher(), key_equal(), allocator_type()) - { _M_ht.insert_equal(__f, __l); } - template <class _InputIterator> - hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n, - const hasher& __hf) - : _M_ht(__n, __hf, key_equal(), allocator_type()) - { _M_ht.insert_equal(__f, __l); } - template <class _InputIterator> - hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n, - const hasher& __hf, const key_equal& __eql, - const allocator_type& __a = allocator_type()) - : _M_ht(__n, __hf, __eql, __a) - { _M_ht.insert_equal(__f, __l); } - -public: - size_type size() const { return _M_ht.size(); } - size_type max_size() const { return _M_ht.max_size(); } - bool empty() const { return _M_ht.empty(); } - void swap(hash_multimap& __hs) { _M_ht.swap(__hs._M_ht); } - - template <class _K1, class _T1, class _HF, class _EqK, class _Al> - friend bool operator== (const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&, - const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&); - - iterator begin() { return _M_ht.begin(); } - iterator end() { return _M_ht.end(); } - const_iterator begin() const { return _M_ht.begin(); } - const_iterator end() const { return _M_ht.end(); } - -public: - iterator insert(const value_type& __obj) - { return _M_ht.insert_equal(__obj); } - template <class _InputIterator> - void insert(_InputIterator __f, _InputIterator __l) - { _M_ht.insert_equal(__f,__l); } - iterator insert_noresize(const value_type& __obj) - { return _M_ht.insert_equal_noresize(__obj); } - - iterator find(const key_type& __key) { return _M_ht.find(__key); } - const_iterator find(const key_type& __key) const - { return _M_ht.find(__key); } - - size_type count(const key_type& __key) const { return _M_ht.count(__key); } - - pair<iterator, iterator> equal_range(const key_type& __key) - { return _M_ht.equal_range(__key); } - pair<const_iterator, const_iterator> - equal_range(const key_type& __key) const - { return _M_ht.equal_range(__key); } - - size_type erase(const key_type& __key) {return _M_ht.erase(__key); } - void erase(iterator __it) { _M_ht.erase(__it); } - void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); } - void clear() { _M_ht.clear(); } - -public: - void resize(size_type __hint) { _M_ht.resize(__hint); } - size_type bucket_count() const { return _M_ht.bucket_count(); } - size_type max_bucket_count() const { return _M_ht.max_bucket_count(); } - size_type elems_in_bucket(size_type __n) const - { return _M_ht.elems_in_bucket(__n); } -}; - -template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc> -inline bool -operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1, - const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2) -{ - return __hm1._M_ht == __hm2._M_ht; -} - -template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc> -inline bool -operator!=(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1, - const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2) { - return !(__hm1 == __hm2); -} - -template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc> -inline void -swap(hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1, - hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2) -{ - __hm1.swap(__hm2); -} - -} // namespace __gnu_cxx - -namespace std -{ -// Specialization of insert_iterator so that it will work for hash_map -// and hash_multimap. - -template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc> -class insert_iterator<__gnu_cxx::hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > { -protected: - typedef __gnu_cxx::hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container; - _Container* container; -public: - typedef _Container container_type; - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - insert_iterator(_Container& __x) : container(&__x) {} - insert_iterator(_Container& __x, typename _Container::iterator) - : container(&__x) {} - insert_iterator<_Container>& - operator=(const typename _Container::value_type& __value) { - container->insert(__value); - return *this; - } - insert_iterator<_Container>& operator*() { return *this; } - insert_iterator<_Container>& operator++() { return *this; } - insert_iterator<_Container>& operator++(int) { return *this; } -}; - -template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc> -class insert_iterator<__gnu_cxx::hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> > { -protected: - typedef __gnu_cxx::hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container; - _Container* container; - typename _Container::iterator iter; -public: - typedef _Container container_type; - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - insert_iterator(_Container& __x) : container(&__x) {} - insert_iterator(_Container& __x, typename _Container::iterator) - : container(&__x) {} - insert_iterator<_Container>& - operator=(const typename _Container::value_type& __value) { - container->insert(__value); - return *this; - } - insert_iterator<_Container>& operator*() { return *this; } - insert_iterator<_Container>& operator++() { return *this; } - insert_iterator<_Container>& operator++(int) { return *this; } -}; -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hash_set b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hash_set deleted file mode 100644 index fee64fcbdb0..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hash_set +++ /dev/null @@ -1,439 +0,0 @@ -// Hashing set implementation -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -/** @file ext/hash_set - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _HASH_SET -#define _HASH_SET 1 - -#include <ext/hashtable.h> -#include <bits/concept_check.h> - -namespace __gnu_cxx -{ - using std::equal_to; - using std::allocator; - using std::pair; - using std::_Identity; - - // Forward declaration of equality operator; needed for friend - // declaration. - template <class _Value, class _HashFcn = hash<_Value>, - class _EqualKey = equal_to<_Value>, - class _Alloc = allocator<_Value> > - class hash_set; - - template <class _Value, class _HashFcn, class _EqualKey, class _Alloc> - inline bool - operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1, - const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2); - -/** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo -*/ -template <class _Value, class _HashFcn, class _EqualKey, class _Alloc> -class hash_set -{ - // concept requirements - __glibcxx_class_requires(_Value, _SGIAssignableConcept) - __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept) - __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept) - -private: - typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>, - _EqualKey, _Alloc> _Ht; - _Ht _M_ht; - -public: - typedef typename _Ht::key_type key_type; - typedef typename _Ht::value_type value_type; - typedef typename _Ht::hasher hasher; - typedef typename _Ht::key_equal key_equal; - - typedef typename _Ht::size_type size_type; - typedef typename _Ht::difference_type difference_type; - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - - typedef typename _Ht::const_iterator iterator; - typedef typename _Ht::const_iterator const_iterator; - - typedef typename _Ht::allocator_type allocator_type; - - hasher hash_funct() const { return _M_ht.hash_funct(); } - key_equal key_eq() const { return _M_ht.key_eq(); } - allocator_type get_allocator() const { return _M_ht.get_allocator(); } - -public: - hash_set() - : _M_ht(100, hasher(), key_equal(), allocator_type()) {} - explicit hash_set(size_type __n) - : _M_ht(__n, hasher(), key_equal(), allocator_type()) {} - hash_set(size_type __n, const hasher& __hf) - : _M_ht(__n, __hf, key_equal(), allocator_type()) {} - hash_set(size_type __n, const hasher& __hf, const key_equal& __eql, - const allocator_type& __a = allocator_type()) - : _M_ht(__n, __hf, __eql, __a) {} - - template <class _InputIterator> - hash_set(_InputIterator __f, _InputIterator __l) - : _M_ht(100, hasher(), key_equal(), allocator_type()) - { _M_ht.insert_unique(__f, __l); } - template <class _InputIterator> - hash_set(_InputIterator __f, _InputIterator __l, size_type __n) - : _M_ht(__n, hasher(), key_equal(), allocator_type()) - { _M_ht.insert_unique(__f, __l); } - template <class _InputIterator> - hash_set(_InputIterator __f, _InputIterator __l, size_type __n, - const hasher& __hf) - : _M_ht(__n, __hf, key_equal(), allocator_type()) - { _M_ht.insert_unique(__f, __l); } - template <class _InputIterator> - hash_set(_InputIterator __f, _InputIterator __l, size_type __n, - const hasher& __hf, const key_equal& __eql, - const allocator_type& __a = allocator_type()) - : _M_ht(__n, __hf, __eql, __a) - { _M_ht.insert_unique(__f, __l); } - -public: - size_type size() const { return _M_ht.size(); } - size_type max_size() const { return _M_ht.max_size(); } - bool empty() const { return _M_ht.empty(); } - void swap(hash_set& __hs) { _M_ht.swap(__hs._M_ht); } - - template <class _Val, class _HF, class _EqK, class _Al> - friend bool operator== (const hash_set<_Val, _HF, _EqK, _Al>&, - const hash_set<_Val, _HF, _EqK, _Al>&); - - iterator begin() const { return _M_ht.begin(); } - iterator end() const { return _M_ht.end(); } - -public: - pair<iterator, bool> insert(const value_type& __obj) - { - pair<typename _Ht::iterator, bool> __p = _M_ht.insert_unique(__obj); - return pair<iterator,bool>(__p.first, __p.second); - } - template <class _InputIterator> - void insert(_InputIterator __f, _InputIterator __l) - { _M_ht.insert_unique(__f,__l); } - pair<iterator, bool> insert_noresize(const value_type& __obj) - { - pair<typename _Ht::iterator, bool> __p = - _M_ht.insert_unique_noresize(__obj); - return pair<iterator, bool>(__p.first, __p.second); - } - - iterator find(const key_type& __key) const { return _M_ht.find(__key); } - - size_type count(const key_type& __key) const { return _M_ht.count(__key); } - - pair<iterator, iterator> equal_range(const key_type& __key) const - { return _M_ht.equal_range(__key); } - - size_type erase(const key_type& __key) {return _M_ht.erase(__key); } - void erase(iterator __it) { _M_ht.erase(__it); } - void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); } - void clear() { _M_ht.clear(); } - -public: - void resize(size_type __hint) { _M_ht.resize(__hint); } - size_type bucket_count() const { return _M_ht.bucket_count(); } - size_type max_bucket_count() const { return _M_ht.max_bucket_count(); } - size_type elems_in_bucket(size_type __n) const - { return _M_ht.elems_in_bucket(__n); } -}; - -template <class _Value, class _HashFcn, class _EqualKey, class _Alloc> -inline bool -operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1, - const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2) -{ - return __hs1._M_ht == __hs2._M_ht; -} - -template <class _Value, class _HashFcn, class _EqualKey, class _Alloc> -inline bool -operator!=(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1, - const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2) { - return !(__hs1 == __hs2); -} - -template <class _Val, class _HashFcn, class _EqualKey, class _Alloc> -inline void -swap(hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1, - hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) -{ - __hs1.swap(__hs2); -} - - -template <class _Value, - class _HashFcn = hash<_Value>, - class _EqualKey = equal_to<_Value>, - class _Alloc = allocator<_Value> > -class hash_multiset; - -template <class _Val, class _HashFcn, class _EqualKey, class _Alloc> -inline bool -operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1, - const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2); - - -/** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo -*/ -template <class _Value, class _HashFcn, class _EqualKey, class _Alloc> -class hash_multiset -{ - // concept requirements - __glibcxx_class_requires(_Value, _SGIAssignableConcept) - __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept) - __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept) - -private: - typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>, - _EqualKey, _Alloc> _Ht; - _Ht _M_ht; - -public: - typedef typename _Ht::key_type key_type; - typedef typename _Ht::value_type value_type; - typedef typename _Ht::hasher hasher; - typedef typename _Ht::key_equal key_equal; - - typedef typename _Ht::size_type size_type; - typedef typename _Ht::difference_type difference_type; - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - - typedef typename _Ht::const_iterator iterator; - typedef typename _Ht::const_iterator const_iterator; - - typedef typename _Ht::allocator_type allocator_type; - - hasher hash_funct() const { return _M_ht.hash_funct(); } - key_equal key_eq() const { return _M_ht.key_eq(); } - allocator_type get_allocator() const { return _M_ht.get_allocator(); } - -public: - hash_multiset() - : _M_ht(100, hasher(), key_equal(), allocator_type()) {} - explicit hash_multiset(size_type __n) - : _M_ht(__n, hasher(), key_equal(), allocator_type()) {} - hash_multiset(size_type __n, const hasher& __hf) - : _M_ht(__n, __hf, key_equal(), allocator_type()) {} - hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql, - const allocator_type& __a = allocator_type()) - : _M_ht(__n, __hf, __eql, __a) {} - - template <class _InputIterator> - hash_multiset(_InputIterator __f, _InputIterator __l) - : _M_ht(100, hasher(), key_equal(), allocator_type()) - { _M_ht.insert_equal(__f, __l); } - template <class _InputIterator> - hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n) - : _M_ht(__n, hasher(), key_equal(), allocator_type()) - { _M_ht.insert_equal(__f, __l); } - template <class _InputIterator> - hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n, - const hasher& __hf) - : _M_ht(__n, __hf, key_equal(), allocator_type()) - { _M_ht.insert_equal(__f, __l); } - template <class _InputIterator> - hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n, - const hasher& __hf, const key_equal& __eql, - const allocator_type& __a = allocator_type()) - : _M_ht(__n, __hf, __eql, __a) - { _M_ht.insert_equal(__f, __l); } - -public: - size_type size() const { return _M_ht.size(); } - size_type max_size() const { return _M_ht.max_size(); } - bool empty() const { return _M_ht.empty(); } - void swap(hash_multiset& hs) { _M_ht.swap(hs._M_ht); } - - template <class _Val, class _HF, class _EqK, class _Al> - friend bool operator== (const hash_multiset<_Val, _HF, _EqK, _Al>&, - const hash_multiset<_Val, _HF, _EqK, _Al>&); - - iterator begin() const { return _M_ht.begin(); } - iterator end() const { return _M_ht.end(); } - -public: - iterator insert(const value_type& __obj) - { return _M_ht.insert_equal(__obj); } - template <class _InputIterator> - void insert(_InputIterator __f, _InputIterator __l) - { _M_ht.insert_equal(__f,__l); } - iterator insert_noresize(const value_type& __obj) - { return _M_ht.insert_equal_noresize(__obj); } - - iterator find(const key_type& __key) const { return _M_ht.find(__key); } - - size_type count(const key_type& __key) const { return _M_ht.count(__key); } - - pair<iterator, iterator> equal_range(const key_type& __key) const - { return _M_ht.equal_range(__key); } - - size_type erase(const key_type& __key) {return _M_ht.erase(__key); } - void erase(iterator __it) { _M_ht.erase(__it); } - void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); } - void clear() { _M_ht.clear(); } - -public: - void resize(size_type __hint) { _M_ht.resize(__hint); } - size_type bucket_count() const { return _M_ht.bucket_count(); } - size_type max_bucket_count() const { return _M_ht.max_bucket_count(); } - size_type elems_in_bucket(size_type __n) const - { return _M_ht.elems_in_bucket(__n); } -}; - -template <class _Val, class _HashFcn, class _EqualKey, class _Alloc> -inline bool -operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1, - const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) -{ - return __hs1._M_ht == __hs2._M_ht; -} - -template <class _Val, class _HashFcn, class _EqualKey, class _Alloc> -inline bool -operator!=(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1, - const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) { - return !(__hs1 == __hs2); -} - -template <class _Val, class _HashFcn, class _EqualKey, class _Alloc> -inline void -swap(hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1, - hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) { - __hs1.swap(__hs2); -} - -} // namespace __gnu_cxx - -namespace std -{ -// Specialization of insert_iterator so that it will work for hash_set -// and hash_multiset. - -template <class _Value, class _HashFcn, class _EqualKey, class _Alloc> -class insert_iterator<__gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc> > { -protected: - typedef __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc> _Container; - _Container* container; -public: - typedef _Container container_type; - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - insert_iterator(_Container& __x) : container(&__x) {} - insert_iterator(_Container& __x, typename _Container::iterator) - : container(&__x) {} - insert_iterator<_Container>& - operator=(const typename _Container::value_type& __value) { - container->insert(__value); - return *this; - } - insert_iterator<_Container>& operator*() { return *this; } - insert_iterator<_Container>& operator++() { return *this; } - insert_iterator<_Container>& operator++(int) { return *this; } -}; - -template <class _Value, class _HashFcn, class _EqualKey, class _Alloc> -class insert_iterator<__gnu_cxx::hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> > { -protected: - typedef __gnu_cxx::hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> _Container; - _Container* container; - typename _Container::iterator iter; -public: - typedef _Container container_type; - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - insert_iterator(_Container& __x) : container(&__x) {} - insert_iterator(_Container& __x, typename _Container::iterator) - : container(&__x) {} - insert_iterator<_Container>& - operator=(const typename _Container::value_type& __value) { - container->insert(__value); - return *this; - } - insert_iterator<_Container>& operator*() { return *this; } - insert_iterator<_Container>& operator++() { return *this; } - insert_iterator<_Container>& operator++(int) { return *this; } -}; -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hashtable.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hashtable.h deleted file mode 100644 index f81a8580b15..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hashtable.h +++ /dev/null @@ -1,994 +0,0 @@ -// Hashtable implementation used by containers -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -/** @file ext/hashtable.h - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _HASHTABLE_H -#define _HASHTABLE_H 1 - -// Hashtable class, used to implement the hashed associative containers -// hash_set, hash_map, hash_multiset, and hash_multimap. - -#include <vector> -#include <iterator> -#include <bits/stl_algo.h> -#include <bits/stl_function.h> -#include <ext/hash_fun.h> - -namespace __gnu_cxx -{ -using std::size_t; -using std::ptrdiff_t; -using std::forward_iterator_tag; -using std::input_iterator_tag; -using std::_Construct; -using std::_Destroy; -using std::distance; -using std::vector; -using std::pair; -using std::__iterator_category; - -template <class _Val> -struct _Hashtable_node -{ - _Hashtable_node* _M_next; - _Val _M_val; -}; - -template <class _Val, class _Key, class _HashFcn, class _ExtractKey, - class _EqualKey, class _Alloc = std::allocator<_Val> > -class hashtable; - -template <class _Val, class _Key, class _HashFcn, - class _ExtractKey, class _EqualKey, class _Alloc> -struct _Hashtable_iterator; - -template <class _Val, class _Key, class _HashFcn, - class _ExtractKey, class _EqualKey, class _Alloc> -struct _Hashtable_const_iterator; - -template <class _Val, class _Key, class _HashFcn, - class _ExtractKey, class _EqualKey, class _Alloc> -struct _Hashtable_iterator { - typedef hashtable<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc> - _Hashtable; - typedef _Hashtable_iterator<_Val, _Key, _HashFcn, - _ExtractKey, _EqualKey, _Alloc> - iterator; - typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn, - _ExtractKey, _EqualKey, _Alloc> - const_iterator; - typedef _Hashtable_node<_Val> _Node; - - typedef forward_iterator_tag iterator_category; - typedef _Val value_type; - typedef ptrdiff_t difference_type; - typedef size_t size_type; - typedef _Val& reference; - typedef _Val* pointer; - - _Node* _M_cur; - _Hashtable* _M_ht; - - _Hashtable_iterator(_Node* __n, _Hashtable* __tab) - : _M_cur(__n), _M_ht(__tab) {} - _Hashtable_iterator() {} - reference operator*() const { return _M_cur->_M_val; } - pointer operator->() const { return &(operator*()); } - iterator& operator++(); - iterator operator++(int); - bool operator==(const iterator& __it) const - { return _M_cur == __it._M_cur; } - bool operator!=(const iterator& __it) const - { return _M_cur != __it._M_cur; } -}; - - -template <class _Val, class _Key, class _HashFcn, - class _ExtractKey, class _EqualKey, class _Alloc> -struct _Hashtable_const_iterator { - typedef hashtable<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc> - _Hashtable; - typedef _Hashtable_iterator<_Val,_Key,_HashFcn, - _ExtractKey,_EqualKey,_Alloc> - iterator; - typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn, - _ExtractKey, _EqualKey, _Alloc> - const_iterator; - typedef _Hashtable_node<_Val> _Node; - - typedef forward_iterator_tag iterator_category; - typedef _Val value_type; - typedef ptrdiff_t difference_type; - typedef size_t size_type; - typedef const _Val& reference; - typedef const _Val* pointer; - - const _Node* _M_cur; - const _Hashtable* _M_ht; - - _Hashtable_const_iterator(const _Node* __n, const _Hashtable* __tab) - : _M_cur(__n), _M_ht(__tab) {} - _Hashtable_const_iterator() {} - _Hashtable_const_iterator(const iterator& __it) - : _M_cur(__it._M_cur), _M_ht(__it._M_ht) {} - reference operator*() const { return _M_cur->_M_val; } - pointer operator->() const { return &(operator*()); } - const_iterator& operator++(); - const_iterator operator++(int); - bool operator==(const const_iterator& __it) const - { return _M_cur == __it._M_cur; } - bool operator!=(const const_iterator& __it) const - { return _M_cur != __it._M_cur; } -}; - -// Note: assumes long is at least 32 bits. -enum { _S_num_primes = 28 }; - -static const unsigned long __stl_prime_list[_S_num_primes] = -{ - 53ul, 97ul, 193ul, 389ul, 769ul, - 1543ul, 3079ul, 6151ul, 12289ul, 24593ul, - 49157ul, 98317ul, 196613ul, 393241ul, 786433ul, - 1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul, - 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul, - 1610612741ul, 3221225473ul, 4294967291ul -}; - -inline unsigned long __stl_next_prime(unsigned long __n) -{ - const unsigned long* __first = __stl_prime_list; - const unsigned long* __last = __stl_prime_list + (int)_S_num_primes; - const unsigned long* pos = std::lower_bound(__first, __last, __n); - return pos == __last ? *(__last - 1) : *pos; -} - -// Forward declaration of operator==. - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -class hashtable; - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1, - const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2); - - -// Hashtables handle allocators a bit differently than other -// containers do. If we're using standard-conforming allocators, then -// a hashtable unconditionally has a member variable to hold its -// allocator, even if it so happens that all instances of the -// allocator type are identical. This is because, for hashtables, -// this extra storage is negligible. Additionally, a base class -// wouldn't serve any other purposes; it wouldn't, for example, -// simplify the exception-handling code. - -template <class _Val, class _Key, class _HashFcn, - class _ExtractKey, class _EqualKey, class _Alloc> -class hashtable { -public: - typedef _Key key_type; - typedef _Val value_type; - typedef _HashFcn hasher; - typedef _EqualKey key_equal; - - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - hasher hash_funct() const { return _M_hash; } - key_equal key_eq() const { return _M_equals; } - -private: - typedef _Hashtable_node<_Val> _Node; - -public: - typedef _Alloc allocator_type; - allocator_type get_allocator() const { return _M_node_allocator; } -private: - typedef typename _Alloc::template rebind<_Node>::other _Node_Alloc; - typedef typename _Alloc::template rebind<_Node*>::other _Nodeptr_Alloc; - typedef vector<_Node*, _Nodeptr_Alloc> _Vector_type; - - _Node_Alloc _M_node_allocator; - _Node* _M_get_node() { return _M_node_allocator.allocate(1); } - void _M_put_node(_Node* __p) { _M_node_allocator.deallocate(__p, 1); } - -private: - hasher _M_hash; - key_equal _M_equals; - _ExtractKey _M_get_key; - _Vector_type _M_buckets; - size_type _M_num_elements; - -public: - typedef _Hashtable_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc> - iterator; - typedef _Hashtable_const_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey, - _Alloc> - const_iterator; - - friend struct - _Hashtable_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>; - friend struct - _Hashtable_const_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>; - -public: - hashtable(size_type __n, - const _HashFcn& __hf, - const _EqualKey& __eql, - const _ExtractKey& __ext, - const allocator_type& __a = allocator_type()) - : _M_node_allocator(__a), - _M_hash(__hf), - _M_equals(__eql), - _M_get_key(__ext), - _M_buckets(__a), - _M_num_elements(0) - { - _M_initialize_buckets(__n); - } - - hashtable(size_type __n, - const _HashFcn& __hf, - const _EqualKey& __eql, - const allocator_type& __a = allocator_type()) - : _M_node_allocator(__a), - _M_hash(__hf), - _M_equals(__eql), - _M_get_key(_ExtractKey()), - _M_buckets(__a), - _M_num_elements(0) - { - _M_initialize_buckets(__n); - } - - hashtable(const hashtable& __ht) - : _M_node_allocator(__ht.get_allocator()), - _M_hash(__ht._M_hash), - _M_equals(__ht._M_equals), - _M_get_key(__ht._M_get_key), - _M_buckets(__ht.get_allocator()), - _M_num_elements(0) - { - _M_copy_from(__ht); - } - - hashtable& operator= (const hashtable& __ht) - { - if (&__ht != this) { - clear(); - _M_hash = __ht._M_hash; - _M_equals = __ht._M_equals; - _M_get_key = __ht._M_get_key; - _M_copy_from(__ht); - } - return *this; - } - - ~hashtable() { clear(); } - - size_type size() const { return _M_num_elements; } - size_type max_size() const { return size_type(-1); } - bool empty() const { return size() == 0; } - - void swap(hashtable& __ht) - { - std::swap(_M_hash, __ht._M_hash); - std::swap(_M_equals, __ht._M_equals); - std::swap(_M_get_key, __ht._M_get_key); - _M_buckets.swap(__ht._M_buckets); - std::swap(_M_num_elements, __ht._M_num_elements); - } - - iterator begin() - { - for (size_type __n = 0; __n < _M_buckets.size(); ++__n) - if (_M_buckets[__n]) - return iterator(_M_buckets[__n], this); - return end(); - } - - iterator end() { return iterator(0, this); } - - const_iterator begin() const - { - for (size_type __n = 0; __n < _M_buckets.size(); ++__n) - if (_M_buckets[__n]) - return const_iterator(_M_buckets[__n], this); - return end(); - } - - const_iterator end() const { return const_iterator(0, this); } - - template <class _Vl, class _Ky, class _HF, class _Ex, class _Eq, class _Al> - friend bool operator== (const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&, - const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&); -public: - - size_type bucket_count() const { return _M_buckets.size(); } - - size_type max_bucket_count() const - { return __stl_prime_list[(int)_S_num_primes - 1]; } - - size_type elems_in_bucket(size_type __bucket) const - { - size_type __result = 0; - for (_Node* __cur = _M_buckets[__bucket]; __cur; __cur = __cur->_M_next) - __result += 1; - return __result; - } - - pair<iterator, bool> insert_unique(const value_type& __obj) - { - resize(_M_num_elements + 1); - return insert_unique_noresize(__obj); - } - - iterator insert_equal(const value_type& __obj) - { - resize(_M_num_elements + 1); - return insert_equal_noresize(__obj); - } - - pair<iterator, bool> insert_unique_noresize(const value_type& __obj); - iterator insert_equal_noresize(const value_type& __obj); - - template <class _InputIterator> - void insert_unique(_InputIterator __f, _InputIterator __l) - { - insert_unique(__f, __l, __iterator_category(__f)); - } - - template <class _InputIterator> - void insert_equal(_InputIterator __f, _InputIterator __l) - { - insert_equal(__f, __l, __iterator_category(__f)); - } - - template <class _InputIterator> - void insert_unique(_InputIterator __f, _InputIterator __l, - input_iterator_tag) - { - for ( ; __f != __l; ++__f) - insert_unique(*__f); - } - - template <class _InputIterator> - void insert_equal(_InputIterator __f, _InputIterator __l, - input_iterator_tag) - { - for ( ; __f != __l; ++__f) - insert_equal(*__f); - } - - template <class _ForwardIterator> - void insert_unique(_ForwardIterator __f, _ForwardIterator __l, - forward_iterator_tag) - { - size_type __n = distance(__f, __l); - resize(_M_num_elements + __n); - for ( ; __n > 0; --__n, ++__f) - insert_unique_noresize(*__f); - } - - template <class _ForwardIterator> - void insert_equal(_ForwardIterator __f, _ForwardIterator __l, - forward_iterator_tag) - { - size_type __n = distance(__f, __l); - resize(_M_num_elements + __n); - for ( ; __n > 0; --__n, ++__f) - insert_equal_noresize(*__f); - } - - reference find_or_insert(const value_type& __obj); - - iterator find(const key_type& __key) - { - size_type __n = _M_bkt_num_key(__key); - _Node* __first; - for ( __first = _M_buckets[__n]; - __first && !_M_equals(_M_get_key(__first->_M_val), __key); - __first = __first->_M_next) - {} - return iterator(__first, this); - } - - const_iterator find(const key_type& __key) const - { - size_type __n = _M_bkt_num_key(__key); - const _Node* __first; - for ( __first = _M_buckets[__n]; - __first && !_M_equals(_M_get_key(__first->_M_val), __key); - __first = __first->_M_next) - {} - return const_iterator(__first, this); - } - - size_type count(const key_type& __key) const - { - const size_type __n = _M_bkt_num_key(__key); - size_type __result = 0; - - for (const _Node* __cur = _M_buckets[__n]; __cur; __cur = __cur->_M_next) - if (_M_equals(_M_get_key(__cur->_M_val), __key)) - ++__result; - return __result; - } - - pair<iterator, iterator> - equal_range(const key_type& __key); - - pair<const_iterator, const_iterator> - equal_range(const key_type& __key) const; - - size_type erase(const key_type& __key); - void erase(const iterator& __it); - void erase(iterator __first, iterator __last); - - void erase(const const_iterator& __it); - void erase(const_iterator __first, const_iterator __last); - - void resize(size_type __num_elements_hint); - void clear(); - -private: - size_type _M_next_size(size_type __n) const - { return __stl_next_prime(__n); } - - void _M_initialize_buckets(size_type __n) - { - const size_type __n_buckets = _M_next_size(__n); - _M_buckets.reserve(__n_buckets); - _M_buckets.insert(_M_buckets.end(), __n_buckets, (_Node*) 0); - _M_num_elements = 0; - } - - size_type _M_bkt_num_key(const key_type& __key) const - { - return _M_bkt_num_key(__key, _M_buckets.size()); - } - - size_type _M_bkt_num(const value_type& __obj) const - { - return _M_bkt_num_key(_M_get_key(__obj)); - } - - size_type _M_bkt_num_key(const key_type& __key, size_t __n) const - { - return _M_hash(__key) % __n; - } - - size_type _M_bkt_num(const value_type& __obj, size_t __n) const - { - return _M_bkt_num_key(_M_get_key(__obj), __n); - } - - _Node* _M_new_node(const value_type& __obj) - { - _Node* __n = _M_get_node(); - __n->_M_next = 0; - try { - _Construct(&__n->_M_val, __obj); - return __n; - } - catch(...) - { - _M_put_node(__n); - __throw_exception_again; - } - } - - void _M_delete_node(_Node* __n) - { - _Destroy(&__n->_M_val); - _M_put_node(__n); - } - - void _M_erase_bucket(const size_type __n, _Node* __first, _Node* __last); - void _M_erase_bucket(const size_type __n, _Node* __last); - - void _M_copy_from(const hashtable& __ht); - -}; - -template <class _Val, class _Key, class _HF, class _ExK, class _EqK, - class _All> -_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>& -_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++() -{ - const _Node* __old = _M_cur; - _M_cur = _M_cur->_M_next; - if (!_M_cur) { - size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val); - while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size()) - _M_cur = _M_ht->_M_buckets[__bucket]; - } - return *this; -} - -template <class _Val, class _Key, class _HF, class _ExK, class _EqK, - class _All> -inline _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All> -_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++(int) -{ - iterator __tmp = *this; - ++*this; - return __tmp; -} - -template <class _Val, class _Key, class _HF, class _ExK, class _EqK, - class _All> -_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>& -_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++() -{ - const _Node* __old = _M_cur; - _M_cur = _M_cur->_M_next; - if (!_M_cur) { - size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val); - while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size()) - _M_cur = _M_ht->_M_buckets[__bucket]; - } - return *this; -} - -template <class _Val, class _Key, class _HF, class _ExK, class _EqK, - class _All> -inline _Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All> -_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++(int) -{ - const_iterator __tmp = *this; - ++*this; - return __tmp; -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1, - const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2) -{ - typedef typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::_Node _Node; - if (__ht1._M_buckets.size() != __ht2._M_buckets.size()) - return false; - for (size_t __n = 0; __n < __ht1._M_buckets.size(); ++__n) { - _Node* __cur1 = __ht1._M_buckets[__n]; - _Node* __cur2 = __ht2._M_buckets[__n]; - // Check same length of lists - for ( ; __cur1 && __cur2; - __cur1 = __cur1->_M_next, __cur2 = __cur2->_M_next) - {} - if (__cur1 || __cur2) - return false; - // Now check one's elements are in the other - for (__cur1 = __ht1._M_buckets[__n] ; __cur1; __cur1 = __cur1->_M_next) - { - bool _found__cur1 = false; - for (_Node* __cur2 = __ht2._M_buckets[__n]; - __cur2; __cur2 = __cur2->_M_next) - { - if (__cur1->_M_val == __cur2->_M_val) - { - _found__cur1 = true; - break; - } - } - if (!_found__cur1) - return false; - } - } - return true; -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -inline bool operator!=(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1, - const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2) { - return !(__ht1 == __ht2); -} - -template <class _Val, class _Key, class _HF, class _Extract, class _EqKey, - class _All> -inline void swap(hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht1, - hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht2) { - __ht1.swap(__ht2); -} - - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator, bool> -hashtable<_Val,_Key,_HF,_Ex,_Eq,_All> - ::insert_unique_noresize(const value_type& __obj) -{ - const size_type __n = _M_bkt_num(__obj); - _Node* __first = _M_buckets[__n]; - - for (_Node* __cur = __first; __cur; __cur = __cur->_M_next) - if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj))) - return pair<iterator, bool>(iterator(__cur, this), false); - - _Node* __tmp = _M_new_node(__obj); - __tmp->_M_next = __first; - _M_buckets[__n] = __tmp; - ++_M_num_elements; - return pair<iterator, bool>(iterator(__tmp, this), true); -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator -hashtable<_Val,_Key,_HF,_Ex,_Eq,_All> - ::insert_equal_noresize(const value_type& __obj) -{ - const size_type __n = _M_bkt_num(__obj); - _Node* __first = _M_buckets[__n]; - - for (_Node* __cur = __first; __cur; __cur = __cur->_M_next) - if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj))) { - _Node* __tmp = _M_new_node(__obj); - __tmp->_M_next = __cur->_M_next; - __cur->_M_next = __tmp; - ++_M_num_elements; - return iterator(__tmp, this); - } - - _Node* __tmp = _M_new_node(__obj); - __tmp->_M_next = __first; - _M_buckets[__n] = __tmp; - ++_M_num_elements; - return iterator(__tmp, this); -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::reference -hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::find_or_insert(const value_type& __obj) -{ - resize(_M_num_elements + 1); - - size_type __n = _M_bkt_num(__obj); - _Node* __first = _M_buckets[__n]; - - for (_Node* __cur = __first; __cur; __cur = __cur->_M_next) - if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj))) - return __cur->_M_val; - - _Node* __tmp = _M_new_node(__obj); - __tmp->_M_next = __first; - _M_buckets[__n] = __tmp; - ++_M_num_elements; - return __tmp->_M_val; -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator, - typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator> -hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::equal_range(const key_type& __key) -{ - typedef pair<iterator, iterator> _Pii; - const size_type __n = _M_bkt_num_key(__key); - - for (_Node* __first = _M_buckets[__n]; __first; __first = __first->_M_next) - if (_M_equals(_M_get_key(__first->_M_val), __key)) { - for (_Node* __cur = __first->_M_next; __cur; __cur = __cur->_M_next) - if (!_M_equals(_M_get_key(__cur->_M_val), __key)) - return _Pii(iterator(__first, this), iterator(__cur, this)); - for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m) - if (_M_buckets[__m]) - return _Pii(iterator(__first, this), - iterator(_M_buckets[__m], this)); - return _Pii(iterator(__first, this), end()); - } - return _Pii(end(), end()); -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator, - typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator> -hashtable<_Val,_Key,_HF,_Ex,_Eq,_All> - ::equal_range(const key_type& __key) const -{ - typedef pair<const_iterator, const_iterator> _Pii; - const size_type __n = _M_bkt_num_key(__key); - - for (const _Node* __first = _M_buckets[__n] ; - __first; - __first = __first->_M_next) { - if (_M_equals(_M_get_key(__first->_M_val), __key)) { - for (const _Node* __cur = __first->_M_next; - __cur; - __cur = __cur->_M_next) - if (!_M_equals(_M_get_key(__cur->_M_val), __key)) - return _Pii(const_iterator(__first, this), - const_iterator(__cur, this)); - for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m) - if (_M_buckets[__m]) - return _Pii(const_iterator(__first, this), - const_iterator(_M_buckets[__m], this)); - return _Pii(const_iterator(__first, this), end()); - } - } - return _Pii(end(), end()); -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::size_type -hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const key_type& __key) -{ - const size_type __n = _M_bkt_num_key(__key); - _Node* __first = _M_buckets[__n]; - size_type __erased = 0; - - if (__first) { - _Node* __cur = __first; - _Node* __next = __cur->_M_next; - while (__next) { - if (_M_equals(_M_get_key(__next->_M_val), __key)) { - __cur->_M_next = __next->_M_next; - _M_delete_node(__next); - __next = __cur->_M_next; - ++__erased; - --_M_num_elements; - } - else { - __cur = __next; - __next = __cur->_M_next; - } - } - if (_M_equals(_M_get_key(__first->_M_val), __key)) { - _M_buckets[__n] = __first->_M_next; - _M_delete_node(__first); - ++__erased; - --_M_num_elements; - } - } - return __erased; -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const iterator& __it) -{ - _Node* __p = __it._M_cur; - if (__p) { - const size_type __n = _M_bkt_num(__p->_M_val); - _Node* __cur = _M_buckets[__n]; - - if (__cur == __p) { - _M_buckets[__n] = __cur->_M_next; - _M_delete_node(__cur); - --_M_num_elements; - } - else { - _Node* __next = __cur->_M_next; - while (__next) { - if (__next == __p) { - __cur->_M_next = __next->_M_next; - _M_delete_node(__next); - --_M_num_elements; - break; - } - else { - __cur = __next; - __next = __cur->_M_next; - } - } - } - } -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All> - ::erase(iterator __first, iterator __last) -{ - size_type __f_bucket = __first._M_cur ? - _M_bkt_num(__first._M_cur->_M_val) : _M_buckets.size(); - size_type __l_bucket = __last._M_cur ? - _M_bkt_num(__last._M_cur->_M_val) : _M_buckets.size(); - - if (__first._M_cur == __last._M_cur) - return; - else if (__f_bucket == __l_bucket) - _M_erase_bucket(__f_bucket, __first._M_cur, __last._M_cur); - else { - _M_erase_bucket(__f_bucket, __first._M_cur, 0); - for (size_type __n = __f_bucket + 1; __n < __l_bucket; ++__n) - _M_erase_bucket(__n, 0); - if (__l_bucket != _M_buckets.size()) - _M_erase_bucket(__l_bucket, __last._M_cur); - } -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -inline void -hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const_iterator __first, - const_iterator __last) -{ - erase(iterator(const_cast<_Node*>(__first._M_cur), - const_cast<hashtable*>(__first._M_ht)), - iterator(const_cast<_Node*>(__last._M_cur), - const_cast<hashtable*>(__last._M_ht))); -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -inline void -hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const const_iterator& __it) -{ - erase(iterator(const_cast<_Node*>(__it._M_cur), - const_cast<hashtable*>(__it._M_ht))); -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All> - ::resize(size_type __num_elements_hint) -{ - const size_type __old_n = _M_buckets.size(); - if (__num_elements_hint > __old_n) { - const size_type __n = _M_next_size(__num_elements_hint); - if (__n > __old_n) { - _Vector_type __tmp(__n, (_Node*)(0), _M_buckets.get_allocator()); - try { - for (size_type __bucket = 0; __bucket < __old_n; ++__bucket) { - _Node* __first = _M_buckets[__bucket]; - while (__first) { - size_type __new_bucket = _M_bkt_num(__first->_M_val, __n); - _M_buckets[__bucket] = __first->_M_next; - __first->_M_next = __tmp[__new_bucket]; - __tmp[__new_bucket] = __first; - __first = _M_buckets[__bucket]; - } - } - _M_buckets.swap(__tmp); - } - catch(...) { - for (size_type __bucket = 0; __bucket < __tmp.size(); ++__bucket) { - while (__tmp[__bucket]) { - _Node* __next = __tmp[__bucket]->_M_next; - _M_delete_node(__tmp[__bucket]); - __tmp[__bucket] = __next; - } - } - __throw_exception_again; - } - } - } -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All> - ::_M_erase_bucket(const size_type __n, _Node* __first, _Node* __last) -{ - _Node* __cur = _M_buckets[__n]; - if (__cur == __first) - _M_erase_bucket(__n, __last); - else { - _Node* __next; - for (__next = __cur->_M_next; - __next != __first; - __cur = __next, __next = __cur->_M_next) - ; - while (__next != __last) { - __cur->_M_next = __next->_M_next; - _M_delete_node(__next); - __next = __cur->_M_next; - --_M_num_elements; - } - } -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All> - ::_M_erase_bucket(const size_type __n, _Node* __last) -{ - _Node* __cur = _M_buckets[__n]; - while (__cur != __last) { - _Node* __next = __cur->_M_next; - _M_delete_node(__cur); - __cur = __next; - _M_buckets[__n] = __cur; - --_M_num_elements; - } -} - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::clear() -{ - for (size_type __i = 0; __i < _M_buckets.size(); ++__i) { - _Node* __cur = _M_buckets[__i]; - while (__cur != 0) { - _Node* __next = __cur->_M_next; - _M_delete_node(__cur); - __cur = __next; - } - _M_buckets[__i] = 0; - } - _M_num_elements = 0; -} - - -template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All> -void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All> - ::_M_copy_from(const hashtable& __ht) -{ - _M_buckets.clear(); - _M_buckets.reserve(__ht._M_buckets.size()); - _M_buckets.insert(_M_buckets.end(), __ht._M_buckets.size(), (_Node*) 0); - try { - for (size_type __i = 0; __i < __ht._M_buckets.size(); ++__i) { - const _Node* __cur = __ht._M_buckets[__i]; - if (__cur) { - _Node* __local_copy = _M_new_node(__cur->_M_val); - _M_buckets[__i] = __local_copy; - - for (_Node* __next = __cur->_M_next; - __next; - __cur = __next, __next = __cur->_M_next) { - __local_copy->_M_next = _M_new_node(__next->_M_val); - __local_copy = __local_copy->_M_next; - } - } - } - _M_num_elements = __ht._M_num_elements; - } - catch(...) - { - clear(); - __throw_exception_again; - } -} -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/iterator b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/iterator deleted file mode 100644 index 094313c76e4..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/iterator +++ /dev/null @@ -1,113 +0,0 @@ -// HP/SGI iterator extensions -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996-1998 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file ext/iterator - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _EXT_ITERATOR -#define _EXT_ITERATOR 1 - -#pragma GCC system_header - -#include <bits/concept_check.h> -#include <iterator> - -namespace __gnu_cxx -{ - // There are two signatures for distance. In addition to the one - // taking two iterators and returning a result, there is another - // taking two iterators and a reference-to-result variable, and - // returning nothing. The latter seems to be an SGI extension. - // -- pedwards - template<typename _InputIterator, typename _Distance> - inline void - __distance(_InputIterator __first, _InputIterator __last, - _Distance& __n, std::input_iterator_tag) - { - // concept requirements - __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - while (__first != __last) { ++__first; ++__n; } - } - - template<typename _RandomAccessIterator, typename _Distance> - inline void - __distance(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Distance& __n, std::random_access_iterator_tag) - { - // concept requirements - __glibcxx_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>) - __n += __last - __first; - } - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - template<typename _InputIterator, typename _Distance> - inline void - distance(_InputIterator __first, _InputIterator __last, - _Distance& __n) - { - // concept requirements -- taken care of in __distance - __distance(__first, __last, __n, std::__iterator_category(__first)); - } -} // namespace __gnu_cxx - -#endif - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/malloc_allocator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/malloc_allocator.h deleted file mode 100644 index 938380c36f6..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/malloc_allocator.h +++ /dev/null @@ -1,118 +0,0 @@ -// Allocator that wraps "C" malloc -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _MALLOC_ALLOCATOR_H -#define _MALLOC_ALLOCATOR_H 1 - -#include <new> - -namespace __gnu_cxx -{ - /** - * @brief An allocator that uses malloc - * - * This is precisely the allocator defined in the C++ Standard. - * - all allocation calls malloc - * - all deallocation calls free - * - * (See @link Allocators allocators info @endlink for more.) - */ - template<typename _Tp> - class malloc_allocator - { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef _Tp* pointer; - typedef const _Tp* const_pointer; - typedef _Tp& reference; - typedef const _Tp& const_reference; - typedef _Tp value_type; - - template<typename _Tp1> - struct rebind - { typedef malloc_allocator<_Tp1> other; }; - - malloc_allocator() throw() { } - - malloc_allocator(const malloc_allocator&) throw() { } - - template<typename _Tp1> - malloc_allocator(const malloc_allocator<_Tp1>&) throw() { } - - ~malloc_allocator() throw() { } - - pointer - address(reference __x) const { return &__x; } - - const_pointer - address(const_reference __x) const { return &__x; } - - // NB: __n is permitted to be 0. The C++ standard says nothing - // about what the return value is when __n == 0. - pointer - allocate(size_type __n, const void* = 0) - { - pointer __ret = static_cast<_Tp*>(malloc(__n * sizeof(_Tp))); - if (!__ret) - throw std::bad_alloc(); - return __ret; - } - - // __p is not permitted to be a null pointer. - void - deallocate(pointer __p, size_type) - { free(static_cast<void*>(__p)); } - - size_type - max_size() const throw() - { return size_t(-1) / sizeof(_Tp); } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 402. wrong new expression in [some_] allocator::construct - void - construct(pointer __p, const _Tp& __val) - { ::new(__p) value_type(__val); } - - void - destroy(pointer __p) { __p->~_Tp(); } - }; - - template<typename _Tp> - inline bool - operator==(const malloc_allocator<_Tp>&, const malloc_allocator<_Tp>&) - { return true; } - - template<typename _Tp> - inline bool - operator!=(const malloc_allocator<_Tp>&, const malloc_allocator<_Tp>&) - { return false; } -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/memory b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/memory deleted file mode 100644 index 1d93f90ac7a..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/memory +++ /dev/null @@ -1,171 +0,0 @@ -// Memory extensions -*- C++ -*- - -// Copyright (C) 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file ext/memory - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _EXT_MEMORY -#define _EXT_MEMORY 1 - -#pragma GCC system_header - -#include <memory> -#include <bits/stl_tempbuf.h> - -namespace __gnu_cxx -{ - using std::ptrdiff_t; - using std::pair; - using std::__iterator_category; - using std::_Temporary_buffer; - - template<typename _InputIter, typename _Size, typename _ForwardIter> - pair<_InputIter, _ForwardIter> - __uninitialized_copy_n(_InputIter __first, _Size __count, - _ForwardIter __result, std::input_iterator_tag) - { - _ForwardIter __cur = __result; - try - { - for ( ; __count > 0 ; --__count, ++__first, ++__cur) - std::_Construct(&*__cur, *__first); - return pair<_InputIter, _ForwardIter>(__first, __cur); - } - catch(...) - { - std::_Destroy(__result, __cur); - __throw_exception_again; - } - } - - template<typename _RandomAccessIter, typename _Size, typename _ForwardIter> - inline pair<_RandomAccessIter, _ForwardIter> - __uninitialized_copy_n(_RandomAccessIter __first, _Size __count, - _ForwardIter __result, - std::random_access_iterator_tag) - { - _RandomAccessIter __last = __first + __count; - return pair<_RandomAccessIter, _ForwardIter>( - __last, - std::uninitialized_copy(__first, __last, __result)); - } - - template<typename _InputIter, typename _Size, typename _ForwardIter> - inline pair<_InputIter, _ForwardIter> - __uninitialized_copy_n(_InputIter __first, _Size __count, - _ForwardIter __result) - { - return __uninitialized_copy_n(__first, __count, __result, - __iterator_category(__first)); - } - - /** - * @brief Copies the range [first,last) into result. - * @param first An input iterator. - * @param last An input iterator. - * @param result An output iterator. - * @return result + (first - last) - * @ingroup SGIextensions - * - * Like copy(), but does not require an initialized output range. - */ - template<typename _InputIter, typename _Size, typename _ForwardIter> - inline pair<_InputIter, _ForwardIter> - uninitialized_copy_n(_InputIter __first, _Size __count, - _ForwardIter __result) - { - return __uninitialized_copy_n(__first, __count, __result, - __iterator_category(__first)); - } - - - /** - * This class provides similar behavior and semantics of the standard - * functions get_temporary_buffer() and return_temporary_buffer(), but - * encapsulated in a type vaguely resembling a standard container. - * - * By default, a temporary_buffer<Iter> stores space for objects of - * whatever type the Iter iterator points to. It is constructed from a - * typical [first,last) range, and provides the begin(), end(), size() - * functions, as well as requested_size(). For non-trivial types, copies - * of *first will be used to initialize the storage. - * - * @c malloc is used to obtain underlying storage. - * - * Like get_temporary_buffer(), not all the requested memory may be - * available. Ideally, the created buffer will be large enough to hold a - * copy of [first,last), but if size() is less than requested_size(), - * then this didn't happen. - * - * @ingroup SGIextensions - */ - template <class _ForwardIterator, class _Tp - = typename std::iterator_traits<_ForwardIterator>::value_type > - struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp> - { - /// Requests storage large enough to hold a copy of [first,last). - temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) - : _Temporary_buffer<_ForwardIterator, _Tp>(__first, __last) { } - - /// Destroys objects and frees storage. - ~temporary_buffer() { } - }; -} // namespace __gnu_cxx - -#endif - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/mt_allocator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/mt_allocator.h deleted file mode 100644 index f0ee2ebd26d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/mt_allocator.h +++ /dev/null @@ -1,718 +0,0 @@ -// MT-optimized allocator -*- C++ -*- - -// Copyright (C) 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file ext/mt_allocator.h - * This file is a GNU extension to the Standard C++ Library. - * You should only include this header if you are using GCC 3 or later. - */ - -#ifndef _MT_ALLOCATOR_H -#define _MT_ALLOCATOR_H 1 - -#include <new> -#include <cstdlib> -#include <bits/functexcept.h> -#include <bits/gthr.h> -#include <bits/atomicity.h> - -namespace __gnu_cxx -{ - /** - * This is a fixed size (power of 2) allocator which - when - * compiled with thread support - will maintain one freelist per - * size per thread plus a "global" one. Steps are taken to limit - * the per thread freelist sizes (by returning excess back to - * "global"). - * - * Further details: - * http://gcc.gnu.org/onlinedocs/libstdc++/ext/mt_allocator.html - */ - template<typename _Tp> - class __mt_alloc - { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef _Tp* pointer; - typedef const _Tp* const_pointer; - typedef _Tp& reference; - typedef const _Tp& const_reference; - typedef _Tp value_type; - - template<typename _Tp1> - struct rebind - { typedef __mt_alloc<_Tp1> other; }; - - __mt_alloc() throw() - { - // XXX - } - - __mt_alloc(const __mt_alloc&) throw() - { - // XXX - } - - template<typename _Tp1> - __mt_alloc(const __mt_alloc<_Tp1>& obj) throw() - { - // XXX - } - - ~__mt_alloc() throw() { } - - pointer - address(reference __x) const - { return &__x; } - - const_pointer - address(const_reference __x) const - { return &__x; } - - size_type - max_size() const throw() - { return size_t(-1) / sizeof(_Tp); } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 402. wrong new expression in [some_] allocator::construct - void - construct(pointer __p, const _Tp& __val) - { ::new(__p) _Tp(__val); } - - void - destroy(pointer __p) { __p->~_Tp(); } - - pointer - allocate(size_type __n, const void* = 0); - - void - deallocate(pointer __p, size_type __n); - - // Variables used to configure the behavior of the allocator, - // assigned and explained in detail below. - struct _Tune - { - // Alignment needed. - // NB: In any case must be >= sizeof(_Block_record), that - // is 4 on 32 bit machines and 8 on 64 bit machines. - size_t _M_align; - - // Allocation requests (after round-up to power of 2) below - // this value will be handled by the allocator. A raw new/ - // call will be used for requests larger than this value. - size_t _M_max_bytes; - - // Size in bytes of the smallest bin. - // NB: Must be a power of 2 and >= _M_align. - size_t _M_min_bin; - - // In order to avoid fragmenting and minimize the number of - // new() calls we always request new memory using this - // value. Based on previous discussions on the libstdc++ - // mailing list we have choosen the value below. - // See http://gcc.gnu.org/ml/libstdc++/2001-07/msg00077.html - size_t _M_chunk_size; - - // The maximum number of supported threads. Our Linux 2.4.18 - // reports 4070 in /proc/sys/kernel/threads-max - size_t _M_max_threads; - - // Each time a deallocation occurs in a threaded application - // we make sure that there are no more than - // _M_freelist_headroom % of used memory on the freelist. If - // the number of additional records is more than - // _M_freelist_headroom % of the freelist, we move these - // records back to the global pool. - size_t _M_freelist_headroom; - - // Set to true forces all allocations to use new(). - bool _M_force_new; - - explicit - _Tune() - : _M_align(8), _M_max_bytes(128), _M_min_bin(8), - _M_chunk_size(4096 - 4 * sizeof(void*)), - _M_max_threads(4096), _M_freelist_headroom(10), - _M_force_new(getenv("GLIBCXX_FORCE_NEW") ? true : false) - { } - - explicit - _Tune(size_t __align, size_t __maxb, size_t __minbin, - size_t __chunk, size_t __maxthreads, size_t __headroom, - bool __force) - : _M_align(__align), _M_max_bytes(__maxb), _M_min_bin(__minbin), - _M_chunk_size(__chunk), _M_max_threads(__maxthreads), - _M_freelist_headroom(__headroom), _M_force_new(__force) - { } - }; - - private: - // We need to create the initial lists and set up some variables - // before we can answer to the first request for memory. -#ifdef __GTHREADS - static __gthread_once_t _S_once; -#endif - static bool _S_init; - - static void - _S_initialize(); - - // Configuration options. - static _Tune _S_options; - - static const _Tune - _S_get_options() - { return _S_options; } - - static void - _S_set_options(_Tune __t) - { - if (!_S_init) - _S_options = __t; - } - - // Using short int as type for the binmap implies we are never - // caching blocks larger than 65535 with this allocator - typedef unsigned short int _Binmap_type; - static _Binmap_type* _S_binmap; - - // Each requesting thread is assigned an id ranging from 1 to - // _S_max_threads. Thread id 0 is used as a global memory pool. - // In order to get constant performance on the thread assignment - // routine, we keep a list of free ids. When a thread first - // requests memory we remove the first record in this list and - // stores the address in a __gthread_key. When initializing the - // __gthread_key we specify a destructor. When this destructor - // (i.e. the thread dies) is called, we return the thread id to - // the front of this list. -#ifdef __GTHREADS - struct _Thread_record - { - // Points to next free thread id record. NULL if last record in list. - _Thread_record* volatile _M_next; - - // Thread id ranging from 1 to _S_max_threads. - size_t _M_id; - }; - - static _Thread_record* volatile _S_thread_freelist_first; - static __gthread_mutex_t _S_thread_freelist_mutex; - static __gthread_key_t _S_thread_key; - - static void - _S_destroy_thread_key(void* __freelist_pos); -#endif - - static size_t - _S_get_thread_id(); - - union _Block_record - { - // Points to the block_record of the next free block. - _Block_record* volatile _M_next; - -#ifdef __GTHREADS - // The thread id of the thread which has requested this block. - size_t _M_thread_id; -#endif - }; - - struct _Bin_record - { - // An "array" of pointers to the first free block for each - // thread id. Memory to this "array" is allocated in _S_initialize() - // for _S_max_threads + global pool 0. - _Block_record** volatile _M_first; - -#ifdef __GTHREADS - // An "array" of counters used to keep track of the amount of - // blocks that are on the freelist/used for each thread id. - // Memory to these "arrays" is allocated in _S_initialize() for - // _S_max_threads + global pool 0. - size_t* volatile _M_free; - size_t* volatile _M_used; - - // Each bin has its own mutex which is used to ensure data - // integrity while changing "ownership" on a block. The mutex - // is initialized in _S_initialize(). - __gthread_mutex_t* _M_mutex; -#endif - }; - - // An "array" of bin_records each of which represents a specific - // power of 2 size. Memory to this "array" is allocated in - // _S_initialize(). - static _Bin_record* volatile _S_bin; - - // Actual value calculated in _S_initialize(). - static size_t _S_bin_size; - }; - - template<typename _Tp> - typename __mt_alloc<_Tp>::pointer - __mt_alloc<_Tp>:: - allocate(size_type __n, const void*) - { - // Although the test in __gthread_once() would suffice, we wrap - // test of the once condition in our own unlocked check. This - // saves one function call to pthread_once() (which itself only - // tests for the once value unlocked anyway and immediately - // returns if set) - if (!_S_init) - { -#ifdef __GTHREADS - if (__gthread_active_p()) - __gthread_once(&_S_once, _S_initialize); -#endif - if (!_S_init) - _S_initialize(); - } - - // Requests larger than _M_max_bytes are handled by new/delete - // directly. - const size_t __bytes = __n * sizeof(_Tp); - if (__bytes > _S_options._M_max_bytes || _S_options._M_force_new) - { - void* __ret = ::operator new(__bytes); - return static_cast<_Tp*>(__ret); - } - - // Round up to power of 2 and figure out which bin to use. - const size_t __which = _S_binmap[__bytes]; - const size_t __thread_id = _S_get_thread_id(); - - // Find out if we have blocks on our freelist. If so, go ahead - // and use them directly without having to lock anything. - const _Bin_record& __bin = _S_bin[__which]; - _Block_record* __block = NULL; - if (__bin._M_first[__thread_id] == NULL) - { - // NB: For alignment reasons, we can't use the first _M_align - // bytes, even when sizeof(_Block_record) < _M_align. - const size_t __bin_size = ((_S_options._M_min_bin << __which) - + _S_options._M_align); - size_t __block_count = _S_options._M_chunk_size / __bin_size; - - // Are we using threads? - // - Yes, check if there are free blocks on the global - // list. If so, grab up to __block_count blocks in one - // lock and change ownership. If the global list is - // empty, we allocate a new chunk and add those blocks - // directly to our own freelist (with us as owner). - // - No, all operations are made directly to global pool 0 - // no need to lock or change ownership but check for free - // blocks on global list (and if not add new ones) and - // get the first one. -#ifdef __GTHREADS - if (__gthread_active_p()) - { - __gthread_mutex_lock(__bin._M_mutex); - if (__bin._M_first[0] == NULL) - { - // No need to hold the lock when we are adding a - // whole chunk to our own list. - __gthread_mutex_unlock(__bin._M_mutex); - - void* __v = ::operator new(_S_options._M_chunk_size); - __bin._M_first[__thread_id] = static_cast<_Block_record*>(__v); - __bin._M_free[__thread_id] = __block_count; - - --__block_count; - __block = __bin._M_first[__thread_id]; - while (__block_count-- > 0) - { - char* __c = reinterpret_cast<char*>(__block) + __bin_size; - __block->_M_next = reinterpret_cast<_Block_record*>(__c); - __block = __block->_M_next; - } - __block->_M_next = NULL; - } - else - { - // Is the number of required blocks greater than or - // equal to the number that can be provided by the - // global free list? - __bin._M_first[__thread_id] = __bin._M_first[0]; - if (__block_count >= __bin._M_free[0]) - { - __bin._M_free[__thread_id] = __bin._M_free[0]; - __bin._M_free[0] = 0; - __bin._M_first[0] = NULL; - } - else - { - __bin._M_free[__thread_id] = __block_count; - __bin._M_free[0] -= __block_count; - --__block_count; - __block = __bin._M_first[0]; - while (__block_count-- > 0) - __block = __block->_M_next; - __bin._M_first[0] = __block->_M_next; - __block->_M_next = NULL; - } - __gthread_mutex_unlock(__bin._M_mutex); - } - } - else -#endif - { - void* __v = ::operator new(_S_options._M_chunk_size); - __bin._M_first[0] = static_cast<_Block_record*>(__v); - - --__block_count; - __block = __bin._M_first[0]; - while (__block_count-- > 0) - { - char* __c = reinterpret_cast<char*>(__block) + __bin_size; - __block->_M_next = reinterpret_cast<_Block_record*>(__c); - __block = __block->_M_next; - } - __block->_M_next = NULL; - } - } - - __block = __bin._M_first[__thread_id]; - __bin._M_first[__thread_id] = __bin._M_first[__thread_id]->_M_next; -#ifdef __GTHREADS - if (__gthread_active_p()) - { - __block->_M_thread_id = __thread_id; - --__bin._M_free[__thread_id]; - ++__bin._M_used[__thread_id]; - } -#endif - - char* __c = reinterpret_cast<char*>(__block) + _S_options._M_align; - return static_cast<_Tp*>(static_cast<void*>(__c)); - } - - template<typename _Tp> - void - __mt_alloc<_Tp>:: - deallocate(pointer __p, size_type __n) - { - // Requests larger than _M_max_bytes are handled by operators - // new/delete directly. - const size_t __bytes = __n * sizeof(_Tp); - if (__bytes > _S_options._M_max_bytes || _S_options._M_force_new) - { - ::operator delete(__p); - return; - } - - // Round up to power of 2 and figure out which bin to use. - const size_t __which = _S_binmap[__bytes]; - const _Bin_record& __bin = _S_bin[__which]; - - char* __c = reinterpret_cast<char*>(__p) - _S_options._M_align; - _Block_record* __block = reinterpret_cast<_Block_record*>(__c); - -#ifdef __GTHREADS - if (__gthread_active_p()) - { - // Calculate the number of records to remove from our freelist: - // in order to avoid too much contention we wait until the - // number of records is "high enough". - const size_t __thread_id = _S_get_thread_id(); - - long __remove = ((__bin._M_free[__thread_id] - * _S_options._M_freelist_headroom) - - __bin._M_used[__thread_id]); - if (__remove > static_cast<long>(100 * (_S_bin_size - __which) - * _S_options._M_freelist_headroom) - && __remove > static_cast<long>(__bin._M_free[__thread_id])) - { - _Block_record* __tmp = __bin._M_first[__thread_id]; - _Block_record* __first = __tmp; - __remove /= _S_options._M_freelist_headroom; - const long __removed = __remove; - --__remove; - while (__remove-- > 0) - __tmp = __tmp->_M_next; - __bin._M_first[__thread_id] = __tmp->_M_next; - __bin._M_free[__thread_id] -= __removed; - - __gthread_mutex_lock(__bin._M_mutex); - __tmp->_M_next = __bin._M_first[0]; - __bin._M_first[0] = __first; - __bin._M_free[0] += __removed; - __gthread_mutex_unlock(__bin._M_mutex); - } - - // Return this block to our list and update counters and - // owner id as needed. - --__bin._M_used[__block->_M_thread_id]; - - __block->_M_next = __bin._M_first[__thread_id]; - __bin._M_first[__thread_id] = __block; - - ++__bin._M_free[__thread_id]; - } - else -#endif - { - // Single threaded application - return to global pool. - __block->_M_next = __bin._M_first[0]; - __bin._M_first[0] = __block; - } - } - - template<typename _Tp> - void - __mt_alloc<_Tp>:: - _S_initialize() - { - // This method is called on the first allocation (when _S_init is still - // false) to create the bins. - - // Ensure that the static initialization of _S_options has - // happened. This depends on (a) _M_align == 0 being an invalid - // value that is only present at startup, and (b) the real - // static initialization that happens later not actually - // changing anything. - if (_S_options._M_align == 0) - new (&_S_options) _Tune; - - // _M_force_new must not change after the first allocate(), - // which in turn calls this method, so if it's false, it's false - // forever and we don't need to return here ever again. - if (_S_options._M_force_new) - { - _S_init = true; - return; - } - - // Calculate the number of bins required based on _M_max_bytes. - // _S_bin_size is statically-initialized to one. - size_t __bin_size = _S_options._M_min_bin; - while (_S_options._M_max_bytes > __bin_size) - { - __bin_size <<= 1; - ++_S_bin_size; - } - - // Setup the bin map for quick lookup of the relevant bin. - const size_t __j = (_S_options._M_max_bytes + 1) * sizeof(_Binmap_type); - _S_binmap = static_cast<_Binmap_type*>(::operator new(__j)); - - _Binmap_type* __bp = _S_binmap; - _Binmap_type __bin_max = _S_options._M_min_bin; - _Binmap_type __bint = 0; - for (_Binmap_type __ct = 0; __ct <= _S_options._M_max_bytes; ++__ct) - { - if (__ct > __bin_max) - { - __bin_max <<= 1; - ++__bint; - } - *__bp++ = __bint; - } - - // Initialize _S_bin and its members. - void* __v = ::operator new(sizeof(_Bin_record) * _S_bin_size); - _S_bin = static_cast<_Bin_record*>(__v); - - // If __gthread_active_p() create and initialize the list of - // free thread ids. Single threaded applications use thread id 0 - // directly and have no need for this. -#ifdef __GTHREADS - if (__gthread_active_p()) - { - const size_t __k = sizeof(_Thread_record) * _S_options._M_max_threads; - __v = ::operator new(__k); - _S_thread_freelist_first = static_cast<_Thread_record*>(__v); - - // NOTE! The first assignable thread id is 1 since the - // global pool uses id 0 - size_t __i; - for (__i = 1; __i < _S_options._M_max_threads; ++__i) - { - _Thread_record& __tr = _S_thread_freelist_first[__i - 1]; - __tr._M_next = &_S_thread_freelist_first[__i]; - __tr._M_id = __i; - } - - // Set last record. - _S_thread_freelist_first[__i - 1]._M_next = NULL; - _S_thread_freelist_first[__i - 1]._M_id = __i; - - // Make sure this is initialized. -#ifndef __GTHREAD_MUTEX_INIT - __GTHREAD_MUTEX_INIT_FUNCTION(&_S_thread_freelist_mutex); -#endif - // Initialize per thread key to hold pointer to - // _S_thread_freelist. - __gthread_key_create(&_S_thread_key, _S_destroy_thread_key); - - const size_t __max_threads = _S_options._M_max_threads + 1; - for (size_t __n = 0; __n < _S_bin_size; ++__n) - { - _Bin_record& __bin = _S_bin[__n]; - __v = ::operator new(sizeof(_Block_record*) * __max_threads); - __bin._M_first = static_cast<_Block_record**>(__v); - - __v = ::operator new(sizeof(size_t) * __max_threads); - __bin._M_free = static_cast<size_t*>(__v); - - __v = ::operator new(sizeof(size_t) * __max_threads); - __bin._M_used = static_cast<size_t*>(__v); - - __v = ::operator new(sizeof(__gthread_mutex_t)); - __bin._M_mutex = static_cast<__gthread_mutex_t*>(__v); - -#ifdef __GTHREAD_MUTEX_INIT - { - // Do not copy a POSIX/gthr mutex once in use. - __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT; - *__bin._M_mutex = __tmp; - } -#else - { __GTHREAD_MUTEX_INIT_FUNCTION(__bin._M_mutex); } -#endif - - for (size_t __threadn = 0; __threadn < __max_threads; - ++__threadn) - { - __bin._M_first[__threadn] = NULL; - __bin._M_free[__threadn] = 0; - __bin._M_used[__threadn] = 0; - } - } - } - else -#endif - for (size_t __n = 0; __n < _S_bin_size; ++__n) - { - _Bin_record& __bin = _S_bin[__n]; - __v = ::operator new(sizeof(_Block_record*)); - __bin._M_first = static_cast<_Block_record**>(__v); - __bin._M_first[0] = NULL; - } - - _S_init = true; - } - - template<typename _Tp> - size_t - __mt_alloc<_Tp>:: - _S_get_thread_id() - { -#ifdef __GTHREADS - // If we have thread support and it's active we check the thread - // key value and return its id or if it's not set we take the - // first record from _S_thread_freelist and sets the key and - // returns it's id. - if (__gthread_active_p()) - { - _Thread_record* __freelist_pos = - static_cast<_Thread_record*>(__gthread_getspecific(_S_thread_key)); - if (__freelist_pos == NULL) - { - // Since _S_options._M_max_threads must be larger than - // the theoretical max number of threads of the OS the - // list can never be empty. - __gthread_mutex_lock(&_S_thread_freelist_mutex); - __freelist_pos = _S_thread_freelist_first; - _S_thread_freelist_first = _S_thread_freelist_first->_M_next; - __gthread_mutex_unlock(&_S_thread_freelist_mutex); - - __gthread_setspecific(_S_thread_key, - static_cast<void*>(__freelist_pos)); - } - return __freelist_pos->_M_id; - } -#endif - // Otherwise (no thread support or inactive) all requests are - // served from the global pool 0. - return 0; - } - -#ifdef __GTHREADS - template<typename _Tp> - void - __mt_alloc<_Tp>:: - _S_destroy_thread_key(void* __freelist_pos) - { - // Return this thread id record to front of thread_freelist. - __gthread_mutex_lock(&_S_thread_freelist_mutex); - _Thread_record* __tr = static_cast<_Thread_record*>(__freelist_pos); - __tr->_M_next = _S_thread_freelist_first; - _S_thread_freelist_first = __tr; - __gthread_mutex_unlock(&_S_thread_freelist_mutex); - } -#endif - - template<typename _Tp> - inline bool - operator==(const __mt_alloc<_Tp>&, const __mt_alloc<_Tp>&) - { return true; } - - template<typename _Tp> - inline bool - operator!=(const __mt_alloc<_Tp>&, const __mt_alloc<_Tp>&) - { return false; } - - template<typename _Tp> - bool __mt_alloc<_Tp>::_S_init = false; - - template<typename _Tp> - typename __mt_alloc<_Tp>::_Tune __mt_alloc<_Tp>::_S_options; - - template<typename _Tp> - typename __mt_alloc<_Tp>::_Binmap_type* __mt_alloc<_Tp>::_S_binmap; - - template<typename _Tp> - typename __mt_alloc<_Tp>::_Bin_record* volatile __mt_alloc<_Tp>::_S_bin; - - template<typename _Tp> - size_t __mt_alloc<_Tp>::_S_bin_size = 1; - - // Actual initialization in _S_initialize(). -#ifdef __GTHREADS - template<typename _Tp> - __gthread_once_t __mt_alloc<_Tp>::_S_once = __GTHREAD_ONCE_INIT; - - template<typename _Tp> - typename __mt_alloc<_Tp>::_Thread_record* - volatile __mt_alloc<_Tp>::_S_thread_freelist_first = NULL; - - template<typename _Tp> - __gthread_key_t __mt_alloc<_Tp>::_S_thread_key; - - template<typename _Tp> - __gthread_mutex_t -#ifdef __GTHREAD_MUTEX_INIT - __mt_alloc<_Tp>::_S_thread_freelist_mutex = __GTHREAD_MUTEX_INIT; -#else - __mt_alloc<_Tp>::_S_thread_freelist_mutex; -#endif -#endif -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/new_allocator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/new_allocator.h deleted file mode 100644 index 1b0b4f61079..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/new_allocator.h +++ /dev/null @@ -1,113 +0,0 @@ -// Allocator that wraps operator new -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _NEW_ALLOCATOR_H -#define _NEW_ALLOCATOR_H 1 - -#include <new> - -namespace __gnu_cxx -{ - /** - * @brief An allocator that uses global new, as per [20.4]. - * - * This is precisely the allocator defined in the C++ Standard. - * - all allocation calls operator new - * - all deallocation calls operator delete - * - * (See @link Allocators allocators info @endlink for more.) - */ - template<typename _Tp> - class new_allocator - { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef _Tp* pointer; - typedef const _Tp* const_pointer; - typedef _Tp& reference; - typedef const _Tp& const_reference; - typedef _Tp value_type; - - template<typename _Tp1> - struct rebind - { typedef new_allocator<_Tp1> other; }; - - new_allocator() throw() { } - - new_allocator(const new_allocator&) throw() { } - - template<typename _Tp1> - new_allocator(const new_allocator<_Tp1>&) throw() { } - - ~new_allocator() throw() { } - - pointer - address(reference __x) const { return &__x; } - - const_pointer - address(const_reference __x) const { return &__x; } - - // NB: __n is permitted to be 0. The C++ standard says nothing - // about what the return value is when __n == 0. - pointer - allocate(size_type __n, const void* = 0) - { return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp))); } - - // __p is not permitted to be a null pointer. - void - deallocate(pointer __p, size_type) - { ::operator delete(__p); } - - size_type - max_size() const throw() - { return size_t(-1) / sizeof(_Tp); } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 402. wrong new expression in [some_] allocator::construct - void - construct(pointer __p, const _Tp& __val) - { ::new(__p) _Tp(__val); } - - void - destroy(pointer __p) { __p->~_Tp(); } - }; - - template<typename _Tp> - inline bool - operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&) - { return true; } - - template<typename _Tp> - inline bool - operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&) - { return false; } -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/numeric b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/numeric deleted file mode 100644 index 40edf07fe3d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/numeric +++ /dev/null @@ -1,148 +0,0 @@ -// Numeric extensions -*- C++ -*- - -// Copyright (C) 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file ext/numeric - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _EXT_NUMERIC -#define _EXT_NUMERIC 1 - -#pragma GCC system_header - -#include <bits/concept_check.h> -#include <numeric> - -#include <ext/functional> // For identity_element - -namespace __gnu_cxx -{ - // Returns __x ** __n, where __n >= 0. _Note that "multiplication" - // is required to be associative, but not necessarily commutative. - template<typename _Tp, typename _Integer, typename _MonoidOperation> - _Tp - __power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op) - { - if (__n == 0) - return identity_element(__monoid_op); - else { - while ((__n & 1) == 0) { - __n >>= 1; - __x = __monoid_op(__x, __x); - } - - _Tp __result = __x; - __n >>= 1; - while (__n != 0) { - __x = __monoid_op(__x, __x); - if ((__n & 1) != 0) - __result = __monoid_op(__result, __x); - __n >>= 1; - } - return __result; - } - } - - template<typename _Tp, typename _Integer> - inline _Tp - __power(_Tp __x, _Integer __n) - { return __power(__x, __n, std::multiplies<_Tp>()); } - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - // Alias for the internal name __power. Note that power is an extension, - // not part of the C++ standard. - template<typename _Tp, typename _Integer, typename _MonoidOperation> - inline _Tp - power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op) - { return __power(__x, __n, __monoid_op); } - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - template<typename _Tp, typename _Integer> - inline _Tp - power(_Tp __x, _Integer __n) - { return __power(__x, __n); } - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - // iota is not part of the C++ standard. It is an extension. - template<typename _ForwardIter, typename _Tp> - void - iota(_ForwardIter __first, _ForwardIter __last, _Tp __value) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>) - __glibcxx_function_requires(_ConvertibleConcept<_Tp, - typename std::iterator_traits<_ForwardIter>::value_type>) - - while (__first != __last) - *__first++ = __value++; - } -} // namespace __gnu_cxx - -#endif - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/pod_char_traits.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/pod_char_traits.h deleted file mode 100644 index c69025e005d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/pod_char_traits.h +++ /dev/null @@ -1,158 +0,0 @@ -// POD character, std::char_traits specialization -*- C++ -*- - -// Copyright (C) 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Gabriel Dos Reis <gdr@integrable-solutions.net> -// Benjamin Kosnik <bkoz@redhat.com> - -#ifndef _POD_CHAR_TRAITS_H -#define _POD_CHAR_TRAITS_H 1 - -#include <string> - -namespace __gnu_cxx -{ - template<typename V, typename I, typename S = mbstate_t> - struct character - { - typedef V value_type; - typedef I int_type; - typedef S state_type; - value_type value; - }; - - template<typename V, typename I> - inline bool - operator==(const character<V, I>& lhs, const character<V, I>& rhs) - { return lhs.value == rhs.value; } - - template<typename V, typename I> - inline bool - operator<(const character<V, I>& lhs, const character<V, I>& rhs) - { return lhs.value < rhs.value; } -} // namespace __gnu_cxx - -namespace std -{ - // Provide std::char_traits specialization. - template<typename V, typename I, typename S> - struct char_traits<__gnu_cxx::character<V, I, S> > - { - typedef __gnu_cxx::character<V, I, S> char_type; - - // NB: This type should be bigger than char_type, so as to - // properly hold EOF values in addition to the full range of - // char_type values. - // Also, assumes - // int_type(value_type) is valid. - // int_type(-1) is possible. - typedef typename char_type::int_type int_type; - typedef typename char_type::state_type state_type; - typedef fpos<state_type> pos_type; - typedef streamoff off_type; - - static void - assign(char_type& __c1, const char_type& __c2) - { __c1 = __c2; } - - static bool - eq(const char_type& __c1, const char_type& __c2) - { return __c1 == __c2; } - - static bool - lt(const char_type& __c1, const char_type& __c2) - { return __c1 < __c2; } - - static int - compare(const char_type* __s1, const char_type* __s2, size_t __n) - { - for (size_t __i = 0; __i < __n; ++__i) - if (!eq(__s1[__i], __s2[__i])) - return lt(__s1[__i], __s2[__i]) ? -1 : 1; - return 0; - } - - static size_t - length(const char_type* __s) - { - const char_type* __p = __s; - while (__p->value) - ++__p; - return (__p - __s); - } - - static const char_type* - find(const char_type* __s, size_t __n, const char_type& __a) - { - for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p) - if (*__p == __a) - return __p; - return 0; - } - - static char_type* - move(char_type* __s1, const char_type* __s2, size_t __n) - { return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); } - - static char_type* - copy(char_type* __s1, const char_type* __s2, size_t __n) - { return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); } - - static char_type* - assign(char_type* __s, size_t __n, char_type __a) - { - for (char_type* __p = __s; __p < __s + __n; ++__p) - assign(*__p, __a); - return __s; - } - - static char_type - to_char_type(const int_type& __c) - { - char_type __r = { __c }; - return __r; - } - - static int_type - to_int_type(const char_type& __c) - { return int_type(__c.value); } - - static bool - eq_int_type(const int_type& __c1, const int_type& __c2) - { return __c1 == __c2; } - - static int_type - eof() { return static_cast<int_type>(-1); } - - static int_type - not_eof(const int_type& __c) - { return eq_int_type(__c, eof()) ? int_type(0) : __c; } - }; -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/pool_allocator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/pool_allocator.h deleted file mode 100644 index 0f087a03c1e..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/pool_allocator.h +++ /dev/null @@ -1,255 +0,0 @@ -// Allocators -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1996-1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file ext/pool_allocator.h - * This file is a GNU extension to the Standard C++ Library. - * You should only include this header if you are using GCC 3 or later. - */ -#ifndef _POOL_ALLOCATOR_H -#define _POOL_ALLOCATOR_H 1 - -#include <bits/c++config.h> -#include <cstdlib> -#include <new> -#include <bits/functexcept.h> -#include <bits/atomicity.h> -#include <bits/concurrence.h> - -namespace __gnu_cxx -{ - /** - * @if maint - * Uses various allocators to fulfill underlying requests (and makes as - * few requests as possible when in default high-speed pool mode). - * - * Important implementation properties: - * 0. If globally mandated, then allocate objects from new - * 1. If the clients request an object of size > _S_max_bytes, the resulting - * object will be obtained directly from new - * 2. In all other cases, we allocate an object of size exactly - * _S_round_up(requested_size). Thus the client has enough size - * information that we can return the object to the proper free list - * without permanently losing part of the object. - * - * @endif - * (See @link Allocators allocators info @endlink for more.) - */ - class __pool_alloc_base - { - protected: - - enum { _S_align = 8 }; - enum { _S_max_bytes = 128 }; - enum { _S_free_list_size = _S_max_bytes / _S_align }; - - union _Obj - { - union _Obj* _M_free_list_link; - char _M_client_data[1]; // The client sees this. - }; - - static _Obj* volatile _S_free_list[_S_free_list_size]; - - // Chunk allocation state. - static char* _S_start_free; - static char* _S_end_free; - static size_t _S_heap_size; - - size_t - _M_round_up(size_t __bytes) - { return ((__bytes + (size_t)_S_align - 1) & ~((size_t)_S_align - 1)); } - - _Obj* volatile* - _M_get_free_list(size_t __bytes); - - mutex_type& - _M_get_mutex(); - - // Returns an object of size __n, and optionally adds to size __n - // free list. - void* - _M_refill(size_t __n); - - // Allocates a chunk for nobjs of size size. nobjs may be reduced - // if it is inconvenient to allocate the requested number. - char* - _M_allocate_chunk(size_t __n, int& __nobjs); - }; - - - template<typename _Tp> - class __pool_alloc : private __pool_alloc_base - { - private: - static _Atomic_word _S_force_new; - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef _Tp* pointer; - typedef const _Tp* const_pointer; - typedef _Tp& reference; - typedef const _Tp& const_reference; - typedef _Tp value_type; - - template<typename _Tp1> - struct rebind - { typedef __pool_alloc<_Tp1> other; }; - - __pool_alloc() throw() { } - - __pool_alloc(const __pool_alloc&) throw() { } - - template<typename _Tp1> - __pool_alloc(const __pool_alloc<_Tp1>&) throw() { } - - ~__pool_alloc() throw() { } - - pointer - address(reference __x) const { return &__x; } - - const_pointer - address(const_reference __x) const { return &__x; } - - size_type - max_size() const throw() - { return size_t(-1) / sizeof(_Tp); } - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 402. wrong new expression in [some_] allocator::construct - void - construct(pointer __p, const _Tp& __val) - { ::new(__p) _Tp(__val); } - - void - destroy(pointer __p) { __p->~_Tp(); } - - pointer - allocate(size_type __n, const void* = 0); - - void - deallocate(pointer __p, size_type __n); - }; - - template<typename _Tp> - inline bool - operator==(const __pool_alloc<_Tp>&, const __pool_alloc<_Tp>&) - { return true; } - - template<typename _Tp> - inline bool - operator!=(const __pool_alloc<_Tp>&, const __pool_alloc<_Tp>&) - { return false; } - - template<typename _Tp> - _Atomic_word - __pool_alloc<_Tp>::_S_force_new; - - template<typename _Tp> - _Tp* - __pool_alloc<_Tp>::allocate(size_type __n, const void*) - { - pointer __ret = 0; - if (__n) - { - if (__n <= max_size()) - { - // If there is a race through here, assume answer from getenv - // will resolve in same direction. Inspired by techniques - // to efficiently support threading found in basic_string.h. - if (_S_force_new == 0) - { - if (getenv("GLIBCXX_FORCE_NEW")) - __atomic_add(&_S_force_new, 1); - else - __atomic_add(&_S_force_new, -1); - } - - const size_t __bytes = __n * sizeof(_Tp); - if (__bytes > size_t(_S_max_bytes) || _S_force_new == 1) - __ret = static_cast<_Tp*>(::operator new(__bytes)); - else - { - _Obj* volatile* __free_list = _M_get_free_list(__bytes); - - lock sentry(_M_get_mutex()); - _Obj* __restrict__ __result = *__free_list; - if (__builtin_expect(__result == 0, 0)) - __ret = static_cast<_Tp*>(_M_refill(_M_round_up(__bytes))); - else - { - *__free_list = __result->_M_free_list_link; - __ret = reinterpret_cast<_Tp*>(__result); - } - if (__builtin_expect(__ret == 0, 0)) - std::__throw_bad_alloc(); - } - } - else - std::__throw_bad_alloc(); - } - return __ret; - } - - template<typename _Tp> - void - __pool_alloc<_Tp>::deallocate(pointer __p, size_type __n) - { - if (__n) - { - const size_t __bytes = __n * sizeof(_Tp); - if (__bytes > static_cast<size_t>(_S_max_bytes) || _S_force_new == 1) - ::operator delete(__p); - else - { - _Obj* volatile* __free_list = _M_get_free_list(__bytes); - _Obj* __q = reinterpret_cast<_Obj*>(__p); - - lock sentry(_M_get_mutex()); - __q ->_M_free_list_link = *__free_list; - *__free_list = __q; - } - } - } -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/rb_tree b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/rb_tree deleted file mode 100644 index 2c38b39706e..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/rb_tree +++ /dev/null @@ -1,97 +0,0 @@ -// rb_tree extension -*- C++ -*- - -// Copyright (C) 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file ext/rb_tree - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _RB_TREE -#define _RB_TREE 1 - -#pragma GCC system_header - -#include <bits/stl_tree.h> - -namespace __gnu_cxx -{ - using std::_Rb_tree; - using std::allocator; - - // Class rb_tree is not part of the C++ standard. It is provided for - // compatibility with the HP STL. - - /** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo - */ - template <class _Key, class _Value, class _KeyOfValue, class _Compare, - class _Alloc = allocator<_Value> > - struct rb_tree : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc> - { - typedef _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc> _Base; - typedef typename _Base::allocator_type allocator_type; - - rb_tree(const _Compare& __comp = _Compare(), - const allocator_type& __a = allocator_type()) - : _Base(__comp, __a) { } - - ~rb_tree() { } - }; -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/rope b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/rope deleted file mode 100644 index b4bf2c9650c..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/rope +++ /dev/null @@ -1,2494 +0,0 @@ -// SGI's rope class -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file ext/rope - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _ROPE -#define _ROPE 1 - -#include <bits/stl_algobase.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_algo.h> -#include <bits/stl_function.h> -#include <bits/stl_numeric.h> -#include <bits/allocator.h> -#include <ext/hash_fun.h> - -# ifdef __GC -# define __GC_CONST const -# else -# include <bits/gthr.h> -# define __GC_CONST // constant except for deallocation -# endif - -#include <ext/memory> // For uninitialized_copy_n - -namespace __gnu_cxx -{ -using std::size_t; -using std::ptrdiff_t; -using std::allocator; -using std::iterator; -using std::reverse_iterator; -using std::_Destroy; - -// The _S_eos function is used for those functions that -// convert to/from C-like strings to detect the end of the string. - -// The end-of-C-string character. -// This is what the draft standard says it should be. -template <class _CharT> -inline _CharT _S_eos(_CharT*) { return _CharT(); } - -// Test for basic character types. -// For basic character types leaves having a trailing eos. -template <class _CharT> -inline bool _S_is_basic_char_type(_CharT*) { return false; } -template <class _CharT> -inline bool _S_is_one_byte_char_type(_CharT*) { return false; } - -inline bool _S_is_basic_char_type(char*) { return true; } -inline bool _S_is_one_byte_char_type(char*) { return true; } -inline bool _S_is_basic_char_type(wchar_t*) { return true; } - -// Store an eos iff _CharT is a basic character type. -// Do not reference _S_eos if it isn't. -template <class _CharT> -inline void _S_cond_store_eos(_CharT&) {} - -inline void _S_cond_store_eos(char& __c) { __c = 0; } -inline void _S_cond_store_eos(wchar_t& __c) { __c = 0; } - -// char_producers are logically functions that generate a section of -// a string. These can be convereted to ropes. The resulting rope -// invokes the char_producer on demand. This allows, for example, -// files to be viewed as ropes without reading the entire file. -template <class _CharT> -class char_producer { - public: - virtual ~char_producer() {}; - virtual void operator()(size_t __start_pos, size_t __len, - _CharT* __buffer) = 0; - // Buffer should really be an arbitrary output iterator. - // That way we could flatten directly into an ostream, etc. - // This is thoroughly impossible, since iterator types don't - // have runtime descriptions. -}; - -// Sequence buffers: -// -// Sequence must provide an append operation that appends an -// array to the sequence. Sequence buffers are useful only if -// appending an entire array is cheaper than appending element by element. -// This is true for many string representations. -// This should perhaps inherit from ostream<sequence::value_type> -// and be implemented correspondingly, so that they can be used -// for formatted. For the sake of portability, we don't do this yet. -// -// For now, sequence buffers behave as output iterators. But they also -// behave a little like basic_ostringstream<sequence::value_type> and a -// little like containers. - -template<class _Sequence, size_t _Buf_sz = 100> -class sequence_buffer : public iterator<std::output_iterator_tag,void,void,void,void> -{ - public: - typedef typename _Sequence::value_type value_type; - protected: - _Sequence* _M_prefix; - value_type _M_buffer[_Buf_sz]; - size_t _M_buf_count; - public: - void flush() { - _M_prefix->append(_M_buffer, _M_buffer + _M_buf_count); - _M_buf_count = 0; - } - ~sequence_buffer() { flush(); } - sequence_buffer() : _M_prefix(0), _M_buf_count(0) {} - sequence_buffer(const sequence_buffer& __x) { - _M_prefix = __x._M_prefix; - _M_buf_count = __x._M_buf_count; - std::copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer); - } - sequence_buffer(sequence_buffer& __x) { - __x.flush(); - _M_prefix = __x._M_prefix; - _M_buf_count = 0; - } - sequence_buffer(_Sequence& __s) : _M_prefix(&__s), _M_buf_count(0) {} - sequence_buffer& operator= (sequence_buffer& __x) { - __x.flush(); - _M_prefix = __x._M_prefix; - _M_buf_count = 0; - return *this; - } - sequence_buffer& operator= (const sequence_buffer& __x) { - _M_prefix = __x._M_prefix; - _M_buf_count = __x._M_buf_count; - std::copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer); - return *this; - } - void push_back(value_type __x) - { - if (_M_buf_count < _Buf_sz) { - _M_buffer[_M_buf_count] = __x; - ++_M_buf_count; - } else { - flush(); - _M_buffer[0] = __x; - _M_buf_count = 1; - } - } - void append(value_type* __s, size_t __len) - { - if (__len + _M_buf_count <= _Buf_sz) { - size_t __i = _M_buf_count; - for (size_t __j = 0; __j < __len; __i++, __j++) { - _M_buffer[__i] = __s[__j]; - } - _M_buf_count += __len; - } else if (0 == _M_buf_count) { - _M_prefix->append(__s, __s + __len); - } else { - flush(); - append(__s, __len); - } - } - sequence_buffer& write(value_type* __s, size_t __len) - { - append(__s, __len); - return *this; - } - sequence_buffer& put(value_type __x) - { - push_back(__x); - return *this; - } - sequence_buffer& operator=(const value_type& __rhs) - { - push_back(__rhs); - return *this; - } - sequence_buffer& operator*() { return *this; } - sequence_buffer& operator++() { return *this; } - sequence_buffer operator++(int) { return *this; } -}; - -// The following should be treated as private, at least for now. -template<class _CharT> -class _Rope_char_consumer { - public: - // If we had member templates, these should not be virtual. - // For now we need to use run-time parametrization where - // compile-time would do. Hence this should all be private - // for now. - // The symmetry with char_producer is accidental and temporary. - virtual ~_Rope_char_consumer() {}; - virtual bool operator()(const _CharT* __buffer, size_t __len) = 0; -}; - -// First a lot of forward declarations. The standard seems to require -// much stricter "declaration before use" than many of the implementations -// that preceded it. -template<class _CharT, class _Alloc = allocator<_CharT> > class rope; -template<class _CharT, class _Alloc> struct _Rope_RopeConcatenation; -template<class _CharT, class _Alloc> struct _Rope_RopeLeaf; -template<class _CharT, class _Alloc> struct _Rope_RopeFunction; -template<class _CharT, class _Alloc> struct _Rope_RopeSubstring; -template<class _CharT, class _Alloc> class _Rope_iterator; -template<class _CharT, class _Alloc> class _Rope_const_iterator; -template<class _CharT, class _Alloc> class _Rope_char_ref_proxy; -template<class _CharT, class _Alloc> class _Rope_char_ptr_proxy; - -template<class _CharT, class _Alloc> -bool operator== (const _Rope_char_ptr_proxy<_CharT,_Alloc>& __x, - const _Rope_char_ptr_proxy<_CharT,_Alloc>& __y); - -template<class _CharT, class _Alloc> -_Rope_const_iterator<_CharT,_Alloc> operator- - (const _Rope_const_iterator<_CharT,_Alloc>& __x, - ptrdiff_t __n); - -template<class _CharT, class _Alloc> -_Rope_const_iterator<_CharT,_Alloc> operator+ - (const _Rope_const_iterator<_CharT,_Alloc>& __x, - ptrdiff_t __n); - -template<class _CharT, class _Alloc> -_Rope_const_iterator<_CharT,_Alloc> operator+ - (ptrdiff_t __n, - const _Rope_const_iterator<_CharT,_Alloc>& __x); - -template<class _CharT, class _Alloc> -bool operator== - (const _Rope_const_iterator<_CharT,_Alloc>& __x, - const _Rope_const_iterator<_CharT,_Alloc>& __y); - -template<class _CharT, class _Alloc> -bool operator< - (const _Rope_const_iterator<_CharT,_Alloc>& __x, - const _Rope_const_iterator<_CharT,_Alloc>& __y); - -template<class _CharT, class _Alloc> -ptrdiff_t operator- - (const _Rope_const_iterator<_CharT,_Alloc>& __x, - const _Rope_const_iterator<_CharT,_Alloc>& __y); - -template<class _CharT, class _Alloc> -_Rope_iterator<_CharT,_Alloc> operator- - (const _Rope_iterator<_CharT,_Alloc>& __x, - ptrdiff_t __n); - -template<class _CharT, class _Alloc> -_Rope_iterator<_CharT,_Alloc> operator+ - (const _Rope_iterator<_CharT,_Alloc>& __x, - ptrdiff_t __n); - -template<class _CharT, class _Alloc> -_Rope_iterator<_CharT,_Alloc> operator+ - (ptrdiff_t __n, - const _Rope_iterator<_CharT,_Alloc>& __x); - -template<class _CharT, class _Alloc> -bool operator== - (const _Rope_iterator<_CharT,_Alloc>& __x, - const _Rope_iterator<_CharT,_Alloc>& __y); - -template<class _CharT, class _Alloc> -bool operator< - (const _Rope_iterator<_CharT,_Alloc>& __x, - const _Rope_iterator<_CharT,_Alloc>& __y); - -template<class _CharT, class _Alloc> -ptrdiff_t operator- - (const _Rope_iterator<_CharT,_Alloc>& __x, - const _Rope_iterator<_CharT,_Alloc>& __y); - -template<class _CharT, class _Alloc> -rope<_CharT,_Alloc> operator+ (const rope<_CharT,_Alloc>& __left, - const rope<_CharT,_Alloc>& __right); - -template<class _CharT, class _Alloc> -rope<_CharT,_Alloc> operator+ (const rope<_CharT,_Alloc>& __left, - const _CharT* __right); - -template<class _CharT, class _Alloc> -rope<_CharT,_Alloc> operator+ (const rope<_CharT,_Alloc>& __left, - _CharT __right); - -// Some helpers, so we can use power on ropes. -// See below for why this isn't local to the implementation. - -// This uses a nonstandard refcount convention. -// The result has refcount 0. -template<class _CharT, class _Alloc> -struct _Rope_Concat_fn - : public std::binary_function<rope<_CharT,_Alloc>, rope<_CharT,_Alloc>, - rope<_CharT,_Alloc> > { - rope<_CharT,_Alloc> operator() (const rope<_CharT,_Alloc>& __x, - const rope<_CharT,_Alloc>& __y) { - return __x + __y; - } -}; - -template <class _CharT, class _Alloc> -inline -rope<_CharT,_Alloc> -identity_element(_Rope_Concat_fn<_CharT, _Alloc>) -{ - return rope<_CharT,_Alloc>(); -} - - - // Class _Refcount_Base provides a type, _RC_t, a data member, - // _M_ref_count, and member functions _M_incr and _M_decr, which perform - // atomic preincrement/predecrement. The constructor initializes - // _M_ref_count. - struct _Refcount_Base - { - // The type _RC_t - typedef size_t _RC_t; - - // The data member _M_ref_count - volatile _RC_t _M_ref_count; - - // Constructor - __gthread_mutex_t _M_ref_count_lock; - - _Refcount_Base(_RC_t __n) : _M_ref_count(__n), _M_ref_count_lock() - { -#ifdef __GTHREAD_MUTEX_INIT - __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT; - _M_ref_count_lock = __tmp; -#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION) - __GTHREAD_MUTEX_INIT_FUNCTION (&_M_ref_count_lock); -#else -#error __GTHREAD_MUTEX_INIT or __GTHREAD_MUTEX_INIT_FUNCTION should be defined by gthr.h abstraction layer, report problem to libstdc++@gcc.gnu.org. -#endif - } - - void - _M_incr() - { - __gthread_mutex_lock(&_M_ref_count_lock); - ++_M_ref_count; - __gthread_mutex_unlock(&_M_ref_count_lock); - } - - _RC_t - _M_decr() - { - __gthread_mutex_lock(&_M_ref_count_lock); - volatile _RC_t __tmp = --_M_ref_count; - __gthread_mutex_unlock(&_M_ref_count_lock); - return __tmp; - } - }; - -// -// What follows should really be local to rope. Unfortunately, -// that doesn't work, since it makes it impossible to define generic -// equality on rope iterators. According to the draft standard, the -// template parameters for such an equality operator cannot be inferred -// from the occurrence of a member class as a parameter. -// (SGI compilers in fact allow this, but the __result wouldn't be -// portable.) -// Similarly, some of the static member functions are member functions -// only to avoid polluting the global namespace, and to circumvent -// restrictions on type inference for template functions. -// - -// -// The internal data structure for representing a rope. This is -// private to the implementation. A rope is really just a pointer -// to one of these. -// -// A few basic functions for manipulating this data structure -// are members of _RopeRep. Most of the more complex algorithms -// are implemented as rope members. -// -// Some of the static member functions of _RopeRep have identically -// named functions in rope that simply invoke the _RopeRep versions. - -#define __ROPE_DEFINE_ALLOCS(__a) \ - __ROPE_DEFINE_ALLOC(_CharT,_Data) /* character data */ \ - typedef _Rope_RopeConcatenation<_CharT,__a> __C; \ - __ROPE_DEFINE_ALLOC(__C,_C) \ - typedef _Rope_RopeLeaf<_CharT,__a> __L; \ - __ROPE_DEFINE_ALLOC(__L,_L) \ - typedef _Rope_RopeFunction<_CharT,__a> __F; \ - __ROPE_DEFINE_ALLOC(__F,_F) \ - typedef _Rope_RopeSubstring<_CharT,__a> __S; \ - __ROPE_DEFINE_ALLOC(__S,_S) - -// Internal rope nodes potentially store a copy of the allocator -// instance used to allocate them. This is mostly redundant. -// But the alternative would be to pass allocator instances around -// in some form to nearly all internal functions, since any pointer -// assignment may result in a zero reference count and thus require -// deallocation. - -#define __STATIC_IF_SGI_ALLOC /* not static */ - -template <class _CharT, class _Alloc> -struct _Rope_rep_base -: public _Alloc -{ - typedef _Alloc allocator_type; - - allocator_type - get_allocator() const { return *static_cast<const _Alloc*>(this); } - - _Rope_rep_base(size_t __size, const allocator_type&) - : _M_size(__size) {} - - size_t _M_size; - -# define __ROPE_DEFINE_ALLOC(_Tp, __name) \ - typedef typename \ - _Alloc::template rebind<_Tp>::other __name##Alloc; \ - static _Tp* __name##_allocate(size_t __n) \ - { return __name##Alloc().allocate(__n); } \ - static void __name##_deallocate(_Tp *__p, size_t __n) \ - { __name##Alloc().deallocate(__p, __n); } - __ROPE_DEFINE_ALLOCS(_Alloc) -# undef __ROPE_DEFINE_ALLOC -}; - -namespace _Rope_constants -{ - enum { _S_max_rope_depth = 45 }; - enum _Tag {_S_leaf, _S_concat, _S_substringfn, _S_function}; -} - -template<class _CharT, class _Alloc> -struct _Rope_RopeRep : public _Rope_rep_base<_CharT,_Alloc> -# ifndef __GC - , _Refcount_Base -# endif -{ - public: - _Rope_constants::_Tag _M_tag:8; - bool _M_is_balanced:8; - unsigned char _M_depth; - __GC_CONST _CharT* _M_c_string; - __gthread_mutex_t _M_c_string_lock; - /* Flattened version of string, if needed. */ - /* typically 0. */ - /* If it's not 0, then the memory is owned */ - /* by this node. */ - /* In the case of a leaf, this may point to */ - /* the same memory as the data field. */ - typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type - allocator_type; - using _Rope_rep_base<_CharT,_Alloc>::get_allocator; - _Rope_RopeRep(_Rope_constants::_Tag __t, int __d, bool __b, size_t __size, - allocator_type __a) - : _Rope_rep_base<_CharT,_Alloc>(__size, __a), -# ifndef __GC - _Refcount_Base(1), -# endif - _M_tag(__t), _M_is_balanced(__b), _M_depth(__d), _M_c_string(0) -#ifdef __GTHREAD_MUTEX_INIT - { - // Do not copy a POSIX/gthr mutex once in use. However, bits are bits. - __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT; - _M_c_string_lock = __tmp; - } -#else - { __GTHREAD_MUTEX_INIT_FUNCTION (&_M_c_string_lock); } -#endif -# ifdef __GC - void _M_incr () {} -# endif - static void _S_free_string(__GC_CONST _CharT*, size_t __len, - allocator_type __a); -# define __STL_FREE_STRING(__s, __l, __a) _S_free_string(__s, __l, __a); - // Deallocate data section of a leaf. - // This shouldn't be a member function. - // But its hard to do anything else at the - // moment, because it's templatized w.r.t. - // an allocator. - // Does nothing if __GC is defined. -# ifndef __GC - void _M_free_c_string(); - void _M_free_tree(); - // Deallocate t. Assumes t is not 0. - void _M_unref_nonnil() - { - if (0 == _M_decr()) _M_free_tree(); - } - void _M_ref_nonnil() - { - _M_incr(); - } - static void _S_unref(_Rope_RopeRep* __t) - { - if (0 != __t) { - __t->_M_unref_nonnil(); - } - } - static void _S_ref(_Rope_RopeRep* __t) - { - if (0 != __t) __t->_M_incr(); - } - static void _S_free_if_unref(_Rope_RopeRep* __t) - { - if (0 != __t && 0 == __t->_M_ref_count) __t->_M_free_tree(); - } -# else /* __GC */ - void _M_unref_nonnil() {} - void _M_ref_nonnil() {} - static void _S_unref(_Rope_RopeRep*) {} - static void _S_ref(_Rope_RopeRep*) {} - static void _S_free_if_unref(_Rope_RopeRep*) {} -# endif -protected: - _Rope_RopeRep& - operator=(const _Rope_RopeRep&); - - _Rope_RopeRep(const _Rope_RopeRep&); -}; - -template<class _CharT, class _Alloc> -struct _Rope_RopeLeaf : public _Rope_RopeRep<_CharT,_Alloc> { - public: - // Apparently needed by VC++ - // The data fields of leaves are allocated with some - // extra space, to accommodate future growth and for basic - // character types, to hold a trailing eos character. - enum { _S_alloc_granularity = 8 }; - static size_t _S_rounded_up_size(size_t __n) { - size_t __size_with_eos; - - if (_S_is_basic_char_type((_CharT*)0)) { - __size_with_eos = __n + 1; - } else { - __size_with_eos = __n; - } -# ifdef __GC - return __size_with_eos; -# else - // Allow slop for in-place expansion. - return (__size_with_eos + _S_alloc_granularity-1) - &~ (_S_alloc_granularity-1); -# endif - } - __GC_CONST _CharT* _M_data; /* Not necessarily 0 terminated. */ - /* The allocated size is */ - /* _S_rounded_up_size(size), except */ - /* in the GC case, in which it */ - /* doesn't matter. */ - typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type - allocator_type; - _Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size, allocator_type __a) - : _Rope_RopeRep<_CharT,_Alloc>(_Rope_constants::_S_leaf, 0, true, __size, __a), _M_data(__d) - { - if (_S_is_basic_char_type((_CharT *)0)) { - // already eos terminated. - this->_M_c_string = __d; - } - } - // The constructor assumes that d has been allocated with - // the proper allocator and the properly padded size. - // In contrast, the destructor deallocates the data: -# ifndef __GC - ~_Rope_RopeLeaf() throw() { - if (_M_data != this->_M_c_string) { - this->_M_free_c_string(); - } - __STL_FREE_STRING(_M_data, this->_M_size, this->get_allocator()); - } -# endif -protected: - _Rope_RopeLeaf& - operator=(const _Rope_RopeLeaf&); - - _Rope_RopeLeaf(const _Rope_RopeLeaf&); -}; - -template<class _CharT, class _Alloc> -struct _Rope_RopeConcatenation : public _Rope_RopeRep<_CharT,_Alloc> { - public: - _Rope_RopeRep<_CharT,_Alloc>* _M_left; - _Rope_RopeRep<_CharT,_Alloc>* _M_right; - typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type - allocator_type; - _Rope_RopeConcatenation(_Rope_RopeRep<_CharT,_Alloc>* __l, - _Rope_RopeRep<_CharT,_Alloc>* __r, - allocator_type __a) - - : _Rope_RopeRep<_CharT,_Alloc>(_Rope_constants::_S_concat, - std::max(__l->_M_depth, __r->_M_depth) + 1, - false, - __l->_M_size + __r->_M_size, __a), - _M_left(__l), _M_right(__r) - {} -# ifndef __GC - ~_Rope_RopeConcatenation() throw() { - this->_M_free_c_string(); - _M_left->_M_unref_nonnil(); - _M_right->_M_unref_nonnil(); - } -# endif -protected: - _Rope_RopeConcatenation& - operator=(const _Rope_RopeConcatenation&); - - _Rope_RopeConcatenation(const _Rope_RopeConcatenation&); -}; - -template<class _CharT, class _Alloc> -struct _Rope_RopeFunction : public _Rope_RopeRep<_CharT,_Alloc> { - public: - char_producer<_CharT>* _M_fn; -# ifndef __GC - bool _M_delete_when_done; // Char_producer is owned by the - // rope and should be explicitly - // deleted when the rope becomes - // inaccessible. -# else - // In the GC case, we either register the rope for - // finalization, or not. Thus the field is unnecessary; - // the information is stored in the collector data structures. - // We do need a finalization procedure to be invoked by the - // collector. - static void _S_fn_finalization_proc(void * __tree, void *) { - delete ((_Rope_RopeFunction *)__tree) -> _M_fn; - } -# endif - typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type - allocator_type; - _Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size, - bool __d, allocator_type __a) - : _Rope_RopeRep<_CharT,_Alloc>(_Rope_constants::_S_function, - 0, true, __size, __a) - , _M_fn(__f) -# ifndef __GC - , _M_delete_when_done(__d) -# endif - { -# ifdef __GC - if (__d) { - GC_REGISTER_FINALIZER( - this, _Rope_RopeFunction::_S_fn_finalization_proc, 0, 0, 0); - } -# endif - } -# ifndef __GC - ~_Rope_RopeFunction() throw() { - this->_M_free_c_string(); - if (_M_delete_when_done) { - delete _M_fn; - } - } -# endif -protected: - _Rope_RopeFunction& - operator=(const _Rope_RopeFunction&); - - _Rope_RopeFunction(const _Rope_RopeFunction&); -}; -// Substring results are usually represented using just -// concatenation nodes. But in the case of very long flat ropes -// or ropes with a functional representation that isn't practical. -// In that case, we represent the __result as a special case of -// RopeFunction, whose char_producer points back to the rope itself. -// In all cases except repeated substring operations and -// deallocation, we treat the __result as a RopeFunction. -template<class _CharT, class _Alloc> -struct _Rope_RopeSubstring : public _Rope_RopeFunction<_CharT,_Alloc>, - public char_producer<_CharT> { - public: - // XXX this whole class should be rewritten. - _Rope_RopeRep<_CharT,_Alloc>* _M_base; // not 0 - size_t _M_start; - virtual void operator()(size_t __start_pos, size_t __req_len, - _CharT* __buffer) { - switch(_M_base->_M_tag) { - case _Rope_constants::_S_function: - case _Rope_constants::_S_substringfn: - { - char_producer<_CharT>* __fn = - ((_Rope_RopeFunction<_CharT,_Alloc>*)_M_base)->_M_fn; - (*__fn)(__start_pos + _M_start, __req_len, __buffer); - } - break; - case _Rope_constants::_S_leaf: - { - __GC_CONST _CharT* __s = - ((_Rope_RopeLeaf<_CharT,_Alloc>*)_M_base)->_M_data; - uninitialized_copy_n(__s + __start_pos + _M_start, __req_len, - __buffer); - } - break; - default: - break; - } - } - typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type - allocator_type; - _Rope_RopeSubstring(_Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s, - size_t __l, allocator_type __a) - : _Rope_RopeFunction<_CharT,_Alloc>(this, __l, false, __a), - char_producer<_CharT>(), - _M_base(__b), - _M_start(__s) - { -# ifndef __GC - _M_base->_M_ref_nonnil(); -# endif - this->_M_tag = _Rope_constants::_S_substringfn; - } - virtual ~_Rope_RopeSubstring() throw() - { -# ifndef __GC - _M_base->_M_unref_nonnil(); - // _M_free_c_string(); -- done by parent class -# endif - } -}; - - -// Self-destructing pointers to Rope_rep. -// These are not conventional smart pointers. Their -// only purpose in life is to ensure that unref is called -// on the pointer either at normal exit or if an exception -// is raised. It is the caller's responsibility to -// adjust reference counts when these pointers are initialized -// or assigned to. (This convention significantly reduces -// the number of potentially expensive reference count -// updates.) -#ifndef __GC - template<class _CharT, class _Alloc> - struct _Rope_self_destruct_ptr { - _Rope_RopeRep<_CharT,_Alloc>* _M_ptr; - ~_Rope_self_destruct_ptr() - { _Rope_RopeRep<_CharT,_Alloc>::_S_unref(_M_ptr); } -#ifdef __EXCEPTIONS - _Rope_self_destruct_ptr() : _M_ptr(0) {}; -#else - _Rope_self_destruct_ptr() {}; -#endif - _Rope_self_destruct_ptr(_Rope_RopeRep<_CharT,_Alloc>* __p) : _M_ptr(__p) {} - _Rope_RopeRep<_CharT,_Alloc>& operator*() { return *_M_ptr; } - _Rope_RopeRep<_CharT,_Alloc>* operator->() { return _M_ptr; } - operator _Rope_RopeRep<_CharT,_Alloc>*() { return _M_ptr; } - _Rope_self_destruct_ptr& operator= (_Rope_RopeRep<_CharT,_Alloc>* __x) - { _M_ptr = __x; return *this; } - }; -#endif - -// Dereferencing a nonconst iterator has to return something -// that behaves almost like a reference. It's not possible to -// return an actual reference since assignment requires extra -// work. And we would get into the same problems as with the -// CD2 version of basic_string. -template<class _CharT, class _Alloc> -class _Rope_char_ref_proxy { - friend class rope<_CharT,_Alloc>; - friend class _Rope_iterator<_CharT,_Alloc>; - friend class _Rope_char_ptr_proxy<_CharT,_Alloc>; -# ifdef __GC - typedef _Rope_RopeRep<_CharT,_Alloc>* _Self_destruct_ptr; -# else - typedef _Rope_self_destruct_ptr<_CharT,_Alloc> _Self_destruct_ptr; -# endif - typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep; - typedef rope<_CharT,_Alloc> _My_rope; - size_t _M_pos; - _CharT _M_current; - bool _M_current_valid; - _My_rope* _M_root; // The whole rope. - public: - _Rope_char_ref_proxy(_My_rope* __r, size_t __p) - : _M_pos(__p), _M_current(), _M_current_valid(false), _M_root(__r) {} - - _Rope_char_ref_proxy(const _Rope_char_ref_proxy& __x) - : _M_pos(__x._M_pos), _M_current(__x._M_current), _M_current_valid(false), - _M_root(__x._M_root) {} - - // Don't preserve cache if the reference can outlive the - // expression. We claim that's not possible without calling - // a copy constructor or generating reference to a proxy - // reference. We declare the latter to have undefined semantics. - _Rope_char_ref_proxy(_My_rope* __r, size_t __p, _CharT __c) - : _M_pos(__p), _M_current(__c), _M_current_valid(true), _M_root(__r) {} - inline operator _CharT () const; - _Rope_char_ref_proxy& operator= (_CharT __c); - _Rope_char_ptr_proxy<_CharT,_Alloc> operator& () const; - _Rope_char_ref_proxy& operator= (const _Rope_char_ref_proxy& __c) { - return operator=((_CharT)__c); - } -}; - -template<class _CharT, class __Alloc> -inline void swap(_Rope_char_ref_proxy <_CharT, __Alloc > __a, - _Rope_char_ref_proxy <_CharT, __Alloc > __b) { - _CharT __tmp = __a; - __a = __b; - __b = __tmp; -} - -template<class _CharT, class _Alloc> -class _Rope_char_ptr_proxy { - // XXX this class should be rewritten. - friend class _Rope_char_ref_proxy<_CharT,_Alloc>; - size_t _M_pos; - rope<_CharT,_Alloc>* _M_root; // The whole rope. - public: - _Rope_char_ptr_proxy(const _Rope_char_ref_proxy<_CharT,_Alloc>& __x) - : _M_pos(__x._M_pos), _M_root(__x._M_root) {} - _Rope_char_ptr_proxy(const _Rope_char_ptr_proxy& __x) - : _M_pos(__x._M_pos), _M_root(__x._M_root) {} - _Rope_char_ptr_proxy() {} - _Rope_char_ptr_proxy(_CharT* __x) : _M_root(0), _M_pos(0) { - } - _Rope_char_ptr_proxy& - operator= (const _Rope_char_ptr_proxy& __x) { - _M_pos = __x._M_pos; - _M_root = __x._M_root; - return *this; - } - template<class _CharT2, class _Alloc2> - friend bool operator== (const _Rope_char_ptr_proxy<_CharT2,_Alloc2>& __x, - const _Rope_char_ptr_proxy<_CharT2,_Alloc2>& __y); - _Rope_char_ref_proxy<_CharT,_Alloc> operator*() const { - return _Rope_char_ref_proxy<_CharT,_Alloc>(_M_root, _M_pos); - } -}; - - -// Rope iterators: -// Unlike in the C version, we cache only part of the stack -// for rope iterators, since they must be efficiently copyable. -// When we run out of cache, we have to reconstruct the iterator -// value. -// Pointers from iterators are not included in reference counts. -// Iterators are assumed to be thread private. Ropes can -// be shared. - -template<class _CharT, class _Alloc> -class _Rope_iterator_base - : public iterator<std::random_access_iterator_tag, _CharT> -{ - friend class rope<_CharT,_Alloc>; - public: - typedef _Alloc _allocator_type; // used in _Rope_rotate, VC++ workaround - typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep; - // Borland doesn't want this to be protected. - protected: - enum { _S_path_cache_len = 4 }; // Must be <= 9. - enum { _S_iterator_buf_len = 15 }; - size_t _M_current_pos; - _RopeRep* _M_root; // The whole rope. - size_t _M_leaf_pos; // Starting position for current leaf - __GC_CONST _CharT* _M_buf_start; - // Buffer possibly - // containing current char. - __GC_CONST _CharT* _M_buf_ptr; - // Pointer to current char in buffer. - // != 0 ==> buffer valid. - __GC_CONST _CharT* _M_buf_end; - // One past __last valid char in buffer. - // What follows is the path cache. We go out of our - // way to make this compact. - // Path_end contains the bottom section of the path from - // the root to the current leaf. - const _RopeRep* _M_path_end[_S_path_cache_len]; - int _M_leaf_index; // Last valid __pos in path_end; - // _M_path_end[0] ... _M_path_end[leaf_index-1] - // point to concatenation nodes. - unsigned char _M_path_directions; - // (path_directions >> __i) & 1 is 1 - // iff we got from _M_path_end[leaf_index - __i - 1] - // to _M_path_end[leaf_index - __i] by going to the - // __right. Assumes path_cache_len <= 9. - _CharT _M_tmp_buf[_S_iterator_buf_len]; - // Short buffer for surrounding chars. - // This is useful primarily for - // RopeFunctions. We put the buffer - // here to avoid locking in the - // multithreaded case. - // The cached path is generally assumed to be valid - // only if the buffer is valid. - static void _S_setbuf(_Rope_iterator_base& __x); - // Set buffer contents given - // path cache. - static void _S_setcache(_Rope_iterator_base& __x); - // Set buffer contents and - // path cache. - static void _S_setcache_for_incr(_Rope_iterator_base& __x); - // As above, but assumes path - // cache is valid for previous posn. - _Rope_iterator_base() {} - _Rope_iterator_base(_RopeRep* __root, size_t __pos) - : _M_current_pos(__pos), _M_root(__root), _M_buf_ptr(0) {} - void _M_incr(size_t __n); - void _M_decr(size_t __n); - public: - size_t index() const { return _M_current_pos; } - _Rope_iterator_base(const _Rope_iterator_base& __x) { - if (0 != __x._M_buf_ptr) { - *this = __x; - } else { - _M_current_pos = __x._M_current_pos; - _M_root = __x._M_root; - _M_buf_ptr = 0; - } - } -}; - -template<class _CharT, class _Alloc> class _Rope_iterator; - -template<class _CharT, class _Alloc> -class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> { - friend class rope<_CharT,_Alloc>; - protected: - typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep; - // The one from the base class may not be directly visible. - _Rope_const_iterator(const _RopeRep* __root, size_t __pos): - _Rope_iterator_base<_CharT,_Alloc>( - const_cast<_RopeRep*>(__root), __pos) - // Only nonconst iterators modify root ref count - {} - public: - typedef _CharT reference; // Really a value. Returning a reference - // Would be a mess, since it would have - // to be included in refcount. - typedef const _CharT* pointer; - - public: - _Rope_const_iterator() {}; - _Rope_const_iterator(const _Rope_const_iterator& __x) : - _Rope_iterator_base<_CharT,_Alloc>(__x) { } - _Rope_const_iterator(const _Rope_iterator<_CharT,_Alloc>& __x); - _Rope_const_iterator(const rope<_CharT,_Alloc>& __r, size_t __pos) : - _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos) {} - _Rope_const_iterator& operator= (const _Rope_const_iterator& __x) { - if (0 != __x._M_buf_ptr) { - *(static_cast<_Rope_iterator_base<_CharT,_Alloc>*>(this)) = __x; - } else { - this->_M_current_pos = __x._M_current_pos; - this->_M_root = __x._M_root; - this->_M_buf_ptr = 0; - } - return(*this); - } - reference operator*() { - if (0 == this->_M_buf_ptr) _S_setcache(*this); - return *this->_M_buf_ptr; - } - _Rope_const_iterator& operator++() { - __GC_CONST _CharT* __next; - if (0 != this->_M_buf_ptr - && (__next = this->_M_buf_ptr + 1) < this->_M_buf_end) { - this->_M_buf_ptr = __next; - ++this->_M_current_pos; - } else { - this->_M_incr(1); - } - return *this; - } - _Rope_const_iterator& operator+=(ptrdiff_t __n) { - if (__n >= 0) { - this->_M_incr(__n); - } else { - this->_M_decr(-__n); - } - return *this; - } - _Rope_const_iterator& operator--() { - this->_M_decr(1); - return *this; - } - _Rope_const_iterator& operator-=(ptrdiff_t __n) { - if (__n >= 0) { - this->_M_decr(__n); - } else { - this->_M_incr(-__n); - } - return *this; - } - _Rope_const_iterator operator++(int) { - size_t __old_pos = this->_M_current_pos; - this->_M_incr(1); - return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos); - // This makes a subsequent dereference expensive. - // Perhaps we should instead copy the iterator - // if it has a valid cache? - } - _Rope_const_iterator operator--(int) { - size_t __old_pos = this->_M_current_pos; - this->_M_decr(1); - return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos); - } - template<class _CharT2, class _Alloc2> - friend _Rope_const_iterator<_CharT2,_Alloc2> operator- - (const _Rope_const_iterator<_CharT2,_Alloc2>& __x, - ptrdiff_t __n); - template<class _CharT2, class _Alloc2> - friend _Rope_const_iterator<_CharT2,_Alloc2> operator+ - (const _Rope_const_iterator<_CharT2,_Alloc2>& __x, - ptrdiff_t __n); - template<class _CharT2, class _Alloc2> - friend _Rope_const_iterator<_CharT2,_Alloc2> operator+ - (ptrdiff_t __n, - const _Rope_const_iterator<_CharT2,_Alloc2>& __x); - reference operator[](size_t __n) { - return rope<_CharT,_Alloc>::_S_fetch(this->_M_root, - this->_M_current_pos + __n); - } - - template<class _CharT2, class _Alloc2> - friend bool operator== - (const _Rope_const_iterator<_CharT2,_Alloc2>& __x, - const _Rope_const_iterator<_CharT2,_Alloc2>& __y); - template<class _CharT2, class _Alloc2> - friend bool operator< - (const _Rope_const_iterator<_CharT2,_Alloc2>& __x, - const _Rope_const_iterator<_CharT2,_Alloc2>& __y); - template<class _CharT2, class _Alloc2> - friend ptrdiff_t operator- - (const _Rope_const_iterator<_CharT2,_Alloc2>& __x, - const _Rope_const_iterator<_CharT2,_Alloc2>& __y); -}; - -template<class _CharT, class _Alloc> -class _Rope_iterator : public _Rope_iterator_base<_CharT,_Alloc> { - friend class rope<_CharT,_Alloc>; - protected: - typedef typename _Rope_iterator_base<_CharT,_Alloc>::_RopeRep _RopeRep; - rope<_CharT,_Alloc>* _M_root_rope; - // root is treated as a cached version of this, - // and is used to detect changes to the underlying - // rope. - // Root is included in the reference count. - // This is necessary so that we can detect changes reliably. - // Unfortunately, it requires careful bookkeeping for the - // nonGC case. - _Rope_iterator(rope<_CharT,_Alloc>* __r, size_t __pos) - : _Rope_iterator_base<_CharT,_Alloc>(__r->_M_tree_ptr, __pos), - _M_root_rope(__r) - { _RopeRep::_S_ref(this->_M_root); - if (!(__r -> empty()))_S_setcache(*this); } - - void _M_check(); - public: - typedef _Rope_char_ref_proxy<_CharT,_Alloc> reference; - typedef _Rope_char_ref_proxy<_CharT,_Alloc>* pointer; - - public: - rope<_CharT,_Alloc>& container() { return *_M_root_rope; } - _Rope_iterator() { - this->_M_root = 0; // Needed for reference counting. - }; - _Rope_iterator(const _Rope_iterator& __x) : - _Rope_iterator_base<_CharT,_Alloc>(__x) { - _M_root_rope = __x._M_root_rope; - _RopeRep::_S_ref(this->_M_root); - } - _Rope_iterator(rope<_CharT,_Alloc>& __r, size_t __pos); - ~_Rope_iterator() { - _RopeRep::_S_unref(this->_M_root); - } - _Rope_iterator& operator= (const _Rope_iterator& __x) { - _RopeRep* __old = this->_M_root; - - _RopeRep::_S_ref(__x._M_root); - if (0 != __x._M_buf_ptr) { - _M_root_rope = __x._M_root_rope; - *(static_cast<_Rope_iterator_base<_CharT,_Alloc>*>(this)) = __x; - } else { - this->_M_current_pos = __x._M_current_pos; - this->_M_root = __x._M_root; - _M_root_rope = __x._M_root_rope; - this->_M_buf_ptr = 0; - } - _RopeRep::_S_unref(__old); - return(*this); - } - reference operator*() { - _M_check(); - if (0 == this->_M_buf_ptr) { - return _Rope_char_ref_proxy<_CharT,_Alloc>( - _M_root_rope, this->_M_current_pos); - } else { - return _Rope_char_ref_proxy<_CharT,_Alloc>( - _M_root_rope, this->_M_current_pos, *this->_M_buf_ptr); - } - } - _Rope_iterator& operator++() { - this->_M_incr(1); - return *this; - } - _Rope_iterator& operator+=(ptrdiff_t __n) { - if (__n >= 0) { - this->_M_incr(__n); - } else { - this->_M_decr(-__n); - } - return *this; - } - _Rope_iterator& operator--() { - this->_M_decr(1); - return *this; - } - _Rope_iterator& operator-=(ptrdiff_t __n) { - if (__n >= 0) { - this->_M_decr(__n); - } else { - this->_M_incr(-__n); - } - return *this; - } - _Rope_iterator operator++(int) { - size_t __old_pos = this->_M_current_pos; - this->_M_incr(1); - return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos); - } - _Rope_iterator operator--(int) { - size_t __old_pos = this->_M_current_pos; - this->_M_decr(1); - return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos); - } - reference operator[](ptrdiff_t __n) { - return _Rope_char_ref_proxy<_CharT,_Alloc>( - _M_root_rope, this->_M_current_pos + __n); - } - - template<class _CharT2, class _Alloc2> - friend bool operator== - (const _Rope_iterator<_CharT2,_Alloc2>& __x, - const _Rope_iterator<_CharT2,_Alloc2>& __y); - template<class _CharT2, class _Alloc2> - friend bool operator< - (const _Rope_iterator<_CharT2,_Alloc2>& __x, - const _Rope_iterator<_CharT2,_Alloc2>& __y); - template<class _CharT2, class _Alloc2> - friend ptrdiff_t operator- - (const _Rope_iterator<_CharT2,_Alloc2>& __x, - const _Rope_iterator<_CharT2,_Alloc2>& __y); - template<class _CharT2, class _Alloc2> - friend _Rope_iterator<_CharT2,_Alloc2> operator- - (const _Rope_iterator<_CharT2,_Alloc2>& __x, - ptrdiff_t __n); - template<class _CharT2, class _Alloc2> - friend _Rope_iterator<_CharT2,_Alloc2> operator+ - (const _Rope_iterator<_CharT2,_Alloc2>& __x, - ptrdiff_t __n); - template<class _CharT2, class _Alloc2> - friend _Rope_iterator<_CharT2,_Alloc2> operator+ - (ptrdiff_t __n, - const _Rope_iterator<_CharT2,_Alloc2>& __x); -}; - - -template <class _CharT, class _Alloc> -struct _Rope_base -: public _Alloc -{ - typedef _Alloc allocator_type; - - allocator_type - get_allocator() const { return *static_cast<const _Alloc*>(this); } - - typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep; - // The one in _Base may not be visible due to template rules. - - _Rope_base(_RopeRep* __t, const allocator_type&) - : _M_tree_ptr(__t) {} - _Rope_base(const allocator_type&) {} - - // The only data member of a rope: - _RopeRep *_M_tree_ptr; - -# define __ROPE_DEFINE_ALLOC(_Tp, __name) \ - typedef typename \ - _Alloc::template rebind<_Tp>::other __name##Alloc; \ - static _Tp* __name##_allocate(size_t __n) \ - { return __name##Alloc().allocate(__n); } \ - static void __name##_deallocate(_Tp *__p, size_t __n) \ - { __name##Alloc().deallocate(__p, __n); } - __ROPE_DEFINE_ALLOCS(_Alloc) -# undef __ROPE_DEFINE_ALLOC - -protected: - _Rope_base& - operator=(const _Rope_base&); - - _Rope_base(const _Rope_base&); -}; - - -/** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo -*/ -template <class _CharT, class _Alloc> -class rope : public _Rope_base<_CharT,_Alloc> { - public: - typedef _CharT value_type; - typedef ptrdiff_t difference_type; - typedef size_t size_type; - typedef _CharT const_reference; - typedef const _CharT* const_pointer; - typedef _Rope_iterator<_CharT,_Alloc> iterator; - typedef _Rope_const_iterator<_CharT,_Alloc> const_iterator; - typedef _Rope_char_ref_proxy<_CharT,_Alloc> reference; - typedef _Rope_char_ptr_proxy<_CharT,_Alloc> pointer; - - friend class _Rope_iterator<_CharT,_Alloc>; - friend class _Rope_const_iterator<_CharT,_Alloc>; - friend struct _Rope_RopeRep<_CharT,_Alloc>; - friend class _Rope_iterator_base<_CharT,_Alloc>; - friend class _Rope_char_ptr_proxy<_CharT,_Alloc>; - friend class _Rope_char_ref_proxy<_CharT,_Alloc>; - friend struct _Rope_RopeSubstring<_CharT,_Alloc>; - - protected: - typedef _Rope_base<_CharT,_Alloc> _Base; - typedef typename _Base::allocator_type allocator_type; - using _Base::_M_tree_ptr; - using _Base::get_allocator; - typedef __GC_CONST _CharT* _Cstrptr; - - static _CharT _S_empty_c_str[1]; - - static bool _S_is0(_CharT __c) { return __c == _S_eos((_CharT*)0); } - enum { _S_copy_max = 23 }; - // For strings shorter than _S_copy_max, we copy to - // concatenate. - - typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep; - typedef _Rope_RopeConcatenation<_CharT,_Alloc> _RopeConcatenation; - typedef _Rope_RopeLeaf<_CharT,_Alloc> _RopeLeaf; - typedef _Rope_RopeFunction<_CharT,_Alloc> _RopeFunction; - typedef _Rope_RopeSubstring<_CharT,_Alloc> _RopeSubstring; - - // Retrieve a character at the indicated position. - static _CharT _S_fetch(_RopeRep* __r, size_type __pos); - -# ifndef __GC - // Obtain a pointer to the character at the indicated position. - // The pointer can be used to change the character. - // If such a pointer cannot be produced, as is frequently the - // case, 0 is returned instead. - // (Returns nonzero only if all nodes in the path have a refcount - // of 1.) - static _CharT* _S_fetch_ptr(_RopeRep* __r, size_type __pos); -# endif - - static bool _S_apply_to_pieces( - // should be template parameter - _Rope_char_consumer<_CharT>& __c, - const _RopeRep* __r, - size_t __begin, size_t __end); - // begin and end are assumed to be in range. - -# ifndef __GC - static void _S_unref(_RopeRep* __t) - { - _RopeRep::_S_unref(__t); - } - static void _S_ref(_RopeRep* __t) - { - _RopeRep::_S_ref(__t); - } -# else /* __GC */ - static void _S_unref(_RopeRep*) {} - static void _S_ref(_RopeRep*) {} -# endif - - -# ifdef __GC - typedef _Rope_RopeRep<_CharT,_Alloc>* _Self_destruct_ptr; -# else - typedef _Rope_self_destruct_ptr<_CharT,_Alloc> _Self_destruct_ptr; -# endif - - // _Result is counted in refcount. - static _RopeRep* _S_substring(_RopeRep* __base, - size_t __start, size_t __endp1); - - static _RopeRep* _S_concat_char_iter(_RopeRep* __r, - const _CharT* __iter, size_t __slen); - // Concatenate rope and char ptr, copying __s. - // Should really take an arbitrary iterator. - // Result is counted in refcount. - static _RopeRep* _S_destr_concat_char_iter(_RopeRep* __r, - const _CharT* __iter, size_t __slen) - // As above, but one reference to __r is about to be - // destroyed. Thus the pieces may be recycled if all - // relevant reference counts are 1. -# ifdef __GC - // We can't really do anything since refcounts are unavailable. - { return _S_concat_char_iter(__r, __iter, __slen); } -# else - ; -# endif - - static _RopeRep* _S_concat(_RopeRep* __left, _RopeRep* __right); - // General concatenation on _RopeRep. _Result - // has refcount of 1. Adjusts argument refcounts. - - public: - void apply_to_pieces( size_t __begin, size_t __end, - _Rope_char_consumer<_CharT>& __c) const { - _S_apply_to_pieces(__c, this->_M_tree_ptr, __begin, __end); - } - - - protected: - - static size_t _S_rounded_up_size(size_t __n) { - return _RopeLeaf::_S_rounded_up_size(__n); - } - - static size_t _S_allocated_capacity(size_t __n) { - if (_S_is_basic_char_type((_CharT*)0)) { - return _S_rounded_up_size(__n) - 1; - } else { - return _S_rounded_up_size(__n); - } - } - - // Allocate and construct a RopeLeaf using the supplied allocator - // Takes ownership of s instead of copying. - static _RopeLeaf* _S_new_RopeLeaf(__GC_CONST _CharT *__s, - size_t __size, allocator_type __a) - { - _RopeLeaf* __space = typename _Base::_LAlloc(__a).allocate(1); - return new(__space) _RopeLeaf(__s, __size, __a); - } - - static _RopeConcatenation* _S_new_RopeConcatenation( - _RopeRep* __left, _RopeRep* __right, - allocator_type __a) - { - _RopeConcatenation* __space = typename _Base::_CAlloc(__a).allocate(1); - return new(__space) _RopeConcatenation(__left, __right, __a); - } - - static _RopeFunction* _S_new_RopeFunction(char_producer<_CharT>* __f, - size_t __size, bool __d, allocator_type __a) - { - _RopeFunction* __space = typename _Base::_FAlloc(__a).allocate(1); - return new(__space) _RopeFunction(__f, __size, __d, __a); - } - - static _RopeSubstring* _S_new_RopeSubstring( - _Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s, - size_t __l, allocator_type __a) - { - _RopeSubstring* __space = typename _Base::_SAlloc(__a).allocate(1); - return new(__space) _RopeSubstring(__b, __s, __l, __a); - } - - static - _RopeLeaf* _S_RopeLeaf_from_unowned_char_ptr(const _CharT *__s, - size_t __size, allocator_type __a) -# define __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __size, __a) \ - _S_RopeLeaf_from_unowned_char_ptr(__s, __size, __a) - { - if (0 == __size) return 0; - _CharT* __buf = __a.allocate(_S_rounded_up_size(__size)); - - uninitialized_copy_n(__s, __size, __buf); - _S_cond_store_eos(__buf[__size]); - try { - return _S_new_RopeLeaf(__buf, __size, __a); - } - catch(...) - { - _RopeRep::__STL_FREE_STRING(__buf, __size, __a); - __throw_exception_again; - } - } - - - // Concatenation of nonempty strings. - // Always builds a concatenation node. - // Rebalances if the result is too deep. - // Result has refcount 1. - // Does not increment left and right ref counts even though - // they are referenced. - static _RopeRep* - _S_tree_concat(_RopeRep* __left, _RopeRep* __right); - - // Concatenation helper functions - static _RopeLeaf* - _S_leaf_concat_char_iter(_RopeLeaf* __r, - const _CharT* __iter, size_t __slen); - // Concatenate by copying leaf. - // should take an arbitrary iterator - // result has refcount 1. -# ifndef __GC - static _RopeLeaf* _S_destr_leaf_concat_char_iter - (_RopeLeaf* __r, const _CharT* __iter, size_t __slen); - // A version that potentially clobbers __r if __r->_M_ref_count == 1. -# endif - - private: - - static size_t _S_char_ptr_len(const _CharT* __s); - // slightly generalized strlen - - rope(_RopeRep* __t, const allocator_type& __a = allocator_type()) - : _Base(__t,__a) { } - - - // Copy __r to the _CharT buffer. - // Returns __buffer + __r->_M_size. - // Assumes that buffer is uninitialized. - static _CharT* _S_flatten(_RopeRep* __r, _CharT* __buffer); - - // Again, with explicit starting position and length. - // Assumes that buffer is uninitialized. - static _CharT* _S_flatten(_RopeRep* __r, - size_t __start, size_t __len, - _CharT* __buffer); - - static const unsigned long - _S_min_len[_Rope_constants::_S_max_rope_depth + 1]; - - static bool _S_is_balanced(_RopeRep* __r) - { return (__r->_M_size >= _S_min_len[__r->_M_depth]); } - - static bool _S_is_almost_balanced(_RopeRep* __r) - { return (__r->_M_depth == 0 || - __r->_M_size >= _S_min_len[__r->_M_depth - 1]); } - - static bool _S_is_roughly_balanced(_RopeRep* __r) - { return (__r->_M_depth <= 1 || - __r->_M_size >= _S_min_len[__r->_M_depth - 2]); } - - // Assumes the result is not empty. - static _RopeRep* _S_concat_and_set_balanced(_RopeRep* __left, - _RopeRep* __right) - { - _RopeRep* __result = _S_concat(__left, __right); - if (_S_is_balanced(__result)) __result->_M_is_balanced = true; - return __result; - } - - // The basic rebalancing operation. Logically copies the - // rope. The result has refcount of 1. The client will - // usually decrement the reference count of __r. - // The result is within height 2 of balanced by the above - // definition. - static _RopeRep* _S_balance(_RopeRep* __r); - - // Add all unbalanced subtrees to the forest of balanceed trees. - // Used only by balance. - static void _S_add_to_forest(_RopeRep*__r, _RopeRep** __forest); - - // Add __r to forest, assuming __r is already balanced. - static void _S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest); - - // Print to stdout, exposing structure - static void _S_dump(_RopeRep* __r, int __indent = 0); - - // Return -1, 0, or 1 if __x < __y, __x == __y, or __x > __y resp. - static int _S_compare(const _RopeRep* __x, const _RopeRep* __y); - - public: - bool empty() const { return 0 == this->_M_tree_ptr; } - - // Comparison member function. This is public only for those - // clients that need a ternary comparison. Others - // should use the comparison operators below. - int compare(const rope& __y) const { - return _S_compare(this->_M_tree_ptr, __y._M_tree_ptr); - } - - rope(const _CharT* __s, const allocator_type& __a = allocator_type()) - : _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, _S_char_ptr_len(__s), - __a),__a) - { } - - rope(const _CharT* __s, size_t __len, - const allocator_type& __a = allocator_type()) - : _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __len, __a), __a) - { } - - // Should perhaps be templatized with respect to the iterator type - // and use Sequence_buffer. (It should perhaps use sequence_buffer - // even now.) - rope(const _CharT *__s, const _CharT *__e, - const allocator_type& __a = allocator_type()) - : _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __e - __s, __a), __a) - { } - - rope(const const_iterator& __s, const const_iterator& __e, - const allocator_type& __a = allocator_type()) - : _Base(_S_substring(__s._M_root, __s._M_current_pos, - __e._M_current_pos), __a) - { } - - rope(const iterator& __s, const iterator& __e, - const allocator_type& __a = allocator_type()) - : _Base(_S_substring(__s._M_root, __s._M_current_pos, - __e._M_current_pos), __a) - { } - - rope(_CharT __c, const allocator_type& __a = allocator_type()) - : _Base(__a) - { - _CharT* __buf = this->_Data_allocate(_S_rounded_up_size(1)); - - std::_Construct(__buf, __c); - try { - this->_M_tree_ptr = _S_new_RopeLeaf(__buf, 1, __a); - } - catch(...) - { - _RopeRep::__STL_FREE_STRING(__buf, 1, __a); - __throw_exception_again; - } - } - - rope(size_t __n, _CharT __c, - const allocator_type& __a = allocator_type()); - - rope(const allocator_type& __a = allocator_type()) - : _Base(0, __a) {} - - // Construct a rope from a function that can compute its members - rope(char_producer<_CharT> *__fn, size_t __len, bool __delete_fn, - const allocator_type& __a = allocator_type()) - : _Base(__a) - { - this->_M_tree_ptr = (0 == __len) ? - 0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a); - } - - rope(const rope& __x, const allocator_type& __a = allocator_type()) - : _Base(__x._M_tree_ptr, __a) - { - _S_ref(this->_M_tree_ptr); - } - - ~rope() throw() - { _S_unref(this->_M_tree_ptr); } - - rope& operator=(const rope& __x) - { - _RopeRep* __old = this->_M_tree_ptr; - this->_M_tree_ptr = __x._M_tree_ptr; - _S_ref(this->_M_tree_ptr); - _S_unref(__old); - return *this; - } - - void clear() - { - _S_unref(this->_M_tree_ptr); - this->_M_tree_ptr = 0; - } - - void push_back(_CharT __x) - { - _RopeRep* __old = this->_M_tree_ptr; - this->_M_tree_ptr - = _S_destr_concat_char_iter(this->_M_tree_ptr, &__x, 1); - _S_unref(__old); - } - - void pop_back() - { - _RopeRep* __old = this->_M_tree_ptr; - this->_M_tree_ptr = - _S_substring(this->_M_tree_ptr, - 0, - this->_M_tree_ptr->_M_size - 1); - _S_unref(__old); - } - - _CharT back() const - { - return _S_fetch(this->_M_tree_ptr, this->_M_tree_ptr->_M_size - 1); - } - - void push_front(_CharT __x) - { - _RopeRep* __old = this->_M_tree_ptr; - _RopeRep* __left = - __STL_ROPE_FROM_UNOWNED_CHAR_PTR(&__x, 1, this->get_allocator()); - try { - this->_M_tree_ptr = _S_concat(__left, this->_M_tree_ptr); - _S_unref(__old); - _S_unref(__left); - } - catch(...) - { - _S_unref(__left); - __throw_exception_again; - } - } - - void pop_front() - { - _RopeRep* __old = this->_M_tree_ptr; - this->_M_tree_ptr - = _S_substring(this->_M_tree_ptr, 1, this->_M_tree_ptr->_M_size); - _S_unref(__old); - } - - _CharT front() const - { - return _S_fetch(this->_M_tree_ptr, 0); - } - - void balance() - { - _RopeRep* __old = this->_M_tree_ptr; - this->_M_tree_ptr = _S_balance(this->_M_tree_ptr); - _S_unref(__old); - } - - void copy(_CharT* __buffer) const { - _Destroy(__buffer, __buffer + size()); - _S_flatten(this->_M_tree_ptr, __buffer); - } - - // This is the copy function from the standard, but - // with the arguments reordered to make it consistent with the - // rest of the interface. - // Note that this guaranteed not to compile if the draft standard - // order is assumed. - size_type copy(size_type __pos, size_type __n, _CharT* __buffer) const - { - size_t __size = size(); - size_t __len = (__pos + __n > __size? __size - __pos : __n); - - _Destroy(__buffer, __buffer + __len); - _S_flatten(this->_M_tree_ptr, __pos, __len, __buffer); - return __len; - } - - // Print to stdout, exposing structure. May be useful for - // performance debugging. - void dump() { - _S_dump(this->_M_tree_ptr); - } - - // Convert to 0 terminated string in new allocated memory. - // Embedded 0s in the input do not terminate the copy. - const _CharT* c_str() const; - - // As above, but lso use the flattened representation as the - // the new rope representation. - const _CharT* replace_with_c_str(); - - // Reclaim memory for the c_str generated flattened string. - // Intentionally undocumented, since it's hard to say when this - // is safe for multiple threads. - void delete_c_str () { - if (0 == this->_M_tree_ptr) return; - if (_Rope_constants::_S_leaf == this->_M_tree_ptr->_M_tag && - ((_RopeLeaf*)this->_M_tree_ptr)->_M_data == - this->_M_tree_ptr->_M_c_string) { - // Representation shared - return; - } -# ifndef __GC - this->_M_tree_ptr->_M_free_c_string(); -# endif - this->_M_tree_ptr->_M_c_string = 0; - } - - _CharT operator[] (size_type __pos) const { - return _S_fetch(this->_M_tree_ptr, __pos); - } - - _CharT at(size_type __pos) const { - // if (__pos >= size()) throw out_of_range; // XXX - return (*this)[__pos]; - } - - const_iterator begin() const { - return(const_iterator(this->_M_tree_ptr, 0)); - } - - // An easy way to get a const iterator from a non-const container. - const_iterator const_begin() const { - return(const_iterator(this->_M_tree_ptr, 0)); - } - - const_iterator end() const { - return(const_iterator(this->_M_tree_ptr, size())); - } - - const_iterator const_end() const { - return(const_iterator(this->_M_tree_ptr, size())); - } - - size_type size() const { - return(0 == this->_M_tree_ptr? 0 : this->_M_tree_ptr->_M_size); - } - - size_type length() const { - return size(); - } - - size_type max_size() const { - return _S_min_len[_Rope_constants::_S_max_rope_depth - 1] - 1; - // Guarantees that the result can be sufficirntly - // balanced. Longer ropes will probably still work, - // but it's harder to make guarantees. - } - - typedef reverse_iterator<const_iterator> const_reverse_iterator; - - const_reverse_iterator rbegin() const { - return const_reverse_iterator(end()); - } - - const_reverse_iterator const_rbegin() const { - return const_reverse_iterator(end()); - } - - const_reverse_iterator rend() const { - return const_reverse_iterator(begin()); - } - - const_reverse_iterator const_rend() const { - return const_reverse_iterator(begin()); - } - - template<class _CharT2, class _Alloc2> - friend rope<_CharT2,_Alloc2> - operator+ (const rope<_CharT2,_Alloc2>& __left, - const rope<_CharT2,_Alloc2>& __right); - - template<class _CharT2, class _Alloc2> - friend rope<_CharT2,_Alloc2> - operator+ (const rope<_CharT2,_Alloc2>& __left, - const _CharT2* __right); - - template<class _CharT2, class _Alloc2> - friend rope<_CharT2,_Alloc2> - operator+ (const rope<_CharT2,_Alloc2>& __left, _CharT2 __right); - // The symmetric cases are intentionally omitted, since they're presumed - // to be less common, and we don't handle them as well. - - // The following should really be templatized. - // The first argument should be an input iterator or - // forward iterator with value_type _CharT. - rope& append(const _CharT* __iter, size_t __n) { - _RopeRep* __result = - _S_destr_concat_char_iter(this->_M_tree_ptr, __iter, __n); - _S_unref(this->_M_tree_ptr); - this->_M_tree_ptr = __result; - return *this; - } - - rope& append(const _CharT* __c_string) { - size_t __len = _S_char_ptr_len(__c_string); - append(__c_string, __len); - return(*this); - } - - rope& append(const _CharT* __s, const _CharT* __e) { - _RopeRep* __result = - _S_destr_concat_char_iter(this->_M_tree_ptr, __s, __e - __s); - _S_unref(this->_M_tree_ptr); - this->_M_tree_ptr = __result; - return *this; - } - - rope& append(const_iterator __s, const_iterator __e) { - _Self_destruct_ptr __appendee(_S_substring( - __s._M_root, __s._M_current_pos, __e._M_current_pos)); - _RopeRep* __result = - _S_concat(this->_M_tree_ptr, (_RopeRep*)__appendee); - _S_unref(this->_M_tree_ptr); - this->_M_tree_ptr = __result; - return *this; - } - - rope& append(_CharT __c) { - _RopeRep* __result = - _S_destr_concat_char_iter(this->_M_tree_ptr, &__c, 1); - _S_unref(this->_M_tree_ptr); - this->_M_tree_ptr = __result; - return *this; - } - - rope& append() { return append(_CharT()); } // XXX why? - - rope& append(const rope& __y) { - _RopeRep* __result = _S_concat(this->_M_tree_ptr, __y._M_tree_ptr); - _S_unref(this->_M_tree_ptr); - this->_M_tree_ptr = __result; - return *this; - } - - rope& append(size_t __n, _CharT __c) { - rope<_CharT,_Alloc> __last(__n, __c); - return append(__last); - } - - void swap(rope& __b) { - _RopeRep* __tmp = this->_M_tree_ptr; - this->_M_tree_ptr = __b._M_tree_ptr; - __b._M_tree_ptr = __tmp; - } - - - protected: - // Result is included in refcount. - static _RopeRep* replace(_RopeRep* __old, size_t __pos1, - size_t __pos2, _RopeRep* __r) { - if (0 == __old) { _S_ref(__r); return __r; } - _Self_destruct_ptr __left( - _S_substring(__old, 0, __pos1)); - _Self_destruct_ptr __right( - _S_substring(__old, __pos2, __old->_M_size)); - _RopeRep* __result; - - if (0 == __r) { - __result = _S_concat(__left, __right); - } else { - _Self_destruct_ptr __left_result(_S_concat(__left, __r)); - __result = _S_concat(__left_result, __right); - } - return __result; - } - - public: - void insert(size_t __p, const rope& __r) { - _RopeRep* __result = - replace(this->_M_tree_ptr, __p, __p, __r._M_tree_ptr); - _S_unref(this->_M_tree_ptr); - this->_M_tree_ptr = __result; - } - - void insert(size_t __p, size_t __n, _CharT __c) { - rope<_CharT,_Alloc> __r(__n,__c); - insert(__p, __r); - } - - void insert(size_t __p, const _CharT* __i, size_t __n) { - _Self_destruct_ptr __left(_S_substring(this->_M_tree_ptr, 0, __p)); - _Self_destruct_ptr __right(_S_substring(this->_M_tree_ptr, - __p, size())); - _Self_destruct_ptr __left_result( - _S_concat_char_iter(__left, __i, __n)); - // _S_ destr_concat_char_iter should be safe here. - // But as it stands it's probably not a win, since __left - // is likely to have additional references. - _RopeRep* __result = _S_concat(__left_result, __right); - _S_unref(this->_M_tree_ptr); - this->_M_tree_ptr = __result; - } - - void insert(size_t __p, const _CharT* __c_string) { - insert(__p, __c_string, _S_char_ptr_len(__c_string)); - } - - void insert(size_t __p, _CharT __c) { - insert(__p, &__c, 1); - } - - void insert(size_t __p) { - _CharT __c = _CharT(); - insert(__p, &__c, 1); - } - - void insert(size_t __p, const _CharT* __i, const _CharT* __j) { - rope __r(__i, __j); - insert(__p, __r); - } - - void insert(size_t __p, const const_iterator& __i, - const const_iterator& __j) { - rope __r(__i, __j); - insert(__p, __r); - } - - void insert(size_t __p, const iterator& __i, - const iterator& __j) { - rope __r(__i, __j); - insert(__p, __r); - } - - // (position, length) versions of replace operations: - - void replace(size_t __p, size_t __n, const rope& __r) { - _RopeRep* __result = - replace(this->_M_tree_ptr, __p, __p + __n, __r._M_tree_ptr); - _S_unref(this->_M_tree_ptr); - this->_M_tree_ptr = __result; - } - - void replace(size_t __p, size_t __n, - const _CharT* __i, size_t __i_len) { - rope __r(__i, __i_len); - replace(__p, __n, __r); - } - - void replace(size_t __p, size_t __n, _CharT __c) { - rope __r(__c); - replace(__p, __n, __r); - } - - void replace(size_t __p, size_t __n, const _CharT* __c_string) { - rope __r(__c_string); - replace(__p, __n, __r); - } - - void replace(size_t __p, size_t __n, - const _CharT* __i, const _CharT* __j) { - rope __r(__i, __j); - replace(__p, __n, __r); - } - - void replace(size_t __p, size_t __n, - const const_iterator& __i, const const_iterator& __j) { - rope __r(__i, __j); - replace(__p, __n, __r); - } - - void replace(size_t __p, size_t __n, - const iterator& __i, const iterator& __j) { - rope __r(__i, __j); - replace(__p, __n, __r); - } - - // Single character variants: - void replace(size_t __p, _CharT __c) { - iterator __i(this, __p); - *__i = __c; - } - - void replace(size_t __p, const rope& __r) { - replace(__p, 1, __r); - } - - void replace(size_t __p, const _CharT* __i, size_t __i_len) { - replace(__p, 1, __i, __i_len); - } - - void replace(size_t __p, const _CharT* __c_string) { - replace(__p, 1, __c_string); - } - - void replace(size_t __p, const _CharT* __i, const _CharT* __j) { - replace(__p, 1, __i, __j); - } - - void replace(size_t __p, const const_iterator& __i, - const const_iterator& __j) { - replace(__p, 1, __i, __j); - } - - void replace(size_t __p, const iterator& __i, - const iterator& __j) { - replace(__p, 1, __i, __j); - } - - // Erase, (position, size) variant. - void erase(size_t __p, size_t __n) { - _RopeRep* __result = replace(this->_M_tree_ptr, __p, __p + __n, 0); - _S_unref(this->_M_tree_ptr); - this->_M_tree_ptr = __result; - } - - // Erase, single character - void erase(size_t __p) { - erase(__p, __p + 1); - } - - // Insert, iterator variants. - iterator insert(const iterator& __p, const rope& __r) - { insert(__p.index(), __r); return __p; } - iterator insert(const iterator& __p, size_t __n, _CharT __c) - { insert(__p.index(), __n, __c); return __p; } - iterator insert(const iterator& __p, _CharT __c) - { insert(__p.index(), __c); return __p; } - iterator insert(const iterator& __p ) - { insert(__p.index()); return __p; } - iterator insert(const iterator& __p, const _CharT* c_string) - { insert(__p.index(), c_string); return __p; } - iterator insert(const iterator& __p, const _CharT* __i, size_t __n) - { insert(__p.index(), __i, __n); return __p; } - iterator insert(const iterator& __p, const _CharT* __i, - const _CharT* __j) - { insert(__p.index(), __i, __j); return __p; } - iterator insert(const iterator& __p, - const const_iterator& __i, const const_iterator& __j) - { insert(__p.index(), __i, __j); return __p; } - iterator insert(const iterator& __p, - const iterator& __i, const iterator& __j) - { insert(__p.index(), __i, __j); return __p; } - - // Replace, range variants. - void replace(const iterator& __p, const iterator& __q, - const rope& __r) - { replace(__p.index(), __q.index() - __p.index(), __r); } - void replace(const iterator& __p, const iterator& __q, _CharT __c) - { replace(__p.index(), __q.index() - __p.index(), __c); } - void replace(const iterator& __p, const iterator& __q, - const _CharT* __c_string) - { replace(__p.index(), __q.index() - __p.index(), __c_string); } - void replace(const iterator& __p, const iterator& __q, - const _CharT* __i, size_t __n) - { replace(__p.index(), __q.index() - __p.index(), __i, __n); } - void replace(const iterator& __p, const iterator& __q, - const _CharT* __i, const _CharT* __j) - { replace(__p.index(), __q.index() - __p.index(), __i, __j); } - void replace(const iterator& __p, const iterator& __q, - const const_iterator& __i, const const_iterator& __j) - { replace(__p.index(), __q.index() - __p.index(), __i, __j); } - void replace(const iterator& __p, const iterator& __q, - const iterator& __i, const iterator& __j) - { replace(__p.index(), __q.index() - __p.index(), __i, __j); } - - // Replace, iterator variants. - void replace(const iterator& __p, const rope& __r) - { replace(__p.index(), __r); } - void replace(const iterator& __p, _CharT __c) - { replace(__p.index(), __c); } - void replace(const iterator& __p, const _CharT* __c_string) - { replace(__p.index(), __c_string); } - void replace(const iterator& __p, const _CharT* __i, size_t __n) - { replace(__p.index(), __i, __n); } - void replace(const iterator& __p, const _CharT* __i, const _CharT* __j) - { replace(__p.index(), __i, __j); } - void replace(const iterator& __p, const_iterator __i, - const_iterator __j) - { replace(__p.index(), __i, __j); } - void replace(const iterator& __p, iterator __i, iterator __j) - { replace(__p.index(), __i, __j); } - - // Iterator and range variants of erase - iterator erase(const iterator& __p, const iterator& __q) { - size_t __p_index = __p.index(); - erase(__p_index, __q.index() - __p_index); - return iterator(this, __p_index); - } - iterator erase(const iterator& __p) { - size_t __p_index = __p.index(); - erase(__p_index, 1); - return iterator(this, __p_index); - } - - rope substr(size_t __start, size_t __len = 1) const { - return rope<_CharT,_Alloc>( - _S_substring(this->_M_tree_ptr, - __start, - __start + __len)); - } - - rope substr(iterator __start, iterator __end) const { - return rope<_CharT,_Alloc>( - _S_substring(this->_M_tree_ptr, - __start.index(), - __end.index())); - } - - rope substr(iterator __start) const { - size_t __pos = __start.index(); - return rope<_CharT,_Alloc>( - _S_substring(this->_M_tree_ptr, __pos, __pos + 1)); - } - - rope substr(const_iterator __start, const_iterator __end) const { - // This might eventually take advantage of the cache in the - // iterator. - return rope<_CharT,_Alloc>( - _S_substring(this->_M_tree_ptr, __start.index(), __end.index())); - } - - rope<_CharT,_Alloc> substr(const_iterator __start) { - size_t __pos = __start.index(); - return rope<_CharT,_Alloc>( - _S_substring(this->_M_tree_ptr, __pos, __pos + 1)); - } - - static const size_type npos; - - size_type find(_CharT __c, size_type __pos = 0) const; - size_type find(const _CharT* __s, size_type __pos = 0) const { - size_type __result_pos; - const_iterator __result = - std::search(const_begin() + __pos, const_end(), - __s, __s + _S_char_ptr_len(__s)); - __result_pos = __result.index(); -# ifndef __STL_OLD_ROPE_SEMANTICS - if (__result_pos == size()) __result_pos = npos; -# endif - return __result_pos; - } - - iterator mutable_begin() { - return(iterator(this, 0)); - } - - iterator mutable_end() { - return(iterator(this, size())); - } - - typedef reverse_iterator<iterator> reverse_iterator; - - reverse_iterator mutable_rbegin() { - return reverse_iterator(mutable_end()); - } - - reverse_iterator mutable_rend() { - return reverse_iterator(mutable_begin()); - } - - reference mutable_reference_at(size_type __pos) { - return reference(this, __pos); - } - -# ifdef __STD_STUFF - reference operator[] (size_type __pos) { - return _char_ref_proxy(this, __pos); - } - - reference at(size_type __pos) { - // if (__pos >= size()) throw out_of_range; // XXX - return (*this)[__pos]; - } - - void resize(size_type __n, _CharT __c) {} - void resize(size_type __n) {} - void reserve(size_type __res_arg = 0) {} - size_type capacity() const { - return max_size(); - } - - // Stuff below this line is dangerous because it's error prone. - // I would really like to get rid of it. - // copy function with funny arg ordering. - size_type copy(_CharT* __buffer, size_type __n, - size_type __pos = 0) const { - return copy(__pos, __n, __buffer); - } - - iterator end() { return mutable_end(); } - - iterator begin() { return mutable_begin(); } - - reverse_iterator rend() { return mutable_rend(); } - - reverse_iterator rbegin() { return mutable_rbegin(); } - -# else - - const_iterator end() { return const_end(); } - - const_iterator begin() { return const_begin(); } - - const_reverse_iterator rend() { return const_rend(); } - - const_reverse_iterator rbegin() { return const_rbegin(); } - -# endif - -}; - -template <class _CharT, class _Alloc> -const typename rope<_CharT, _Alloc>::size_type rope<_CharT, _Alloc>::npos = - (size_type)(-1); - -template <class _CharT, class _Alloc> -inline bool operator== (const _Rope_const_iterator<_CharT,_Alloc>& __x, - const _Rope_const_iterator<_CharT,_Alloc>& __y) { - return (__x._M_current_pos == __y._M_current_pos && - __x._M_root == __y._M_root); -} - -template <class _CharT, class _Alloc> -inline bool operator< (const _Rope_const_iterator<_CharT,_Alloc>& __x, - const _Rope_const_iterator<_CharT,_Alloc>& __y) { - return (__x._M_current_pos < __y._M_current_pos); -} - -template <class _CharT, class _Alloc> -inline bool operator!= (const _Rope_const_iterator<_CharT,_Alloc>& __x, - const _Rope_const_iterator<_CharT,_Alloc>& __y) { - return !(__x == __y); -} - -template <class _CharT, class _Alloc> -inline bool operator> (const _Rope_const_iterator<_CharT,_Alloc>& __x, - const _Rope_const_iterator<_CharT,_Alloc>& __y) { - return __y < __x; -} - -template <class _CharT, class _Alloc> -inline bool operator<= (const _Rope_const_iterator<_CharT,_Alloc>& __x, - const _Rope_const_iterator<_CharT,_Alloc>& __y) { - return !(__y < __x); -} - -template <class _CharT, class _Alloc> -inline bool operator>= (const _Rope_const_iterator<_CharT,_Alloc>& __x, - const _Rope_const_iterator<_CharT,_Alloc>& __y) { - return !(__x < __y); -} - -template <class _CharT, class _Alloc> -inline ptrdiff_t operator-(const _Rope_const_iterator<_CharT,_Alloc>& __x, - const _Rope_const_iterator<_CharT,_Alloc>& __y) { - return (ptrdiff_t)__x._M_current_pos - (ptrdiff_t)__y._M_current_pos; -} - -template <class _CharT, class _Alloc> -inline _Rope_const_iterator<_CharT,_Alloc> -operator-(const _Rope_const_iterator<_CharT,_Alloc>& __x, ptrdiff_t __n) { - return _Rope_const_iterator<_CharT,_Alloc>( - __x._M_root, __x._M_current_pos - __n); -} - -template <class _CharT, class _Alloc> -inline _Rope_const_iterator<_CharT,_Alloc> -operator+(const _Rope_const_iterator<_CharT,_Alloc>& __x, ptrdiff_t __n) { - return _Rope_const_iterator<_CharT,_Alloc>( - __x._M_root, __x._M_current_pos + __n); -} - -template <class _CharT, class _Alloc> -inline _Rope_const_iterator<_CharT,_Alloc> -operator+(ptrdiff_t __n, const _Rope_const_iterator<_CharT,_Alloc>& __x) { - return _Rope_const_iterator<_CharT,_Alloc>( - __x._M_root, __x._M_current_pos + __n); -} - -template <class _CharT, class _Alloc> -inline bool operator== (const _Rope_iterator<_CharT,_Alloc>& __x, - const _Rope_iterator<_CharT,_Alloc>& __y) { - return (__x._M_current_pos == __y._M_current_pos && - __x._M_root_rope == __y._M_root_rope); -} - -template <class _CharT, class _Alloc> -inline bool operator< (const _Rope_iterator<_CharT,_Alloc>& __x, - const _Rope_iterator<_CharT,_Alloc>& __y) { - return (__x._M_current_pos < __y._M_current_pos); -} - -template <class _CharT, class _Alloc> -inline bool operator!= (const _Rope_iterator<_CharT,_Alloc>& __x, - const _Rope_iterator<_CharT,_Alloc>& __y) { - return !(__x == __y); -} - -template <class _CharT, class _Alloc> -inline bool operator> (const _Rope_iterator<_CharT,_Alloc>& __x, - const _Rope_iterator<_CharT,_Alloc>& __y) { - return __y < __x; -} - -template <class _CharT, class _Alloc> -inline bool operator<= (const _Rope_iterator<_CharT,_Alloc>& __x, - const _Rope_iterator<_CharT,_Alloc>& __y) { - return !(__y < __x); -} - -template <class _CharT, class _Alloc> -inline bool operator>= (const _Rope_iterator<_CharT,_Alloc>& __x, - const _Rope_iterator<_CharT,_Alloc>& __y) { - return !(__x < __y); -} - -template <class _CharT, class _Alloc> -inline ptrdiff_t operator-(const _Rope_iterator<_CharT,_Alloc>& __x, - const _Rope_iterator<_CharT,_Alloc>& __y) { - return (ptrdiff_t)__x._M_current_pos - (ptrdiff_t)__y._M_current_pos; -} - -template <class _CharT, class _Alloc> -inline _Rope_iterator<_CharT,_Alloc> -operator-(const _Rope_iterator<_CharT,_Alloc>& __x, - ptrdiff_t __n) { - return _Rope_iterator<_CharT,_Alloc>( - __x._M_root_rope, __x._M_current_pos - __n); -} - -template <class _CharT, class _Alloc> -inline _Rope_iterator<_CharT,_Alloc> -operator+(const _Rope_iterator<_CharT,_Alloc>& __x, - ptrdiff_t __n) { - return _Rope_iterator<_CharT,_Alloc>( - __x._M_root_rope, __x._M_current_pos + __n); -} - -template <class _CharT, class _Alloc> -inline _Rope_iterator<_CharT,_Alloc> -operator+(ptrdiff_t __n, const _Rope_iterator<_CharT,_Alloc>& __x) { - return _Rope_iterator<_CharT,_Alloc>( - __x._M_root_rope, __x._M_current_pos + __n); -} - -template <class _CharT, class _Alloc> -inline -rope<_CharT,_Alloc> -operator+ (const rope<_CharT,_Alloc>& __left, - const rope<_CharT,_Alloc>& __right) -{ - return rope<_CharT,_Alloc>( - rope<_CharT,_Alloc>::_S_concat(__left._M_tree_ptr, __right._M_tree_ptr)); - // Inlining this should make it possible to keep __left and - // __right in registers. -} - -template <class _CharT, class _Alloc> -inline -rope<_CharT,_Alloc>& -operator+= (rope<_CharT,_Alloc>& __left, - const rope<_CharT,_Alloc>& __right) -{ - __left.append(__right); - return __left; -} - -template <class _CharT, class _Alloc> -inline -rope<_CharT,_Alloc> -operator+ (const rope<_CharT,_Alloc>& __left, - const _CharT* __right) { - size_t __rlen = rope<_CharT,_Alloc>::_S_char_ptr_len(__right); - return rope<_CharT,_Alloc>( - rope<_CharT,_Alloc>::_S_concat_char_iter( - __left._M_tree_ptr, __right, __rlen)); -} - -template <class _CharT, class _Alloc> -inline -rope<_CharT,_Alloc>& -operator+= (rope<_CharT,_Alloc>& __left, - const _CharT* __right) { - __left.append(__right); - return __left; -} - -template <class _CharT, class _Alloc> -inline -rope<_CharT,_Alloc> -operator+ (const rope<_CharT,_Alloc>& __left, _CharT __right) { - return rope<_CharT,_Alloc>( - rope<_CharT,_Alloc>::_S_concat_char_iter( - __left._M_tree_ptr, &__right, 1)); -} - -template <class _CharT, class _Alloc> -inline -rope<_CharT,_Alloc>& -operator+= (rope<_CharT,_Alloc>& __left, _CharT __right) { - __left.append(__right); - return __left; -} - -template <class _CharT, class _Alloc> -bool -operator< (const rope<_CharT,_Alloc>& __left, - const rope<_CharT,_Alloc>& __right) { - return __left.compare(__right) < 0; -} - -template <class _CharT, class _Alloc> -bool -operator== (const rope<_CharT,_Alloc>& __left, - const rope<_CharT,_Alloc>& __right) { - return __left.compare(__right) == 0; -} - -template <class _CharT, class _Alloc> -inline bool operator== (const _Rope_char_ptr_proxy<_CharT,_Alloc>& __x, - const _Rope_char_ptr_proxy<_CharT,_Alloc>& __y) { - return (__x._M_pos == __y._M_pos && __x._M_root == __y._M_root); -} - -template <class _CharT, class _Alloc> -inline bool -operator!= (const rope<_CharT,_Alloc>& __x, const rope<_CharT,_Alloc>& __y) { - return !(__x == __y); -} - -template <class _CharT, class _Alloc> -inline bool -operator> (const rope<_CharT,_Alloc>& __x, const rope<_CharT,_Alloc>& __y) { - return __y < __x; -} - -template <class _CharT, class _Alloc> -inline bool -operator<= (const rope<_CharT,_Alloc>& __x, const rope<_CharT,_Alloc>& __y) { - return !(__y < __x); -} - -template <class _CharT, class _Alloc> -inline bool -operator>= (const rope<_CharT,_Alloc>& __x, const rope<_CharT,_Alloc>& __y) { - return !(__x < __y); -} - -template <class _CharT, class _Alloc> -inline bool operator!= (const _Rope_char_ptr_proxy<_CharT,_Alloc>& __x, - const _Rope_char_ptr_proxy<_CharT,_Alloc>& __y) { - return !(__x == __y); -} - -template<class _CharT, class _Traits, class _Alloc> -std::basic_ostream<_CharT, _Traits>& operator<< - (std::basic_ostream<_CharT, _Traits>& __o, - const rope<_CharT, _Alloc>& __r); - -typedef rope<char> crope; -typedef rope<wchar_t> wrope; - -inline crope::reference __mutable_reference_at(crope& __c, size_t __i) -{ - return __c.mutable_reference_at(__i); -} - -inline wrope::reference __mutable_reference_at(wrope& __c, size_t __i) -{ - return __c.mutable_reference_at(__i); -} - -template <class _CharT, class _Alloc> -inline void swap(rope<_CharT,_Alloc>& __x, rope<_CharT,_Alloc>& __y) { - __x.swap(__y); -} - -// Hash functions should probably be revisited later: -template<> struct hash<crope> -{ - size_t operator()(const crope& __str) const - { - size_t __size = __str.size(); - - if (0 == __size) return 0; - return 13*__str[0] + 5*__str[__size - 1] + __size; - } -}; - - -template<> struct hash<wrope> -{ - size_t operator()(const wrope& __str) const - { - size_t __size = __str.size(); - - if (0 == __size) return 0; - return 13*__str[0] + 5*__str[__size - 1] + __size; - } -}; - -} // namespace __gnu_cxx - -# include <ext/ropeimpl.h> - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/ropeimpl.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/ropeimpl.h deleted file mode 100644 index 29dc550a037..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/ropeimpl.h +++ /dev/null @@ -1,1539 +0,0 @@ -// SGI's rope class implementation -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file ropeimpl.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#include <cstdio> -#include <ostream> -#include <bits/functexcept.h> - -#include <ext/algorithm> // For copy_n and lexicographical_compare_3way -#include <ext/memory> // For uninitialized_copy_n -#include <ext/numeric> // For power - -namespace __gnu_cxx -{ - using std::size_t; - using std::printf; - using std::basic_ostream; - using std::__throw_length_error; - using std::_Destroy; - using std::uninitialized_fill_n; - -// Set buf_start, buf_end, and buf_ptr appropriately, filling tmp_buf -// if necessary. Assumes _M_path_end[leaf_index] and leaf_pos are correct. -// Results in a valid buf_ptr if the iterator can be legitimately -// dereferenced. -template <class _CharT, class _Alloc> -void _Rope_iterator_base<_CharT,_Alloc>::_S_setbuf( - _Rope_iterator_base<_CharT,_Alloc>& __x) -{ - const _RopeRep* __leaf = __x._M_path_end[__x._M_leaf_index]; - size_t __leaf_pos = __x._M_leaf_pos; - size_t __pos = __x._M_current_pos; - - switch(__leaf->_M_tag) { - case _Rope_constants::_S_leaf: - __x._M_buf_start = - ((_Rope_RopeLeaf<_CharT,_Alloc>*)__leaf)->_M_data; - __x._M_buf_ptr = __x._M_buf_start + (__pos - __leaf_pos); - __x._M_buf_end = __x._M_buf_start + __leaf->_M_size; - break; - case _Rope_constants::_S_function: - case _Rope_constants::_S_substringfn: - { - size_t __len = _S_iterator_buf_len; - size_t __buf_start_pos = __leaf_pos; - size_t __leaf_end = __leaf_pos + __leaf->_M_size; - char_producer<_CharT>* __fn = - ((_Rope_RopeFunction<_CharT,_Alloc>*)__leaf)->_M_fn; - - if (__buf_start_pos + __len <= __pos) { - __buf_start_pos = __pos - __len/4; - if (__buf_start_pos + __len > __leaf_end) { - __buf_start_pos = __leaf_end - __len; - } - } - if (__buf_start_pos + __len > __leaf_end) { - __len = __leaf_end - __buf_start_pos; - } - (*__fn)(__buf_start_pos - __leaf_pos, __len, __x._M_tmp_buf); - __x._M_buf_ptr = __x._M_tmp_buf + (__pos - __buf_start_pos); - __x._M_buf_start = __x._M_tmp_buf; - __x._M_buf_end = __x._M_tmp_buf + __len; - } - break; - default: - break; - } -} - -// Set path and buffer inside a rope iterator. We assume that -// pos and root are already set. -template <class _CharT, class _Alloc> -void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache -(_Rope_iterator_base<_CharT,_Alloc>& __x) -{ - const _RopeRep* __path[_Rope_constants::_S_max_rope_depth + 1]; - const _RopeRep* __curr_rope; - int __curr_depth = -1; /* index into path */ - size_t __curr_start_pos = 0; - size_t __pos = __x._M_current_pos; - unsigned char __dirns = 0; // Bit vector marking right turns in the path - - if (__pos >= __x._M_root->_M_size) { - __x._M_buf_ptr = 0; - return; - } - __curr_rope = __x._M_root; - if (0 != __curr_rope->_M_c_string) { - /* Treat the root as a leaf. */ - __x._M_buf_start = __curr_rope->_M_c_string; - __x._M_buf_end = __curr_rope->_M_c_string + __curr_rope->_M_size; - __x._M_buf_ptr = __curr_rope->_M_c_string + __pos; - __x._M_path_end[0] = __curr_rope; - __x._M_leaf_index = 0; - __x._M_leaf_pos = 0; - return; - } - for(;;) { - ++__curr_depth; - __path[__curr_depth] = __curr_rope; - switch(__curr_rope->_M_tag) { - case _Rope_constants::_S_leaf: - case _Rope_constants::_S_function: - case _Rope_constants::_S_substringfn: - __x._M_leaf_pos = __curr_start_pos; - goto done; - case _Rope_constants::_S_concat: - { - _Rope_RopeConcatenation<_CharT,_Alloc>* __c = - (_Rope_RopeConcatenation<_CharT,_Alloc>*)__curr_rope; - _RopeRep* __left = __c->_M_left; - size_t __left_len = __left->_M_size; - - __dirns <<= 1; - if (__pos >= __curr_start_pos + __left_len) { - __dirns |= 1; - __curr_rope = __c->_M_right; - __curr_start_pos += __left_len; - } else { - __curr_rope = __left; - } - } - break; - } - } - done: - // Copy last section of path into _M_path_end. - { - int __i = -1; - int __j = __curr_depth + 1 - _S_path_cache_len; - - if (__j < 0) __j = 0; - while (__j <= __curr_depth) { - __x._M_path_end[++__i] = __path[__j++]; - } - __x._M_leaf_index = __i; - } - __x._M_path_directions = __dirns; - _S_setbuf(__x); -} - -// Specialized version of the above. Assumes that -// the path cache is valid for the previous position. -template <class _CharT, class _Alloc> -void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache_for_incr -(_Rope_iterator_base<_CharT,_Alloc>& __x) -{ - int __current_index = __x._M_leaf_index; - const _RopeRep* __current_node = __x._M_path_end[__current_index]; - size_t __len = __current_node->_M_size; - size_t __node_start_pos = __x._M_leaf_pos; - unsigned char __dirns = __x._M_path_directions; - _Rope_RopeConcatenation<_CharT,_Alloc>* __c; - - if (__x._M_current_pos - __node_start_pos < __len) { - /* More stuff in this leaf, we just didn't cache it. */ - _S_setbuf(__x); - return; - } - // node_start_pos is starting position of last_node. - while (--__current_index >= 0) { - if (!(__dirns & 1) /* Path turned left */) - break; - __current_node = __x._M_path_end[__current_index]; - __c = (_Rope_RopeConcatenation<_CharT,_Alloc>*)__current_node; - // Otherwise we were in the right child. Thus we should pop - // the concatenation node. - __node_start_pos -= __c->_M_left->_M_size; - __dirns >>= 1; - } - if (__current_index < 0) { - // We underflowed the cache. Punt. - _S_setcache(__x); - return; - } - __current_node = __x._M_path_end[__current_index]; - __c = (_Rope_RopeConcatenation<_CharT,_Alloc>*)__current_node; - // current_node is a concatenation node. We are positioned on the first - // character in its right child. - // node_start_pos is starting position of current_node. - __node_start_pos += __c->_M_left->_M_size; - __current_node = __c->_M_right; - __x._M_path_end[++__current_index] = __current_node; - __dirns |= 1; - while (_Rope_constants::_S_concat == __current_node->_M_tag) { - ++__current_index; - if (_S_path_cache_len == __current_index) { - int __i; - for (__i = 0; __i < _S_path_cache_len-1; __i++) { - __x._M_path_end[__i] = __x._M_path_end[__i+1]; - } - --__current_index; - } - __current_node = - ((_Rope_RopeConcatenation<_CharT,_Alloc>*)__current_node)->_M_left; - __x._M_path_end[__current_index] = __current_node; - __dirns <<= 1; - // node_start_pos is unchanged. - } - __x._M_leaf_index = __current_index; - __x._M_leaf_pos = __node_start_pos; - __x._M_path_directions = __dirns; - _S_setbuf(__x); -} - -template <class _CharT, class _Alloc> -void _Rope_iterator_base<_CharT,_Alloc>::_M_incr(size_t __n) { - _M_current_pos += __n; - if (0 != _M_buf_ptr) { - size_t __chars_left = _M_buf_end - _M_buf_ptr; - if (__chars_left > __n) { - _M_buf_ptr += __n; - } else if (__chars_left == __n) { - _M_buf_ptr += __n; - _S_setcache_for_incr(*this); - } else { - _M_buf_ptr = 0; - } - } -} - -template <class _CharT, class _Alloc> -void _Rope_iterator_base<_CharT,_Alloc>::_M_decr(size_t __n) { - if (0 != _M_buf_ptr) { - size_t __chars_left = _M_buf_ptr - _M_buf_start; - if (__chars_left >= __n) { - _M_buf_ptr -= __n; - } else { - _M_buf_ptr = 0; - } - } - _M_current_pos -= __n; -} - -template <class _CharT, class _Alloc> -void _Rope_iterator<_CharT,_Alloc>::_M_check() { - if (_M_root_rope->_M_tree_ptr != this->_M_root) { - // _Rope was modified. Get things fixed up. - _RopeRep::_S_unref(this->_M_root); - this->_M_root = _M_root_rope->_M_tree_ptr; - _RopeRep::_S_ref(this->_M_root); - this->_M_buf_ptr = 0; - } -} - -template <class _CharT, class _Alloc> -inline -_Rope_const_iterator<_CharT, _Alloc>::_Rope_const_iterator( - const _Rope_iterator<_CharT,_Alloc>& __x) -: _Rope_iterator_base<_CharT,_Alloc>(__x) -{ } - -template <class _CharT, class _Alloc> -inline _Rope_iterator<_CharT,_Alloc>::_Rope_iterator( - rope<_CharT,_Alloc>& __r, size_t __pos) -: _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos), - _M_root_rope(&__r) -{ - _RopeRep::_S_ref(this->_M_root); -} - -template <class _CharT, class _Alloc> -inline size_t -rope<_CharT,_Alloc>::_S_char_ptr_len(const _CharT* __s) -{ - const _CharT* __p = __s; - - while (!_S_is0(*__p)) { ++__p; } - return (__p - __s); -} - - -#ifndef __GC - -template <class _CharT, class _Alloc> -inline void _Rope_RopeRep<_CharT,_Alloc>::_M_free_c_string() -{ - _CharT* __cstr = _M_c_string; - if (0 != __cstr) { - size_t __size = this->_M_size + 1; - _Destroy(__cstr, __cstr + __size); - this->_Data_deallocate(__cstr, __size); - } -} - - -template <class _CharT, class _Alloc> - inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string(_CharT* __s, - size_t __n, - allocator_type __a) -{ - if (!_S_is_basic_char_type((_CharT*)0)) { - _Destroy(__s, __s + __n); - } -// This has to be a static member, so this gets a bit messy - __a.deallocate( - __s, _Rope_RopeLeaf<_CharT,_Alloc>::_S_rounded_up_size(__n)); -} - - -// There are several reasons for not doing this with virtual destructors -// and a class specific delete operator: -// - A class specific delete operator can't easily get access to -// allocator instances if we need them. -// - Any virtual function would need a 4 or byte vtable pointer; -// this only requires a one byte tag per object. -template <class _CharT, class _Alloc> -void _Rope_RopeRep<_CharT,_Alloc>::_M_free_tree() -{ - switch(_M_tag) { - case _Rope_constants::_S_leaf: - { - _Rope_RopeLeaf<_CharT,_Alloc>* __l - = (_Rope_RopeLeaf<_CharT,_Alloc>*)this; - __l->_Rope_RopeLeaf<_CharT,_Alloc>::~_Rope_RopeLeaf(); - _L_deallocate(__l, 1); - break; - } - case _Rope_constants::_S_concat: - { - _Rope_RopeConcatenation<_CharT,_Alloc>* __c - = (_Rope_RopeConcatenation<_CharT,_Alloc>*)this; - __c->_Rope_RopeConcatenation<_CharT,_Alloc>:: - ~_Rope_RopeConcatenation(); - _C_deallocate(__c, 1); - break; - } - case _Rope_constants::_S_function: - { - _Rope_RopeFunction<_CharT,_Alloc>* __f - = (_Rope_RopeFunction<_CharT,_Alloc>*)this; - __f->_Rope_RopeFunction<_CharT,_Alloc>::~_Rope_RopeFunction(); - _F_deallocate(__f, 1); - break; - } - case _Rope_constants::_S_substringfn: - { - _Rope_RopeSubstring<_CharT,_Alloc>* __ss = - (_Rope_RopeSubstring<_CharT,_Alloc>*)this; - __ss->_Rope_RopeSubstring<_CharT,_Alloc>:: - ~_Rope_RopeSubstring(); - _S_deallocate(__ss, 1); - break; - } - } -} -#else - -template <class _CharT, class _Alloc> - inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string - (const _CharT*, size_t, allocator_type) -{} - -#endif - - -// Concatenate a C string onto a leaf rope by copying the rope data. -// Used for short ropes. -template <class _CharT, class _Alloc> -typename rope<_CharT,_Alloc>::_RopeLeaf* -rope<_CharT,_Alloc>::_S_leaf_concat_char_iter - (_RopeLeaf* __r, const _CharT* __iter, size_t __len) -{ - size_t __old_len = __r->_M_size; - _CharT* __new_data = (_CharT*) - _Data_allocate(_S_rounded_up_size(__old_len + __len)); - _RopeLeaf* __result; - - uninitialized_copy_n(__r->_M_data, __old_len, __new_data); - uninitialized_copy_n(__iter, __len, __new_data + __old_len); - _S_cond_store_eos(__new_data[__old_len + __len]); - try { - __result = _S_new_RopeLeaf(__new_data, __old_len + __len, - __r->get_allocator()); - } - catch(...) - { - _RopeRep::__STL_FREE_STRING(__new_data, __old_len + __len, - __r->get_allocator()); - __throw_exception_again; - } - return __result; -} - -#ifndef __GC -// As above, but it's OK to clobber original if refcount is 1 -template <class _CharT, class _Alloc> -typename rope<_CharT,_Alloc>::_RopeLeaf* -rope<_CharT,_Alloc>::_S_destr_leaf_concat_char_iter - (_RopeLeaf* __r, const _CharT* __iter, size_t __len) -{ - if (__r->_M_ref_count > 1) - return _S_leaf_concat_char_iter(__r, __iter, __len); - size_t __old_len = __r->_M_size; - if (_S_allocated_capacity(__old_len) >= __old_len + __len) { - // The space has been partially initialized for the standard - // character types. But that doesn't matter for those types. - uninitialized_copy_n(__iter, __len, __r->_M_data + __old_len); - if (_S_is_basic_char_type((_CharT*)0)) { - _S_cond_store_eos(__r->_M_data[__old_len + __len]); - } else if (__r->_M_c_string != __r->_M_data && 0 != __r->_M_c_string) { - __r->_M_free_c_string(); - __r->_M_c_string = 0; - } - __r->_M_size = __old_len + __len; - __r->_M_ref_count = 2; - return __r; - } else { - _RopeLeaf* __result = _S_leaf_concat_char_iter(__r, __iter, __len); - return __result; - } -} -#endif - -// Assumes left and right are not 0. -// Does not increment (nor decrement on exception) child reference counts. -// Result has ref count 1. -template <class _CharT, class _Alloc> -typename rope<_CharT,_Alloc>::_RopeRep* -rope<_CharT,_Alloc>::_S_tree_concat (_RopeRep* __left, _RopeRep* __right) -{ - _RopeConcatenation* __result = _S_new_RopeConcatenation(__left, __right, - __left->get_allocator()); - size_t __depth = __result->_M_depth; - - if (__depth > 20 && (__result->_M_size < 1000 || - __depth > _Rope_constants::_S_max_rope_depth)) - { - _RopeRep* __balanced; - - try - { - __balanced = _S_balance(__result); - __result->_M_unref_nonnil(); - } - catch(...) - { - _C_deallocate(__result,1); - __throw_exception_again; - } - // In case of exception, we need to deallocate - // otherwise dangling result node. But caller - // still owns its children. Thus unref is - // inappropriate. - return __balanced; - } - else - return __result; -} - -template <class _CharT, class _Alloc> -typename -rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter - (_RopeRep* __r, const _CharT*__s, size_t __slen) -{ - _RopeRep* __result; - if (0 == __slen) { - _S_ref(__r); - return __r; - } - if (0 == __r) - return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, - __r->get_allocator()); - if (_Rope_constants::_S_leaf == __r->_M_tag && - __r->_M_size + __slen <= _S_copy_max) { - __result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen); - return __result; - } - if (_Rope_constants::_S_concat == __r->_M_tag - && _Rope_constants::_S_leaf == ((_RopeConcatenation*)__r)->_M_right->_M_tag) { - _RopeLeaf* __right = - (_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right); - if (__right->_M_size + __slen <= _S_copy_max) { - _RopeRep* __left = ((_RopeConcatenation*)__r)->_M_left; - _RopeRep* __nright = - _S_leaf_concat_char_iter((_RopeLeaf*)__right, __s, __slen); - __left->_M_ref_nonnil(); - try { - __result = _S_tree_concat(__left, __nright); - } - catch(...) - { - _S_unref(__left); - _S_unref(__nright); - __throw_exception_again; - } - return __result; - } - } - _RopeRep* __nright = - __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->get_allocator()); - try { - __r->_M_ref_nonnil(); - __result = _S_tree_concat(__r, __nright); - } - catch(...) - { - _S_unref(__r); - _S_unref(__nright); - __throw_exception_again; - } - return __result; -} - -#ifndef __GC -template <class _CharT, class _Alloc> -typename rope<_CharT,_Alloc>::_RopeRep* -rope<_CharT,_Alloc>::_S_destr_concat_char_iter( - _RopeRep* __r, const _CharT* __s, size_t __slen) -{ - _RopeRep* __result; - if (0 == __r) - return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, - __r->get_allocator()); - size_t __count = __r->_M_ref_count; - size_t __orig_size = __r->_M_size; - if (__count > 1) return _S_concat_char_iter(__r, __s, __slen); - if (0 == __slen) { - __r->_M_ref_count = 2; // One more than before - return __r; - } - if (__orig_size + __slen <= _S_copy_max && - _Rope_constants::_S_leaf == __r->_M_tag) { - __result = _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen); - return __result; - } - if (_Rope_constants::_S_concat == __r->_M_tag) { - _RopeLeaf* __right = (_RopeLeaf*)(((_RopeConcatenation*)__r)->_M_right); - if (_Rope_constants::_S_leaf == __right->_M_tag - && __right->_M_size + __slen <= _S_copy_max) { - _RopeRep* __new_right = - _S_destr_leaf_concat_char_iter(__right, __s, __slen); - if (__right == __new_right) - __new_right->_M_ref_count = 1; - else - __right->_M_unref_nonnil(); - __r->_M_ref_count = 2; // One more than before. - ((_RopeConcatenation*)__r)->_M_right = __new_right; - __r->_M_size = __orig_size + __slen; - if (0 != __r->_M_c_string) { - __r->_M_free_c_string(); - __r->_M_c_string = 0; - } - return __r; - } - } - _RopeRep* __right = - __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->get_allocator()); - __r->_M_ref_nonnil(); - try { - __result = _S_tree_concat(__r, __right); - } - catch(...) - { - _S_unref(__r); - _S_unref(__right); - __throw_exception_again; - } - return __result; -} -#endif /* !__GC */ - -template <class _CharT, class _Alloc> -typename rope<_CharT,_Alloc>::_RopeRep* -rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right) -{ - if (0 == __left) { - _S_ref(__right); - return __right; - } - if (0 == __right) { - __left->_M_ref_nonnil(); - return __left; - } - if (_Rope_constants::_S_leaf == __right->_M_tag) { - if (_Rope_constants::_S_leaf == __left->_M_tag) { - if (__right->_M_size + __left->_M_size <= _S_copy_max) { - return _S_leaf_concat_char_iter((_RopeLeaf*)__left, - ((_RopeLeaf*)__right)->_M_data, - __right->_M_size); - } - } else if (_Rope_constants::_S_concat == __left->_M_tag - && _Rope_constants::_S_leaf == - ((_RopeConcatenation*)__left)->_M_right->_M_tag) { - _RopeLeaf* __leftright = - (_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right); - if (__leftright->_M_size + __right->_M_size <= _S_copy_max) { - _RopeRep* __leftleft = ((_RopeConcatenation*)__left)->_M_left; - _RopeRep* __rest = _S_leaf_concat_char_iter(__leftright, - ((_RopeLeaf*)__right)->_M_data, - __right->_M_size); - __leftleft->_M_ref_nonnil(); - try { - return(_S_tree_concat(__leftleft, __rest)); - } - catch(...) - { - _S_unref(__leftleft); - _S_unref(__rest); - __throw_exception_again; - } - } - } - } - __left->_M_ref_nonnil(); - __right->_M_ref_nonnil(); - try { - return(_S_tree_concat(__left, __right)); - } - catch(...) - { - _S_unref(__left); - _S_unref(__right); - __throw_exception_again; - } -} - -template <class _CharT, class _Alloc> -typename rope<_CharT,_Alloc>::_RopeRep* -rope<_CharT,_Alloc>::_S_substring(_RopeRep* __base, - size_t __start, size_t __endp1) -{ - if (0 == __base) return 0; - size_t __len = __base->_M_size; - size_t __adj_endp1; - const size_t __lazy_threshold = 128; - - if (__endp1 >= __len) { - if (0 == __start) { - __base->_M_ref_nonnil(); - return __base; - } else { - __adj_endp1 = __len; - } - } else { - __adj_endp1 = __endp1; - } - switch(__base->_M_tag) { - case _Rope_constants::_S_concat: - { - _RopeConcatenation* __c = (_RopeConcatenation*)__base; - _RopeRep* __left = __c->_M_left; - _RopeRep* __right = __c->_M_right; - size_t __left_len = __left->_M_size; - _RopeRep* __result; - - if (__adj_endp1 <= __left_len) { - return _S_substring(__left, __start, __endp1); - } else if (__start >= __left_len) { - return _S_substring(__right, __start - __left_len, - __adj_endp1 - __left_len); - } - _Self_destruct_ptr __left_result( - _S_substring(__left, __start, __left_len)); - _Self_destruct_ptr __right_result( - _S_substring(__right, 0, __endp1 - __left_len)); - __result = _S_concat(__left_result, __right_result); - return __result; - } - case _Rope_constants::_S_leaf: - { - _RopeLeaf* __l = (_RopeLeaf*)__base; - _RopeLeaf* __result; - size_t __result_len; - if (__start >= __adj_endp1) return 0; - __result_len = __adj_endp1 - __start; - if (__result_len > __lazy_threshold) goto lazy; -# ifdef __GC - const _CharT* __section = __l->_M_data + __start; - __result = _S_new_RopeLeaf(__section, __result_len, - __base->get_allocator()); - __result->_M_c_string = 0; // Not eos terminated. -# else - // We should sometimes create substring node instead. - __result = __STL_ROPE_FROM_UNOWNED_CHAR_PTR( - __l->_M_data + __start, __result_len, - __base->get_allocator()); -# endif - return __result; - } - case _Rope_constants::_S_substringfn: - // Avoid introducing multiple layers of substring nodes. - { - _RopeSubstring* __old = (_RopeSubstring*)__base; - size_t __result_len; - if (__start >= __adj_endp1) return 0; - __result_len = __adj_endp1 - __start; - if (__result_len > __lazy_threshold) { - _RopeSubstring* __result = - _S_new_RopeSubstring(__old->_M_base, - __start + __old->_M_start, - __adj_endp1 - __start, - __base->get_allocator()); - return __result; - - } // *** else fall through: *** - } - case _Rope_constants::_S_function: - { - _RopeFunction* __f = (_RopeFunction*)__base; - _CharT* __section; - size_t __result_len; - if (__start >= __adj_endp1) return 0; - __result_len = __adj_endp1 - __start; - - if (__result_len > __lazy_threshold) goto lazy; - __section = (_CharT*) - _Data_allocate(_S_rounded_up_size(__result_len)); - try { - (*(__f->_M_fn))(__start, __result_len, __section); - } - catch(...) - { - _RopeRep::__STL_FREE_STRING( - __section, __result_len, __base->get_allocator()); - __throw_exception_again; - } - _S_cond_store_eos(__section[__result_len]); - return _S_new_RopeLeaf(__section, __result_len, - __base->get_allocator()); - } - } - lazy: - { - // Create substring node. - return _S_new_RopeSubstring(__base, __start, __adj_endp1 - __start, - __base->get_allocator()); - } -} - -template<class _CharT> -class _Rope_flatten_char_consumer : public _Rope_char_consumer<_CharT> { - private: - _CharT* _M_buf_ptr; - public: - - _Rope_flatten_char_consumer(_CharT* __buffer) { - _M_buf_ptr = __buffer; - }; - ~_Rope_flatten_char_consumer() {} - bool operator() (const _CharT* __leaf, size_t __n) { - uninitialized_copy_n(__leaf, __n, _M_buf_ptr); - _M_buf_ptr += __n; - return true; - } -}; - -template<class _CharT> -class _Rope_find_char_char_consumer : public _Rope_char_consumer<_CharT> { - private: - _CharT _M_pattern; - public: - size_t _M_count; // Number of nonmatching characters - _Rope_find_char_char_consumer(_CharT __p) - : _M_pattern(__p), _M_count(0) {} - ~_Rope_find_char_char_consumer() {} - bool operator() (const _CharT* __leaf, size_t __n) { - size_t __i; - for (__i = 0; __i < __n; __i++) { - if (__leaf[__i] == _M_pattern) { - _M_count += __i; return false; - } - } - _M_count += __n; return true; - } -}; - - template<class _CharT, class _Traits> - // Here _CharT is both the stream and rope character type. -class _Rope_insert_char_consumer : public _Rope_char_consumer<_CharT> { - private: - typedef basic_ostream<_CharT,_Traits> _Insert_ostream; - _Insert_ostream& _M_o; - public: - _Rope_insert_char_consumer(_Insert_ostream& __writer) - : _M_o(__writer) {}; - ~_Rope_insert_char_consumer() { }; - // Caller is presumed to own the ostream - bool operator() (const _CharT* __leaf, size_t __n); - // Returns true to continue traversal. -}; - -template<class _CharT, class _Traits> -bool _Rope_insert_char_consumer<_CharT, _Traits>::operator() - (const _CharT* __leaf, size_t __n) -{ - size_t __i; - // We assume that formatting is set up correctly for each element. - for (__i = 0; __i < __n; __i++) _M_o.put(__leaf[__i]); - return true; -} - -template <class _CharT, class _Alloc> -bool rope<_CharT, _Alloc>::_S_apply_to_pieces( - _Rope_char_consumer<_CharT>& __c, - const _RopeRep* __r, - size_t __begin, size_t __end) -{ - if (0 == __r) return true; - switch(__r->_M_tag) { - case _Rope_constants::_S_concat: - { - _RopeConcatenation* __conc = (_RopeConcatenation*)__r; - _RopeRep* __left = __conc->_M_left; - size_t __left_len = __left->_M_size; - if (__begin < __left_len) { - size_t __left_end = std::min(__left_len, __end); - if (!_S_apply_to_pieces(__c, __left, __begin, __left_end)) - return false; - } - if (__end > __left_len) { - _RopeRep* __right = __conc->_M_right; - size_t __right_start = std::max(__left_len, __begin); - if (!_S_apply_to_pieces(__c, __right, - __right_start - __left_len, - __end - __left_len)) { - return false; - } - } - } - return true; - case _Rope_constants::_S_leaf: - { - _RopeLeaf* __l = (_RopeLeaf*)__r; - return __c(__l->_M_data + __begin, __end - __begin); - } - case _Rope_constants::_S_function: - case _Rope_constants::_S_substringfn: - { - _RopeFunction* __f = (_RopeFunction*)__r; - size_t __len = __end - __begin; - bool __result; - _CharT* __buffer = - (_CharT*)_Alloc().allocate(__len * sizeof(_CharT)); - try { - (*(__f->_M_fn))(__begin, __len, __buffer); - __result = __c(__buffer, __len); - _Alloc().deallocate(__buffer, __len * sizeof(_CharT)); - } - catch(...) - { - _Alloc().deallocate(__buffer, __len * sizeof(_CharT)); - __throw_exception_again; - } - return __result; - } - default: - return false; - } -} - - template<class _CharT, class _Traits> - inline void _Rope_fill(basic_ostream<_CharT, _Traits>& __o, size_t __n) -{ - char __f = __o.fill(); - size_t __i; - - for (__i = 0; __i < __n; __i++) __o.put(__f); -} - - -template <class _CharT> inline bool _Rope_is_simple(_CharT*) { return false; } -inline bool _Rope_is_simple(char*) { return true; } -inline bool _Rope_is_simple(wchar_t*) { return true; } - -template<class _CharT, class _Traits, class _Alloc> -basic_ostream<_CharT, _Traits>& operator<< (basic_ostream<_CharT, _Traits>& __o, - const rope<_CharT, _Alloc>& __r) -{ - size_t __w = __o.width(); - bool __left = bool(__o.flags() & std::ios::left); - size_t __pad_len; - size_t __rope_len = __r.size(); - _Rope_insert_char_consumer<_CharT, _Traits> __c(__o); - bool __is_simple = _Rope_is_simple((_CharT*)0); - - if (__rope_len < __w) { - __pad_len = __w - __rope_len; - } else { - __pad_len = 0; - } - if (!__is_simple) __o.width(__w/__rope_len); - try { - if (__is_simple && !__left && __pad_len > 0) { - _Rope_fill(__o, __pad_len); - } - __r.apply_to_pieces(0, __r.size(), __c); - if (__is_simple && __left && __pad_len > 0) { - _Rope_fill(__o, __pad_len); - } - if (!__is_simple) - __o.width(__w); - } - catch(...) - { - if (!__is_simple) - __o.width(__w); - __throw_exception_again; - } - return __o; -} - -template <class _CharT, class _Alloc> -_CharT* -rope<_CharT,_Alloc>::_S_flatten(_RopeRep* __r, - size_t __start, size_t __len, - _CharT* __buffer) -{ - _Rope_flatten_char_consumer<_CharT> __c(__buffer); - _S_apply_to_pieces(__c, __r, __start, __start + __len); - return(__buffer + __len); -} - -template <class _CharT, class _Alloc> -size_t -rope<_CharT,_Alloc>::find(_CharT __pattern, size_t __start) const -{ - _Rope_find_char_char_consumer<_CharT> __c(__pattern); - _S_apply_to_pieces(__c, this->_M_tree_ptr, __start, size()); - size_type __result_pos = __start + __c._M_count; -# ifndef __STL_OLD_ROPE_SEMANTICS - if (__result_pos == size()) __result_pos = npos; -# endif - return __result_pos; -} - -template <class _CharT, class _Alloc> -_CharT* -rope<_CharT,_Alloc>::_S_flatten(_RopeRep* __r, _CharT* __buffer) -{ - if (0 == __r) return __buffer; - switch(__r->_M_tag) { - case _Rope_constants::_S_concat: - { - _RopeConcatenation* __c = (_RopeConcatenation*)__r; - _RopeRep* __left = __c->_M_left; - _RopeRep* __right = __c->_M_right; - _CharT* __rest = _S_flatten(__left, __buffer); - return _S_flatten(__right, __rest); - } - case _Rope_constants::_S_leaf: - { - _RopeLeaf* __l = (_RopeLeaf*)__r; - return copy_n(__l->_M_data, __l->_M_size, __buffer).second; - } - case _Rope_constants::_S_function: - case _Rope_constants::_S_substringfn: - // We don't yet do anything with substring nodes. - // This needs to be fixed before ropefiles will work well. - { - _RopeFunction* __f = (_RopeFunction*)__r; - (*(__f->_M_fn))(0, __f->_M_size, __buffer); - return __buffer + __f->_M_size; - } - default: - return 0; - } -} - - -// This needs work for _CharT != char -template <class _CharT, class _Alloc> -void -rope<_CharT,_Alloc>::_S_dump(_RopeRep* __r, int __indent) -{ - for (int __i = 0; __i < __indent; __i++) putchar(' '); - if (0 == __r) { - printf("NULL\n"); return; - } - if (_Rope_constants::_S_concat == __r->_M_tag) { - _RopeConcatenation* __c = (_RopeConcatenation*)__r; - _RopeRep* __left = __c->_M_left; - _RopeRep* __right = __c->_M_right; - -# ifdef __GC - printf("Concatenation %p (depth = %d, len = %ld, %s balanced)\n", - __r, __r->_M_depth, __r->_M_size, __r->_M_is_balanced? "" : "not"); -# else - printf("Concatenation %p (rc = %ld, depth = %d, " - "len = %ld, %s balanced)\n", - __r, __r->_M_ref_count, __r->_M_depth, __r->_M_size, - __r->_M_is_balanced? "" : "not"); -# endif - _S_dump(__left, __indent + 2); - _S_dump(__right, __indent + 2); - return; - } else { - char* __kind; - - switch (__r->_M_tag) { - case _Rope_constants::_S_leaf: - __kind = "Leaf"; - break; - case _Rope_constants::_S_function: - __kind = "Function"; - break; - case _Rope_constants::_S_substringfn: - __kind = "Function representing substring"; - break; - default: - __kind = "(corrupted kind field!)"; - } -# ifdef __GC - printf("%s %p (depth = %d, len = %ld) ", - __kind, __r, __r->_M_depth, __r->_M_size); -# else - printf("%s %p (rc = %ld, depth = %d, len = %ld) ", - __kind, __r, __r->_M_ref_count, __r->_M_depth, __r->_M_size); -# endif - if (_S_is_one_byte_char_type((_CharT*)0)) { - const int __max_len = 40; - _Self_destruct_ptr __prefix(_S_substring(__r, 0, __max_len)); - _CharT __buffer[__max_len + 1]; - bool __too_big = __r->_M_size > __prefix->_M_size; - - _S_flatten(__prefix, __buffer); - __buffer[__prefix->_M_size] = _S_eos((_CharT*)0); - printf("%s%s\n", - (char*)__buffer, __too_big? "...\n" : "\n"); - } else { - printf("\n"); - } - } -} - -template <class _CharT, class _Alloc> -const unsigned long -rope<_CharT,_Alloc>::_S_min_len[_Rope_constants::_S_max_rope_depth + 1] = { -/* 0 */1, /* 1 */2, /* 2 */3, /* 3 */5, /* 4 */8, /* 5 */13, /* 6 */21, -/* 7 */34, /* 8 */55, /* 9 */89, /* 10 */144, /* 11 */233, /* 12 */377, -/* 13 */610, /* 14 */987, /* 15 */1597, /* 16 */2584, /* 17 */4181, -/* 18 */6765, /* 19 */10946, /* 20 */17711, /* 21 */28657, /* 22 */46368, -/* 23 */75025, /* 24 */121393, /* 25 */196418, /* 26 */317811, -/* 27 */514229, /* 28 */832040, /* 29 */1346269, /* 30 */2178309, -/* 31 */3524578, /* 32 */5702887, /* 33 */9227465, /* 34 */14930352, -/* 35 */24157817, /* 36 */39088169, /* 37 */63245986, /* 38 */102334155, -/* 39 */165580141, /* 40 */267914296, /* 41 */433494437, -/* 42 */701408733, /* 43 */1134903170, /* 44 */1836311903, -/* 45 */2971215073u }; -// These are Fibonacci numbers < 2**32. - -template <class _CharT, class _Alloc> -typename rope<_CharT,_Alloc>::_RopeRep* -rope<_CharT,_Alloc>::_S_balance(_RopeRep* __r) -{ - _RopeRep* __forest[_Rope_constants::_S_max_rope_depth + 1]; - _RopeRep* __result = 0; - int __i; - // Invariant: - // The concatenation of forest in descending order is equal to __r. - // __forest[__i]._M_size >= _S_min_len[__i] - // __forest[__i]._M_depth = __i - // References from forest are included in refcount. - - for (__i = 0; __i <= _Rope_constants::_S_max_rope_depth; ++__i) - __forest[__i] = 0; - try { - _S_add_to_forest(__r, __forest); - for (__i = 0; __i <= _Rope_constants::_S_max_rope_depth; ++__i) - if (0 != __forest[__i]) { -# ifndef __GC - _Self_destruct_ptr __old(__result); -# endif - __result = _S_concat(__forest[__i], __result); - __forest[__i]->_M_unref_nonnil(); -# if !defined(__GC) && defined(__EXCEPTIONS) - __forest[__i] = 0; -# endif - } - } - catch(...) - { - for(__i = 0; __i <= _Rope_constants::_S_max_rope_depth; __i++) - _S_unref(__forest[__i]); - __throw_exception_again; - } - - if (__result->_M_depth > _Rope_constants::_S_max_rope_depth) - __throw_length_error(__N("rope::_S_balance")); - return(__result); -} - - -template <class _CharT, class _Alloc> -void -rope<_CharT,_Alloc>::_S_add_to_forest(_RopeRep* __r, _RopeRep** __forest) -{ - if (__r->_M_is_balanced) { - _S_add_leaf_to_forest(__r, __forest); - return; - } - - { - _RopeConcatenation* __c = (_RopeConcatenation*)__r; - - _S_add_to_forest(__c->_M_left, __forest); - _S_add_to_forest(__c->_M_right, __forest); - } -} - - -template <class _CharT, class _Alloc> -void -rope<_CharT,_Alloc>::_S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest) -{ - _RopeRep* __insertee; // included in refcount - _RopeRep* __too_tiny = 0; // included in refcount - int __i; // forest[0..__i-1] is empty - size_t __s = __r->_M_size; - - for (__i = 0; __s >= _S_min_len[__i+1]/* not this bucket */; ++__i) { - if (0 != __forest[__i]) { -# ifndef __GC - _Self_destruct_ptr __old(__too_tiny); -# endif - __too_tiny = _S_concat_and_set_balanced(__forest[__i], __too_tiny); - __forest[__i]->_M_unref_nonnil(); - __forest[__i] = 0; - } - } - { -# ifndef __GC - _Self_destruct_ptr __old(__too_tiny); -# endif - __insertee = _S_concat_and_set_balanced(__too_tiny, __r); - } - // Too_tiny dead, and no longer included in refcount. - // Insertee is live and included. - for (;; ++__i) { - if (0 != __forest[__i]) { -# ifndef __GC - _Self_destruct_ptr __old(__insertee); -# endif - __insertee = _S_concat_and_set_balanced(__forest[__i], __insertee); - __forest[__i]->_M_unref_nonnil(); - __forest[__i] = 0; - } - if (__i == _Rope_constants::_S_max_rope_depth || - __insertee->_M_size < _S_min_len[__i+1]) { - __forest[__i] = __insertee; - // refcount is OK since __insertee is now dead. - return; - } - } -} - -template <class _CharT, class _Alloc> -_CharT -rope<_CharT,_Alloc>::_S_fetch(_RopeRep* __r, size_type __i) -{ - __GC_CONST _CharT* __cstr = __r->_M_c_string; - - if (0 != __cstr) return __cstr[__i]; - for(;;) { - switch(__r->_M_tag) { - case _Rope_constants::_S_concat: - { - _RopeConcatenation* __c = (_RopeConcatenation*)__r; - _RopeRep* __left = __c->_M_left; - size_t __left_len = __left->_M_size; - - if (__i >= __left_len) { - __i -= __left_len; - __r = __c->_M_right; - } else { - __r = __left; - } - } - break; - case _Rope_constants::_S_leaf: - { - _RopeLeaf* __l = (_RopeLeaf*)__r; - return __l->_M_data[__i]; - } - case _Rope_constants::_S_function: - case _Rope_constants::_S_substringfn: - { - _RopeFunction* __f = (_RopeFunction*)__r; - _CharT __result; - - (*(__f->_M_fn))(__i, 1, &__result); - return __result; - } - } - } -} - -# ifndef __GC -// Return a uniquely referenced character slot for the given -// position, or 0 if that's not possible. -template <class _CharT, class _Alloc> -_CharT* -rope<_CharT,_Alloc>::_S_fetch_ptr(_RopeRep* __r, size_type __i) -{ - _RopeRep* __clrstack[_Rope_constants::_S_max_rope_depth]; - size_t __csptr = 0; - - for(;;) { - if (__r->_M_ref_count > 1) return 0; - switch(__r->_M_tag) { - case _Rope_constants::_S_concat: - { - _RopeConcatenation* __c = (_RopeConcatenation*)__r; - _RopeRep* __left = __c->_M_left; - size_t __left_len = __left->_M_size; - - if (__c->_M_c_string != 0) __clrstack[__csptr++] = __c; - if (__i >= __left_len) { - __i -= __left_len; - __r = __c->_M_right; - } else { - __r = __left; - } - } - break; - case _Rope_constants::_S_leaf: - { - _RopeLeaf* __l = (_RopeLeaf*)__r; - if (__l->_M_c_string != __l->_M_data && __l->_M_c_string != 0) - __clrstack[__csptr++] = __l; - while (__csptr > 0) { - -- __csptr; - _RopeRep* __d = __clrstack[__csptr]; - __d->_M_free_c_string(); - __d->_M_c_string = 0; - } - return __l->_M_data + __i; - } - case _Rope_constants::_S_function: - case _Rope_constants::_S_substringfn: - return 0; - } - } -} -# endif /* __GC */ - -// The following could be implemented trivially using -// lexicographical_compare_3way. -// We do a little more work to avoid dealing with rope iterators for -// flat strings. -template <class _CharT, class _Alloc> -int -rope<_CharT,_Alloc>::_S_compare (const _RopeRep* __left, - const _RopeRep* __right) -{ - size_t __left_len; - size_t __right_len; - - if (0 == __right) return 0 != __left; - if (0 == __left) return -1; - __left_len = __left->_M_size; - __right_len = __right->_M_size; - if (_Rope_constants::_S_leaf == __left->_M_tag) { - _RopeLeaf* __l = (_RopeLeaf*) __left; - if (_Rope_constants::_S_leaf == __right->_M_tag) { - _RopeLeaf* __r = (_RopeLeaf*) __right; - return lexicographical_compare_3way( - __l->_M_data, __l->_M_data + __left_len, - __r->_M_data, __r->_M_data + __right_len); - } else { - const_iterator __rstart(__right, 0); - const_iterator __rend(__right, __right_len); - return lexicographical_compare_3way( - __l->_M_data, __l->_M_data + __left_len, - __rstart, __rend); - } - } else { - const_iterator __lstart(__left, 0); - const_iterator __lend(__left, __left_len); - if (_Rope_constants::_S_leaf == __right->_M_tag) { - _RopeLeaf* __r = (_RopeLeaf*) __right; - return lexicographical_compare_3way( - __lstart, __lend, - __r->_M_data, __r->_M_data + __right_len); - } else { - const_iterator __rstart(__right, 0); - const_iterator __rend(__right, __right_len); - return lexicographical_compare_3way( - __lstart, __lend, - __rstart, __rend); - } - } -} - -// Assignment to reference proxies. -template <class _CharT, class _Alloc> -_Rope_char_ref_proxy<_CharT, _Alloc>& -_Rope_char_ref_proxy<_CharT, _Alloc>::operator= (_CharT __c) { - _RopeRep* __old = _M_root->_M_tree_ptr; -# ifndef __GC - // First check for the case in which everything is uniquely - // referenced. In that case we can do this destructively. - _CharT* __ptr = _My_rope::_S_fetch_ptr(__old, _M_pos); - if (0 != __ptr) { - *__ptr = __c; - return *this; - } -# endif - _Self_destruct_ptr __left( - _My_rope::_S_substring(__old, 0, _M_pos)); - _Self_destruct_ptr __right( - _My_rope::_S_substring(__old, _M_pos+1, __old->_M_size)); - _Self_destruct_ptr __result_left( - _My_rope::_S_destr_concat_char_iter(__left, &__c, 1)); - - _RopeRep* __result = - _My_rope::_S_concat(__result_left, __right); -# ifndef __GC - _RopeRep::_S_unref(__old); -# endif - _M_root->_M_tree_ptr = __result; - return *this; -} - -template <class _CharT, class _Alloc> -inline _Rope_char_ref_proxy<_CharT, _Alloc>::operator _CharT () const -{ - if (_M_current_valid) { - return _M_current; - } else { - return _My_rope::_S_fetch(_M_root->_M_tree_ptr, _M_pos); - } -} -template <class _CharT, class _Alloc> -_Rope_char_ptr_proxy<_CharT, _Alloc> -_Rope_char_ref_proxy<_CharT, _Alloc>::operator& () const { - return _Rope_char_ptr_proxy<_CharT, _Alloc>(*this); -} - -template <class _CharT, class _Alloc> -rope<_CharT, _Alloc>::rope(size_t __n, _CharT __c, - const allocator_type& __a) -: _Base(__a) -{ - rope<_CharT,_Alloc> __result; - const size_t __exponentiate_threshold = 32; - size_t __exponent; - size_t __rest; - _CharT* __rest_buffer; - _RopeRep* __remainder; - rope<_CharT,_Alloc> __remainder_rope; - - if (0 == __n) - return; - - __exponent = __n / __exponentiate_threshold; - __rest = __n % __exponentiate_threshold; - if (0 == __rest) { - __remainder = 0; - } else { - __rest_buffer = this->_Data_allocate(_S_rounded_up_size(__rest)); - uninitialized_fill_n(__rest_buffer, __rest, __c); - _S_cond_store_eos(__rest_buffer[__rest]); - try { - __remainder = _S_new_RopeLeaf(__rest_buffer, __rest, __a); - } - catch(...) - { - _RopeRep::__STL_FREE_STRING(__rest_buffer, __rest, __a); - __throw_exception_again; - } - } - __remainder_rope._M_tree_ptr = __remainder; - if (__exponent != 0) { - _CharT* __base_buffer = - this->_Data_allocate(_S_rounded_up_size(__exponentiate_threshold)); - _RopeLeaf* __base_leaf; - rope __base_rope; - uninitialized_fill_n(__base_buffer, __exponentiate_threshold, __c); - _S_cond_store_eos(__base_buffer[__exponentiate_threshold]); - try { - __base_leaf = _S_new_RopeLeaf(__base_buffer, - __exponentiate_threshold, __a); - } - catch(...) - { - _RopeRep::__STL_FREE_STRING(__base_buffer, - __exponentiate_threshold, __a); - __throw_exception_again; - } - __base_rope._M_tree_ptr = __base_leaf; - if (1 == __exponent) { - __result = __base_rope; - } else { - __result = power(__base_rope, __exponent, - _Rope_Concat_fn<_CharT,_Alloc>()); - } - if (0 != __remainder) { - __result += __remainder_rope; - } - } else { - __result = __remainder_rope; - } - this->_M_tree_ptr = __result._M_tree_ptr; - this->_M_tree_ptr->_M_ref_nonnil(); -} - -template<class _CharT, class _Alloc> - _CharT rope<_CharT,_Alloc>::_S_empty_c_str[1]; - -template<class _CharT, class _Alloc> -const _CharT* rope<_CharT,_Alloc>::c_str() const { - if (0 == this->_M_tree_ptr) { - _S_empty_c_str[0] = _S_eos((_CharT*)0); // Possibly redundant, - // but probably fast. - return _S_empty_c_str; - } - __gthread_mutex_lock (&this->_M_tree_ptr->_M_c_string_lock); - __GC_CONST _CharT* __result = this->_M_tree_ptr->_M_c_string; - if (0 == __result) - { - size_t __s = size(); - __result = this->_Data_allocate(__s + 1); - _S_flatten(this->_M_tree_ptr, __result); - __result[__s] = _S_eos((_CharT*)0); - this->_M_tree_ptr->_M_c_string = __result; - } - __gthread_mutex_unlock (&this->_M_tree_ptr->_M_c_string_lock); - return(__result); -} - -template<class _CharT, class _Alloc> -const _CharT* rope<_CharT,_Alloc>::replace_with_c_str() { - if (0 == this->_M_tree_ptr) { - _S_empty_c_str[0] = _S_eos((_CharT*)0); - return _S_empty_c_str; - } - __GC_CONST _CharT* __old_c_string = this->_M_tree_ptr->_M_c_string; - if (_Rope_constants::_S_leaf == this->_M_tree_ptr->_M_tag - && 0 != __old_c_string) { - return(__old_c_string); - } - size_t __s = size(); - _CharT* __result = this->_Data_allocate(_S_rounded_up_size(__s)); - _S_flatten(this->_M_tree_ptr, __result); - __result[__s] = _S_eos((_CharT*)0); - this->_M_tree_ptr->_M_unref_nonnil(); - this->_M_tree_ptr = _S_new_RopeLeaf(__result, __s, this->get_allocator()); - return(__result); -} - -// Algorithm specializations. More should be added. - -template<class _Rope_iterator> // was templated on CharT and Alloc -void // VC++ workaround -_Rope_rotate(_Rope_iterator __first, - _Rope_iterator __middle, - _Rope_iterator __last) -{ - typedef typename _Rope_iterator::value_type _CharT; - typedef typename _Rope_iterator::_allocator_type _Alloc; - - rope<_CharT,_Alloc>& __r(__first.container()); - rope<_CharT,_Alloc> __prefix = __r.substr(0, __first.index()); - rope<_CharT,_Alloc> __suffix = - __r.substr(__last.index(), __r.size() - __last.index()); - rope<_CharT,_Alloc> __part1 = - __r.substr(__middle.index(), __last.index() - __middle.index()); - rope<_CharT,_Alloc> __part2 = - __r.substr(__first.index(), __middle.index() - __first.index()); - __r = __prefix; - __r += __part1; - __r += __part2; - __r += __suffix; -} - -#if !defined(__GNUC__) -// Appears to confuse g++ -inline void rotate(_Rope_iterator<char,__STL_DEFAULT_ALLOCATOR(char)> __first, - _Rope_iterator<char,__STL_DEFAULT_ALLOCATOR(char)> __middle, - _Rope_iterator<char,__STL_DEFAULT_ALLOCATOR(char)> __last) { - _Rope_rotate(__first, __middle, __last); -} -#endif - -# if 0 -// Probably not useful for several reasons: -// - for SGIs 7.1 compiler and probably some others, -// this forces lots of rope<wchar_t, ...> instantiations, creating a -// code bloat and compile time problem. (Fixed in 7.2.) -// - wchar_t is 4 bytes wide on most UNIX platforms, making it unattractive -// for unicode strings. Unsigned short may be a better character -// type. -inline void rotate( - _Rope_iterator<wchar_t,__STL_DEFAULT_ALLOCATOR(char)> __first, - _Rope_iterator<wchar_t,__STL_DEFAULT_ALLOCATOR(char)> __middle, - _Rope_iterator<wchar_t,__STL_DEFAULT_ALLOCATOR(char)> __last) { - _Rope_rotate(__first, __middle, __last); -} -# endif - -} // namespace __gnu_cxx - -// Local Variables: -// mode:C++ -// End: diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/slist b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/slist deleted file mode 100644 index 4b585203018..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/slist +++ /dev/null @@ -1,906 +0,0 @@ -// Singly-linked list implementation -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -/** @file ext/slist - * This file is a GNU extension to the Standard C++ Library (possibly - * containing extensions from the HP/SGI STL subset). You should only - * include this header if you are using GCC 3 or later. - */ - -#ifndef _SLIST -#define _SLIST 1 - -#include <bits/stl_algobase.h> -#include <bits/allocator.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/concept_check.h> - -namespace __gnu_cxx -{ -using std::size_t; -using std::ptrdiff_t; -using std::_Construct; -using std::_Destroy; -using std::allocator; - -struct _Slist_node_base -{ - _Slist_node_base* _M_next; -}; - -inline _Slist_node_base* -__slist_make_link(_Slist_node_base* __prev_node, - _Slist_node_base* __new_node) -{ - __new_node->_M_next = __prev_node->_M_next; - __prev_node->_M_next = __new_node; - return __new_node; -} - -inline _Slist_node_base* -__slist_previous(_Slist_node_base* __head, - const _Slist_node_base* __node) -{ - while (__head && __head->_M_next != __node) - __head = __head->_M_next; - return __head; -} - -inline const _Slist_node_base* -__slist_previous(const _Slist_node_base* __head, - const _Slist_node_base* __node) -{ - while (__head && __head->_M_next != __node) - __head = __head->_M_next; - return __head; -} - -inline void __slist_splice_after(_Slist_node_base* __pos, - _Slist_node_base* __before_first, - _Slist_node_base* __before_last) -{ - if (__pos != __before_first && __pos != __before_last) { - _Slist_node_base* __first = __before_first->_M_next; - _Slist_node_base* __after = __pos->_M_next; - __before_first->_M_next = __before_last->_M_next; - __pos->_M_next = __first; - __before_last->_M_next = __after; - } -} - -inline void -__slist_splice_after(_Slist_node_base* __pos, _Slist_node_base* __head) -{ - _Slist_node_base* __before_last = __slist_previous(__head, 0); - if (__before_last != __head) { - _Slist_node_base* __after = __pos->_M_next; - __pos->_M_next = __head->_M_next; - __head->_M_next = 0; - __before_last->_M_next = __after; - } -} - -inline _Slist_node_base* __slist_reverse(_Slist_node_base* __node) -{ - _Slist_node_base* __result = __node; - __node = __node->_M_next; - __result->_M_next = 0; - while(__node) { - _Slist_node_base* __next = __node->_M_next; - __node->_M_next = __result; - __result = __node; - __node = __next; - } - return __result; -} - -inline size_t __slist_size(_Slist_node_base* __node) -{ - size_t __result = 0; - for ( ; __node != 0; __node = __node->_M_next) - ++__result; - return __result; -} - -template <class _Tp> -struct _Slist_node : public _Slist_node_base -{ - _Tp _M_data; -}; - -struct _Slist_iterator_base -{ - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef std::forward_iterator_tag iterator_category; - - _Slist_node_base* _M_node; - - _Slist_iterator_base(_Slist_node_base* __x) : _M_node(__x) {} - void _M_incr() { _M_node = _M_node->_M_next; } - - bool operator==(const _Slist_iterator_base& __x) const { - return _M_node == __x._M_node; - } - bool operator!=(const _Slist_iterator_base& __x) const { - return _M_node != __x._M_node; - } -}; - -template <class _Tp, class _Ref, class _Ptr> -struct _Slist_iterator : public _Slist_iterator_base -{ - typedef _Slist_iterator<_Tp, _Tp&, _Tp*> iterator; - typedef _Slist_iterator<_Tp, const _Tp&, const _Tp*> const_iterator; - typedef _Slist_iterator<_Tp, _Ref, _Ptr> _Self; - - typedef _Tp value_type; - typedef _Ptr pointer; - typedef _Ref reference; - typedef _Slist_node<_Tp> _Node; - - _Slist_iterator(_Node* __x) : _Slist_iterator_base(__x) {} - _Slist_iterator() : _Slist_iterator_base(0) {} - _Slist_iterator(const iterator& __x) : _Slist_iterator_base(__x._M_node) {} - - reference operator*() const { return ((_Node*) _M_node)->_M_data; } - pointer operator->() const { return &(operator*()); } - - _Self& operator++() - { - _M_incr(); - return *this; - } - _Self operator++(int) - { - _Self __tmp = *this; - _M_incr(); - return __tmp; - } -}; - -template <class _Tp, class _Alloc> -struct _Slist_base - : public _Alloc::template rebind<_Slist_node<_Tp> >::other -{ - typedef typename _Alloc::template rebind<_Slist_node<_Tp> >::other _Node_alloc; - typedef _Alloc allocator_type; - allocator_type get_allocator() const { - return *static_cast<const _Node_alloc*>(this); - } - - _Slist_base(const allocator_type& __a) - : _Node_alloc(__a) { this->_M_head._M_next = 0; } - ~_Slist_base() { _M_erase_after(&this->_M_head, 0); } - -protected: - _Slist_node_base _M_head; - - _Slist_node<_Tp>* _M_get_node() { return _Node_alloc::allocate(1); } - void _M_put_node(_Slist_node<_Tp>* __p) { _Node_alloc::deallocate(__p, 1); } - -protected: - _Slist_node_base* _M_erase_after(_Slist_node_base* __pos) - { - _Slist_node<_Tp>* __next = (_Slist_node<_Tp>*) (__pos->_M_next); - _Slist_node_base* __next_next = __next->_M_next; - __pos->_M_next = __next_next; - _Destroy(&__next->_M_data); - _M_put_node(__next); - return __next_next; - } - _Slist_node_base* _M_erase_after(_Slist_node_base*, _Slist_node_base*); -}; - -template <class _Tp, class _Alloc> -_Slist_node_base* -_Slist_base<_Tp,_Alloc>::_M_erase_after(_Slist_node_base* __before_first, - _Slist_node_base* __last_node) { - _Slist_node<_Tp>* __cur = (_Slist_node<_Tp>*) (__before_first->_M_next); - while (__cur != __last_node) { - _Slist_node<_Tp>* __tmp = __cur; - __cur = (_Slist_node<_Tp>*) __cur->_M_next; - _Destroy(&__tmp->_M_data); - _M_put_node(__tmp); - } - __before_first->_M_next = __last_node; - return __last_node; -} - -/** - * This is an SGI extension. - * @ingroup SGIextensions - * @doctodo -*/ -template <class _Tp, class _Alloc = allocator<_Tp> > -class slist : private _Slist_base<_Tp,_Alloc> -{ - // concept requirements - __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - -private: - typedef _Slist_base<_Tp,_Alloc> _Base; -public: - typedef _Tp value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - - typedef _Slist_iterator<_Tp, _Tp&, _Tp*> iterator; - typedef _Slist_iterator<_Tp, const _Tp&, const _Tp*> const_iterator; - - typedef typename _Base::allocator_type allocator_type; - allocator_type get_allocator() const { return _Base::get_allocator(); } - -private: - typedef _Slist_node<_Tp> _Node; - typedef _Slist_node_base _Node_base; - typedef _Slist_iterator_base _Iterator_base; - - _Node* _M_create_node(const value_type& __x) { - _Node* __node = this->_M_get_node(); - try { - _Construct(&__node->_M_data, __x); - __node->_M_next = 0; - } - catch(...) - { - this->_M_put_node(__node); - __throw_exception_again; - } - return __node; - } - - _Node* _M_create_node() { - _Node* __node = this->_M_get_node(); - try { - _Construct(&__node->_M_data); - __node->_M_next = 0; - } - catch(...) - { - this->_M_put_node(__node); - __throw_exception_again; - } - return __node; - } - -public: - explicit slist(const allocator_type& __a = allocator_type()) : _Base(__a) {} - - slist(size_type __n, const value_type& __x, - const allocator_type& __a = allocator_type()) : _Base(__a) - { _M_insert_after_fill(&this->_M_head, __n, __x); } - - explicit slist(size_type __n) : _Base(allocator_type()) - { _M_insert_after_fill(&this->_M_head, __n, value_type()); } - - // We don't need any dispatching tricks here, because _M_insert_after_range - // already does them. - template <class _InputIterator> - slist(_InputIterator __first, _InputIterator __last, - const allocator_type& __a = allocator_type()) : _Base(__a) - { _M_insert_after_range(&this->_M_head, __first, __last); } - - slist(const slist& __x) : _Base(__x.get_allocator()) - { _M_insert_after_range(&this->_M_head, __x.begin(), __x.end()); } - - slist& operator= (const slist& __x); - - ~slist() {} - -public: - // assign(), a generalized assignment member function. Two - // versions: one that takes a count, and one that takes a range. - // The range version is a member template, so we dispatch on whether - // or not the type is an integer. - - void assign(size_type __n, const _Tp& __val) - { _M_fill_assign(__n, __val); } - - void _M_fill_assign(size_type __n, const _Tp& __val); - - template <class _InputIterator> - void assign(_InputIterator __first, _InputIterator __last) { - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - _M_assign_dispatch(__first, __last, _Integral()); - } - - template <class _Integer> - void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) - { _M_fill_assign((size_type) __n, (_Tp) __val); } - - template <class _InputIterator> - void _M_assign_dispatch(_InputIterator __first, _InputIterator __last, - __false_type); - -public: - - iterator begin() { return iterator((_Node*)this->_M_head._M_next); } - const_iterator begin() const - { return const_iterator((_Node*)this->_M_head._M_next);} - - iterator end() { return iterator(0); } - const_iterator end() const { return const_iterator(0); } - - // Experimental new feature: before_begin() returns a - // non-dereferenceable iterator that, when incremented, yields - // begin(). This iterator may be used as the argument to - // insert_after, erase_after, etc. Note that even for an empty - // slist, before_begin() is not the same iterator as end(). It - // is always necessary to increment before_begin() at least once to - // obtain end(). - iterator before_begin() { return iterator((_Node*) &this->_M_head); } - const_iterator before_begin() const - { return const_iterator((_Node*) &this->_M_head); } - - size_type size() const { return __slist_size(this->_M_head._M_next); } - - size_type max_size() const { return size_type(-1); } - - bool empty() const { return this->_M_head._M_next == 0; } - - void swap(slist& __x) - { std::swap(this->_M_head._M_next, __x._M_head._M_next); } - -public: - - reference front() { return ((_Node*) this->_M_head._M_next)->_M_data; } - const_reference front() const - { return ((_Node*) this->_M_head._M_next)->_M_data; } - void push_front(const value_type& __x) { - __slist_make_link(&this->_M_head, _M_create_node(__x)); - } - void push_front() { __slist_make_link(&this->_M_head, _M_create_node()); } - void pop_front() { - _Node* __node = (_Node*) this->_M_head._M_next; - this->_M_head._M_next = __node->_M_next; - _Destroy(&__node->_M_data); - this->_M_put_node(__node); - } - - iterator previous(const_iterator __pos) { - return iterator((_Node*) __slist_previous(&this->_M_head, __pos._M_node)); - } - const_iterator previous(const_iterator __pos) const { - return const_iterator((_Node*) __slist_previous(&this->_M_head, - __pos._M_node)); - } - -private: - _Node* _M_insert_after(_Node_base* __pos, const value_type& __x) { - return (_Node*) (__slist_make_link(__pos, _M_create_node(__x))); - } - - _Node* _M_insert_after(_Node_base* __pos) { - return (_Node*) (__slist_make_link(__pos, _M_create_node())); - } - - void _M_insert_after_fill(_Node_base* __pos, - size_type __n, const value_type& __x) { - for (size_type __i = 0; __i < __n; ++__i) - __pos = __slist_make_link(__pos, _M_create_node(__x)); - } - - // Check whether it's an integral type. If so, it's not an iterator. - template <class _InIterator> - void _M_insert_after_range(_Node_base* __pos, - _InIterator __first, _InIterator __last) { - typedef typename _Is_integer<_InIterator>::_Integral _Integral; - _M_insert_after_range(__pos, __first, __last, _Integral()); - } - - template <class _Integer> - void _M_insert_after_range(_Node_base* __pos, _Integer __n, _Integer __x, - __true_type) { - _M_insert_after_fill(__pos, __n, __x); - } - - template <class _InIterator> - void _M_insert_after_range(_Node_base* __pos, - _InIterator __first, _InIterator __last, - __false_type) { - while (__first != __last) { - __pos = __slist_make_link(__pos, _M_create_node(*__first)); - ++__first; - } - } - -public: - - iterator insert_after(iterator __pos, const value_type& __x) { - return iterator(_M_insert_after(__pos._M_node, __x)); - } - - iterator insert_after(iterator __pos) { - return insert_after(__pos, value_type()); - } - - void insert_after(iterator __pos, size_type __n, const value_type& __x) { - _M_insert_after_fill(__pos._M_node, __n, __x); - } - - // We don't need any dispatching tricks here, because _M_insert_after_range - // already does them. - template <class _InIterator> - void insert_after(iterator __pos, _InIterator __first, _InIterator __last) { - _M_insert_after_range(__pos._M_node, __first, __last); - } - - iterator insert(iterator __pos, const value_type& __x) { - return iterator(_M_insert_after(__slist_previous(&this->_M_head, - __pos._M_node), - __x)); - } - - iterator insert(iterator __pos) { - return iterator(_M_insert_after(__slist_previous(&this->_M_head, - __pos._M_node), - value_type())); - } - - void insert(iterator __pos, size_type __n, const value_type& __x) { - _M_insert_after_fill(__slist_previous(&this->_M_head, __pos._M_node), - __n, __x); - } - - // We don't need any dispatching tricks here, because _M_insert_after_range - // already does them. - template <class _InIterator> - void insert(iterator __pos, _InIterator __first, _InIterator __last) { - _M_insert_after_range(__slist_previous(&this->_M_head, __pos._M_node), - __first, __last); - } - -public: - iterator erase_after(iterator __pos) { - return iterator((_Node*) this->_M_erase_after(__pos._M_node)); - } - iterator erase_after(iterator __before_first, iterator __last) { - return iterator((_Node*) this->_M_erase_after(__before_first._M_node, - __last._M_node)); - } - - iterator erase(iterator __pos) { - return (_Node*) this->_M_erase_after(__slist_previous(&this->_M_head, - __pos._M_node)); - } - iterator erase(iterator __first, iterator __last) { - return (_Node*) this->_M_erase_after( - __slist_previous(&this->_M_head, __first._M_node), __last._M_node); - } - - void resize(size_type new_size, const _Tp& __x); - void resize(size_type new_size) { resize(new_size, _Tp()); } - void clear() { this->_M_erase_after(&this->_M_head, 0); } - -public: - // Moves the range [__before_first + 1, __before_last + 1) to *this, - // inserting it immediately after __pos. This is constant time. - void splice_after(iterator __pos, - iterator __before_first, iterator __before_last) - { - if (__before_first != __before_last) - __slist_splice_after(__pos._M_node, __before_first._M_node, - __before_last._M_node); - } - - // Moves the element that follows __prev to *this, inserting it immediately - // after __pos. This is constant time. - void splice_after(iterator __pos, iterator __prev) - { - __slist_splice_after(__pos._M_node, - __prev._M_node, __prev._M_node->_M_next); - } - - - // Removes all of the elements from the list __x to *this, inserting - // them immediately after __pos. __x must not be *this. Complexity: - // linear in __x.size(). - void splice_after(iterator __pos, slist& __x) - { - __slist_splice_after(__pos._M_node, &__x._M_head); - } - - // Linear in distance(begin(), __pos), and linear in __x.size(). - void splice(iterator __pos, slist& __x) { - if (__x._M_head._M_next) - __slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node), - &__x._M_head, __slist_previous(&__x._M_head, 0)); - } - - // Linear in distance(begin(), __pos), and in distance(__x.begin(), __i). - void splice(iterator __pos, slist& __x, iterator __i) { - __slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node), - __slist_previous(&__x._M_head, __i._M_node), - __i._M_node); - } - - // Linear in distance(begin(), __pos), in distance(__x.begin(), __first), - // and in distance(__first, __last). - void splice(iterator __pos, slist& __x, iterator __first, iterator __last) - { - if (__first != __last) - __slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node), - __slist_previous(&__x._M_head, __first._M_node), - __slist_previous(__first._M_node, __last._M_node)); - } - -public: - void reverse() { - if (this->_M_head._M_next) - this->_M_head._M_next = __slist_reverse(this->_M_head._M_next); - } - - void remove(const _Tp& __val); - void unique(); - void merge(slist& __x); - void sort(); - - template <class _Predicate> - void remove_if(_Predicate __pred); - - template <class _BinaryPredicate> - void unique(_BinaryPredicate __pred); - - template <class _StrictWeakOrdering> - void merge(slist&, _StrictWeakOrdering); - - template <class _StrictWeakOrdering> - void sort(_StrictWeakOrdering __comp); -}; - -template <class _Tp, class _Alloc> -slist<_Tp,_Alloc>& slist<_Tp,_Alloc>::operator=(const slist<_Tp,_Alloc>& __x) -{ - if (&__x != this) { - _Node_base* __p1 = &this->_M_head; - _Node* __n1 = (_Node*) this->_M_head._M_next; - const _Node* __n2 = (const _Node*) __x._M_head._M_next; - while (__n1 && __n2) { - __n1->_M_data = __n2->_M_data; - __p1 = __n1; - __n1 = (_Node*) __n1->_M_next; - __n2 = (const _Node*) __n2->_M_next; - } - if (__n2 == 0) - this->_M_erase_after(__p1, 0); - else - _M_insert_after_range(__p1, const_iterator((_Node*)__n2), - const_iterator(0)); - } - return *this; -} - -template <class _Tp, class _Alloc> -void slist<_Tp, _Alloc>::_M_fill_assign(size_type __n, const _Tp& __val) { - _Node_base* __prev = &this->_M_head; - _Node* __node = (_Node*) this->_M_head._M_next; - for ( ; __node != 0 && __n > 0 ; --__n) { - __node->_M_data = __val; - __prev = __node; - __node = (_Node*) __node->_M_next; - } - if (__n > 0) - _M_insert_after_fill(__prev, __n, __val); - else - this->_M_erase_after(__prev, 0); -} - -template <class _Tp, class _Alloc> template <class _InputIterator> -void -slist<_Tp, _Alloc>::_M_assign_dispatch(_InputIterator __first, _InputIterator __last, - __false_type) -{ - _Node_base* __prev = &this->_M_head; - _Node* __node = (_Node*) this->_M_head._M_next; - while (__node != 0 && __first != __last) { - __node->_M_data = *__first; - __prev = __node; - __node = (_Node*) __node->_M_next; - ++__first; - } - if (__first != __last) - _M_insert_after_range(__prev, __first, __last); - else - this->_M_erase_after(__prev, 0); -} - -template <class _Tp, class _Alloc> -inline bool -operator==(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) -{ - typedef typename slist<_Tp,_Alloc>::const_iterator const_iterator; - const_iterator __end1 = _SL1.end(); - const_iterator __end2 = _SL2.end(); - - const_iterator __i1 = _SL1.begin(); - const_iterator __i2 = _SL2.begin(); - while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2) { - ++__i1; - ++__i2; - } - return __i1 == __end1 && __i2 == __end2; -} - - -template <class _Tp, class _Alloc> -inline bool -operator<(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) -{ - return std::lexicographical_compare(_SL1.begin(), _SL1.end(), - _SL2.begin(), _SL2.end()); -} - -template <class _Tp, class _Alloc> -inline bool -operator!=(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) { - return !(_SL1 == _SL2); -} - -template <class _Tp, class _Alloc> -inline bool -operator>(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) { - return _SL2 < _SL1; -} - -template <class _Tp, class _Alloc> -inline bool -operator<=(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) { - return !(_SL2 < _SL1); -} - -template <class _Tp, class _Alloc> -inline bool -operator>=(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) { - return !(_SL1 < _SL2); -} - -template <class _Tp, class _Alloc> -inline void swap(slist<_Tp,_Alloc>& __x, slist<_Tp,_Alloc>& __y) { - __x.swap(__y); -} - - -template <class _Tp, class _Alloc> -void slist<_Tp,_Alloc>::resize(size_type __len, const _Tp& __x) -{ - _Node_base* __cur = &this->_M_head; - while (__cur->_M_next != 0 && __len > 0) { - --__len; - __cur = __cur->_M_next; - } - if (__cur->_M_next) - this->_M_erase_after(__cur, 0); - else - _M_insert_after_fill(__cur, __len, __x); -} - -template <class _Tp, class _Alloc> -void slist<_Tp,_Alloc>::remove(const _Tp& __val) -{ - _Node_base* __cur = &this->_M_head; - while (__cur && __cur->_M_next) { - if (((_Node*) __cur->_M_next)->_M_data == __val) - this->_M_erase_after(__cur); - else - __cur = __cur->_M_next; - } -} - -template <class _Tp, class _Alloc> -void slist<_Tp,_Alloc>::unique() -{ - _Node_base* __cur = this->_M_head._M_next; - if (__cur) { - while (__cur->_M_next) { - if (((_Node*)__cur)->_M_data == - ((_Node*)(__cur->_M_next))->_M_data) - this->_M_erase_after(__cur); - else - __cur = __cur->_M_next; - } - } -} - -template <class _Tp, class _Alloc> -void slist<_Tp,_Alloc>::merge(slist<_Tp,_Alloc>& __x) -{ - _Node_base* __n1 = &this->_M_head; - while (__n1->_M_next && __x._M_head._M_next) { - if (((_Node*) __x._M_head._M_next)->_M_data < - ((_Node*) __n1->_M_next)->_M_data) - __slist_splice_after(__n1, &__x._M_head, __x._M_head._M_next); - __n1 = __n1->_M_next; - } - if (__x._M_head._M_next) { - __n1->_M_next = __x._M_head._M_next; - __x._M_head._M_next = 0; - } -} - -template <class _Tp, class _Alloc> -void slist<_Tp,_Alloc>::sort() -{ - if (this->_M_head._M_next && this->_M_head._M_next->_M_next) { - slist __carry; - slist __counter[64]; - int __fill = 0; - while (!empty()) { - __slist_splice_after(&__carry._M_head, - &this->_M_head, this->_M_head._M_next); - int __i = 0; - while (__i < __fill && !__counter[__i].empty()) { - __counter[__i].merge(__carry); - __carry.swap(__counter[__i]); - ++__i; - } - __carry.swap(__counter[__i]); - if (__i == __fill) - ++__fill; - } - - for (int __i = 1; __i < __fill; ++__i) - __counter[__i].merge(__counter[__i-1]); - this->swap(__counter[__fill-1]); - } -} - -template <class _Tp, class _Alloc> -template <class _Predicate> -void slist<_Tp,_Alloc>::remove_if(_Predicate __pred) -{ - _Node_base* __cur = &this->_M_head; - while (__cur->_M_next) { - if (__pred(((_Node*) __cur->_M_next)->_M_data)) - this->_M_erase_after(__cur); - else - __cur = __cur->_M_next; - } -} - -template <class _Tp, class _Alloc> template <class _BinaryPredicate> -void slist<_Tp,_Alloc>::unique(_BinaryPredicate __pred) -{ - _Node* __cur = (_Node*) this->_M_head._M_next; - if (__cur) { - while (__cur->_M_next) { - if (__pred(((_Node*)__cur)->_M_data, - ((_Node*)(__cur->_M_next))->_M_data)) - this->_M_erase_after(__cur); - else - __cur = (_Node*) __cur->_M_next; - } - } -} - -template <class _Tp, class _Alloc> template <class _StrictWeakOrdering> -void slist<_Tp,_Alloc>::merge(slist<_Tp,_Alloc>& __x, - _StrictWeakOrdering __comp) -{ - _Node_base* __n1 = &this->_M_head; - while (__n1->_M_next && __x._M_head._M_next) { - if (__comp(((_Node*) __x._M_head._M_next)->_M_data, - ((_Node*) __n1->_M_next)->_M_data)) - __slist_splice_after(__n1, &__x._M_head, __x._M_head._M_next); - __n1 = __n1->_M_next; - } - if (__x._M_head._M_next) { - __n1->_M_next = __x._M_head._M_next; - __x._M_head._M_next = 0; - } -} - -template <class _Tp, class _Alloc> template <class _StrictWeakOrdering> -void slist<_Tp,_Alloc>::sort(_StrictWeakOrdering __comp) -{ - if (this->_M_head._M_next && this->_M_head._M_next->_M_next) { - slist __carry; - slist __counter[64]; - int __fill = 0; - while (!empty()) { - __slist_splice_after(&__carry._M_head, - &this->_M_head, this->_M_head._M_next); - int __i = 0; - while (__i < __fill && !__counter[__i].empty()) { - __counter[__i].merge(__carry, __comp); - __carry.swap(__counter[__i]); - ++__i; - } - __carry.swap(__counter[__i]); - if (__i == __fill) - ++__fill; - } - - for (int __i = 1; __i < __fill; ++__i) - __counter[__i].merge(__counter[__i-1], __comp); - this->swap(__counter[__fill-1]); - } -} - -} // namespace __gnu_cxx - -namespace std -{ -// Specialization of insert_iterator so that insertions will be constant -// time rather than linear time. - -template <class _Tp, class _Alloc> -class insert_iterator<__gnu_cxx::slist<_Tp, _Alloc> > { -protected: - typedef __gnu_cxx::slist<_Tp, _Alloc> _Container; - _Container* container; - typename _Container::iterator iter; -public: - typedef _Container container_type; - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - insert_iterator(_Container& __x, typename _Container::iterator __i) - : container(&__x) { - if (__i == __x.begin()) - iter = __x.before_begin(); - else - iter = __x.previous(__i); - } - - insert_iterator<_Container>& - operator=(const typename _Container::value_type& __value) { - iter = container->insert_after(iter, __value); - return *this; - } - insert_iterator<_Container>& operator*() { return *this; } - insert_iterator<_Container>& operator++() { return *this; } - insert_iterator<_Container>& operator++(int) { return *this; } -}; - -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/stdio_filebuf.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/stdio_filebuf.h deleted file mode 100644 index cc229728fa8..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/stdio_filebuf.h +++ /dev/null @@ -1,162 +0,0 @@ -// File descriptor layer for filebuf -*- C++ -*- - -// Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file ext/stdio_filebuf.h - * This file is a GNU extension to the Standard C++ Library. - */ - -#ifndef _STDIO_FILEBUF_H -#define _STDIO_FILEBUF_H 1 - -#pragma GCC system_header - -#include <fstream> - -namespace __gnu_cxx -{ - /** - * @class stdio_filebuf ext/stdio_filebuf.h <ext/stdio_filebuf.h> - * @brief Provides a layer of compatibility for C/POSIX. - * - * This GNU extension provides extensions for working with standard C - * FILE*'s and POSIX file descriptors. It must be instantiated by the - * user with the type of character used in the file stream, e.g., - * stdio_filebuf<char>. - */ - template<typename _CharT, typename _Traits = std::char_traits<_CharT> > - class stdio_filebuf : public std::basic_filebuf<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - typedef std::size_t size_t; - - public: - /** - * deferred initialization - */ - stdio_filebuf() : std::basic_filebuf<_CharT, _Traits>() {} - - /** - * @param fd An open file descriptor. - * @param mode Same meaning as in a standard filebuf. - * @param size Optimal or preferred size of internal buffer, in chars. - * - * This constructor associates a file stream buffer with an open - * POSIX file descriptor. The file descriptor will be automatically - * closed when the stdio_filebuf is closed/destroyed. - */ - stdio_filebuf(int __fd, std::ios_base::openmode __mode, - size_t __size = static_cast<size_t>(BUFSIZ)); - - /** - * @param f An open @c FILE*. - * @param mode Same meaning as in a standard filebuf. - * @param size Optimal or preferred size of internal buffer, in chars. - * Defaults to system's @c BUFSIZ. - * - * This constructor associates a file stream buffer with an open - * C @c FILE*. The @c FILE* will not be automatically closed when the - * stdio_filebuf is closed/destroyed. - */ - stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode, - size_t __size = static_cast<size_t>(BUFSIZ)); - - /** - * Closes the external data stream if the file descriptor constructor - * was used. - */ - virtual - ~stdio_filebuf(); - - /** - * @return The underlying file descriptor. - * - * Once associated with an external data stream, this function can be - * used to access the underlying POSIX file descriptor. Note that - * there is no way for the library to track what you do with the - * descriptor, so be careful. - */ - int - fd() { return this->_M_file.fd(); } - - /** - * @return The underlying FILE*. - * - * This function can be used to access the underlying "C" file pointer. - * Note that there is no way for the library to track what you do - * with the file, so be careful. - */ - std::__c_file* - file() { return this->_M_file.file(); } - }; - - template<typename _CharT, typename _Traits> - stdio_filebuf<_CharT, _Traits>::~stdio_filebuf() - { } - - template<typename _CharT, typename _Traits> - stdio_filebuf<_CharT, _Traits>:: - stdio_filebuf(int __fd, std::ios_base::openmode __mode, size_t __size) - { - this->_M_file.sys_open(__fd, __mode); - if (this->is_open()) - { - this->_M_mode = __mode; - this->_M_buf_size = __size; - this->_M_allocate_internal_buffer(); - this->_M_reading = false; - this->_M_writing = false; - this->_M_set_buffer(-1); - } - } - - template<typename _CharT, typename _Traits> - stdio_filebuf<_CharT, _Traits>:: - stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode, - size_t __size) - { - this->_M_file.sys_open(__f, __mode); - if (this->is_open()) - { - this->_M_mode = __mode; - this->_M_buf_size = __size; - this->_M_allocate_internal_buffer(); - this->_M_reading = false; - this->_M_writing = false; - this->_M_set_buffer(-1); - } - } -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/stdio_sync_filebuf.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/stdio_sync_filebuf.h deleted file mode 100644 index 367d310b4b0..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/stdio_sync_filebuf.h +++ /dev/null @@ -1,281 +0,0 @@ -// Iostreams wrapper for stdio FILE* -*- C++ -*- - -// Copyright (C) 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file ext/stdiostream.h - * This file is a GNU extension to the Standard C++ Library. - */ - -#ifndef _STDIO_SYNC_FILEBUF_H -#define _STDIO_SYNC_FILEBUF_H 1 - -#pragma GCC system_header - -#include <streambuf> -#include <unistd.h> -#include <cstdio> - -#ifdef _GLIBCXX_USE_WCHAR_T -#include <cwchar> -#endif - -namespace __gnu_cxx -{ - template<typename _CharT, typename _Traits = std::char_traits<_CharT> > - class stdio_sync_filebuf : public std::basic_streambuf<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - private: - // Underlying stdio FILE - std::__c_file* const _M_file; - - // Last character gotten. This is used when pbackfail is - // called from basic_streambuf::sungetc() - int_type _M_unget_buf; - - public: - explicit - stdio_sync_filebuf(std::__c_file* __f) - : _M_file(__f), _M_unget_buf(traits_type::eof()) - { } - - /** - * @return The underlying FILE*. - * - * This function can be used to access the underlying "C" file pointer. - * Note that there is no way for the library to track what you do - * with the file, so be careful. - */ - std::__c_file* const - file() { return this->_M_file; } - - protected: - int_type - syncgetc(); - - int_type - syncungetc(int_type __c); - - int_type - syncputc(int_type __c); - - virtual int_type - underflow() - { - int_type __c = this->syncgetc(); - return this->syncungetc(__c); - } - - virtual int_type - uflow() - { - // Store the gotten character in case we need to unget it. - _M_unget_buf = this->syncgetc(); - return _M_unget_buf; - } - - virtual int_type - pbackfail(int_type __c = traits_type::eof()) - { - int_type __ret; - const int_type __eof = traits_type::eof(); - - // Check if the unget or putback was requested - if (traits_type::eq_int_type(__c, __eof)) // unget - { - if (!traits_type::eq_int_type(_M_unget_buf, __eof)) - __ret = this->syncungetc(_M_unget_buf); - else // buffer invalid, fail. - __ret = __eof; - } - else // putback - __ret = this->syncungetc(__c); - - // The buffered character is no longer valid, discard it. - _M_unget_buf = __eof; - return __ret; - } - - virtual std::streamsize - xsgetn(char_type* __s, std::streamsize __n); - - virtual int_type - overflow(int_type __c = traits_type::eof()) - { - int_type __ret; - if (traits_type::eq_int_type(__c, traits_type::eof())) - { - if (std::fflush(_M_file)) - __ret = traits_type::eof(); - else - __ret = traits_type::not_eof(__c); - } - else - __ret = this->syncputc(__c); - return __ret; - } - - virtual std::streamsize - xsputn(const char_type* __s, std::streamsize __n); - - virtual int - sync() - { return std::fflush(_M_file); } - - virtual std::streampos - seekoff(std::streamoff __off, std::ios_base::seekdir __dir, - std::ios_base::openmode = std::ios_base::in | std::ios_base::out) - { - std::streampos __ret(std::streamoff(-1)); - int __whence; - if (__dir == std::ios_base::beg) - __whence = SEEK_SET; - else if (__dir == std::ios_base::cur) - __whence = SEEK_CUR; - else - __whence = SEEK_END; -#ifdef _GLIBCXX_USE_LFS - if (!fseeko64(_M_file, __off, __whence)) - __ret = std::streampos(ftello64(_M_file)); -#else - if (!fseek(_M_file, __off, __whence)) - __ret = std::streampos(std::ftell(_M_file)); -#endif - return __ret; - } - - virtual std::streampos - seekpos(std::streampos __pos, - std::ios_base::openmode __mode = - std::ios_base::in | std::ios_base::out) - { return seekoff(std::streamoff(__pos), std::ios_base::beg, __mode); } - }; - - template<> - inline stdio_sync_filebuf<char>::int_type - stdio_sync_filebuf<char>::syncgetc() - { return std::getc(_M_file); } - - template<> - inline stdio_sync_filebuf<char>::int_type - stdio_sync_filebuf<char>::syncungetc(int_type __c) - { return std::ungetc(__c, _M_file); } - - template<> - inline stdio_sync_filebuf<char>::int_type - stdio_sync_filebuf<char>::syncputc(int_type __c) - { return std::putc(__c, _M_file); } - - template<> - inline std::streamsize - stdio_sync_filebuf<char>::xsgetn(char* __s, std::streamsize __n) - { - std::streamsize __ret = std::fread(__s, 1, __n, _M_file); - if (__ret > 0) - _M_unget_buf = traits_type::to_int_type(__s[__ret - 1]); - else - _M_unget_buf = traits_type::eof(); - return __ret; - } - - template<> - inline std::streamsize - stdio_sync_filebuf<char>::xsputn(const char* __s, std::streamsize __n) - { return std::fwrite(__s, 1, __n, _M_file); } - -#ifdef _GLIBCXX_USE_WCHAR_T - template<> - inline stdio_sync_filebuf<wchar_t>::int_type - stdio_sync_filebuf<wchar_t>::syncgetc() - { return std::getwc(_M_file); } - - template<> - inline stdio_sync_filebuf<wchar_t>::int_type - stdio_sync_filebuf<wchar_t>::syncungetc(int_type __c) - { return std::ungetwc(__c, _M_file); } - - template<> - inline stdio_sync_filebuf<wchar_t>::int_type - stdio_sync_filebuf<wchar_t>::syncputc(int_type __c) - { return std::putwc(__c, _M_file); } - - template<> - inline std::streamsize - stdio_sync_filebuf<wchar_t>::xsgetn(wchar_t* __s, std::streamsize __n) - { - std::streamsize __ret = 0; - const int_type __eof = traits_type::eof(); - while (__n--) - { - int_type __c = this->syncgetc(); - if (traits_type::eq_int_type(__c, __eof)) - break; - __s[__ret] = traits_type::to_char_type(__c); - ++__ret; - } - - if (__ret > 0) - _M_unget_buf = traits_type::to_int_type(__s[__ret - 1]); - else - _M_unget_buf = traits_type::eof(); - return __ret; - } - - template<> - inline std::streamsize - stdio_sync_filebuf<wchar_t>::xsputn(const wchar_t* __s, - std::streamsize __n) - { - std::streamsize __ret = 0; - const int_type __eof = traits_type::eof(); - while (__n--) - { - if (traits_type::eq_int_type(this->syncputc(*__s++), __eof)) - break; - ++__ret; - } - return __ret; - } -#endif - -#if _GLIBCXX_EXTERN_TEMPLATE - extern template class stdio_sync_filebuf<char>; -#ifdef _GLIBCXX_USE_WCHAR_T - extern template class stdio_sync_filebuf<wchar_t>; -#endif -#endif -} // namespace __gnu_cxx - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/fstream b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/fstream deleted file mode 100644 index 3dec366fcc1..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/fstream +++ /dev/null @@ -1,843 +0,0 @@ -// File based streams -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.8 File-based streams -// - -/** @file fstream - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_FSTREAM -#define _GLIBCXX_FSTREAM 1 - -#pragma GCC system_header - -#include <istream> -#include <ostream> -#include <locale> // For codecvt -#include <cstdio> // For SEEK_SET, SEEK_CUR, SEEK_END, BUFSIZ -#include <bits/basic_file.h> -#include <bits/gthr.h> - -namespace std -{ - // [27.8.1.1] template class basic_filebuf - /** - * @brief The actual work of input and output (for files). - * - * This class associates both its input and output sequence with an - * external disk file, and maintains a joint file position for both - * sequences. Many of its sematics are described in terms of similar - * behavior in the Standard C Library's @c FILE streams. - */ - // Requirements on traits_type, specific to this class: - // traits_type::pos_type must be fpos<traits_type::state_type> - // traits_type::off_type must be streamoff - // traits_type::state_type must be Assignable and DefaultConstructable, - // and traits_type::state_type() must be the initial state for codecvt. - template<typename _CharT, typename _Traits> - class basic_filebuf : public basic_streambuf<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - //@{ - /** - * @if maint - * @doctodo - * @endif - */ - typedef basic_streambuf<char_type, traits_type> __streambuf_type; - typedef basic_filebuf<char_type, traits_type> __filebuf_type; - typedef __basic_file<char> __file_type; - typedef typename traits_type::state_type __state_type; - typedef codecvt<char_type, char, __state_type> __codecvt_type; - //@} - - friend class ios_base; // For sync_with_stdio. - - protected: - // Data Members: - // MT lock inherited from libio or other low-level io library. - /** - * @if maint - * @doctodo - * @endif - */ - __c_lock _M_lock; - - // External buffer. - /** - * @if maint - * @doctodo - * @endif - */ - __file_type _M_file; - - /** - * @if maint - * Place to stash in || out || in | out settings for current filebuf. - * @endif - */ - ios_base::openmode _M_mode; - - // Beginning state type for codecvt. - /** - * @if maint - * @doctodo - * @endif - */ - __state_type _M_state_beg; - - // During output, the state that corresponds to pptr(), - // during input, the state that corresponds to egptr() and - // _M_ext_next. - /** - * @if maint - * @doctodo - * @endif - */ - __state_type _M_state_cur; - - // Not used for output. During input, the state that corresponds - // to eback() and _M_ext_buf. - /** - * @if maint - * @doctodo - * @endif - */ - __state_type _M_state_last; - - /** - * @if maint - * Pointer to the beginning of internal buffer. - * @endif - */ - char_type* _M_buf; - - /** - * @if maint - * Actual size of internal buffer. This number is equal to the size - * of the put area + 1 position, reserved for the overflow char of - * a full area. - * @endif - */ - size_t _M_buf_size; - - // Set iff _M_buf is allocated memory from _M_allocate_internal_buffer. - /** - * @if maint - * @doctodo - * @endif - */ - bool _M_buf_allocated; - - /** - * @if maint - * _M_reading == false && _M_writing == false for 'uncommitted' mode; - * _M_reading == true for 'read' mode; - * _M_writing == true for 'write' mode; - * - * NB: _M_reading == true && _M_writing == true is unused. - * @endif - */ - bool _M_reading; - bool _M_writing; - - //@{ - /** - * @if maint - * Necessary bits for putback buffer management. - * - * @note pbacks of over one character are not currently supported. - * @endif - */ - char_type _M_pback; - char_type* _M_pback_cur_save; - char_type* _M_pback_end_save; - bool _M_pback_init; - //@} - - // Cached codecvt facet. - const __codecvt_type* _M_codecvt; - - /** - * @if maint - * Buffer for external characters. Used for input when - * codecvt::always_noconv() == false. When valid, this corresponds - * to eback(). - * @endif - */ - char* _M_ext_buf; - - /** - * @if maint - * Size of buffer held by _M_ext_buf. - * @endif - */ - streamsize _M_ext_buf_size; - - /** - * @if maint - * Pointers into the buffer held by _M_ext_buf that delimit a - * subsequence of bytes that have been read but not yet converted. - * When valid, _M_ext_next corresponds to egptr(). - * @endif - */ - const char* _M_ext_next; - char* _M_ext_end; - - /** - * @if maint - * Initializes pback buffers, and moves normal buffers to safety. - * Assumptions: - * _M_in_cur has already been moved back - * @endif - */ - void - _M_create_pback() - { - if (!_M_pback_init) - { - _M_pback_cur_save = this->gptr(); - _M_pback_end_save = this->egptr(); - this->setg(&_M_pback, &_M_pback, &_M_pback + 1); - _M_pback_init = true; - } - } - - /** - * @if maint - * Deactivates pback buffer contents, and restores normal buffer. - * Assumptions: - * The pback buffer has only moved forward. - * @endif - */ - void - _M_destroy_pback() throw() - { - if (_M_pback_init) - { - // Length _M_in_cur moved in the pback buffer. - _M_pback_cur_save += this->gptr() != this->eback(); - this->setg(this->_M_buf, _M_pback_cur_save, _M_pback_end_save); - _M_pback_init = false; - } - } - - public: - // Constructors/destructor: - /** - * @brief Does not open any files. - * - * The default constructor initializes the parent class using its - * own default ctor. - */ - basic_filebuf(); - - /** - * @brief The destructor closes the file first. - */ - virtual - ~basic_filebuf() - { this->close(); } - - // Members: - /** - * @brief Returns true if the external file is open. - */ - bool - is_open() const throw() { return _M_file.is_open(); } - - /** - * @brief Opens an external file. - * @param s The name of the file. - * @param mode The open mode flags. - * @return @c this on success, NULL on failure - * - * If a file is already open, this function immediately fails. - * Otherwise it tries to open the file named @a s using the flags - * given in @a mode. - * - * [Table 92 gives the relation between openmode combinations and the - * equivalent fopen() flags, but the table has not been copied yet.] - */ - __filebuf_type* - open(const char* __s, ios_base::openmode __mode); - - /** - * @brief Closes the currently associated file. - * @return @c this on success, NULL on failure - * - * If no file is currently open, this function immediately fails. - * - * If a "put buffer area" exists, @c overflow(eof) is called to flush - * all the characters. The file is then closed. - * - * If any operations fail, this function also fails. - */ - __filebuf_type* - close() throw(); - - protected: - /** - * @if maint - * @doctodo - * @endif - */ - void - _M_allocate_internal_buffer(); - - /** - * @if maint - * @doctodo - * @endif - */ - void - _M_destroy_internal_buffer() throw(); - - // [27.8.1.4] overridden virtual functions - // [documentation is inherited] - virtual streamsize - showmanyc(); - - // Stroustrup, 1998, p. 628 - // underflow() and uflow() functions are called to get the next - // charater from the real input source when the buffer is empty. - // Buffered input uses underflow() - - // [documentation is inherited] - virtual int_type - underflow(); - - // [documentation is inherited] - virtual int_type - pbackfail(int_type __c = _Traits::eof()); - - // Stroustrup, 1998, p 648 - // The overflow() function is called to transfer characters to the - // real output destination when the buffer is full. A call to - // overflow(c) outputs the contents of the buffer plus the - // character c. - // 27.5.2.4.5 - // Consume some sequence of the characters in the pending sequence. - /** - * @if maint - * @doctodo - * @endif - */ - virtual int_type - overflow(int_type __c = _Traits::eof()); - - // Convert internal byte sequence to external, char-based - // sequence via codecvt. - /** - * @if maint - * @doctodo - * @endif - */ - bool - _M_convert_to_external(char_type*, streamsize); - - /** - * @brief Manipulates the buffer. - * @param s Pointer to a buffer area. - * @param n Size of @a s. - * @return @c this - * - * If no file has been opened, and both @a s and @a n are zero, then - * the stream becomes unbuffered. Otherwise, @c s is used as a - * buffer; see - * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#2 - * for more. - */ - virtual __streambuf_type* - setbuf(char_type* __s, streamsize __n); - - // [documentation is inherited] - virtual pos_type - seekoff(off_type __off, ios_base::seekdir __way, - ios_base::openmode __mode = ios_base::in | ios_base::out); - - // [documentation is inherited] - virtual pos_type - seekpos(pos_type __pos, - ios_base::openmode __mode = ios_base::in | ios_base::out); - - // Common code for seekoff and seekpos - /** - * @if maint - * @doctodo - * @endif - */ - pos_type - _M_seek(off_type __off, ios_base::seekdir __way, __state_type __state); - - // [documentation is inherited] - virtual int - sync(); - - // [documentation is inherited] - virtual void - imbue(const locale& __loc); - - // [documentation is inherited] - virtual streamsize - xsgetn(char_type* __s, streamsize __n); - - // [documentation is inherited] - virtual streamsize - xsputn(const char_type* __s, streamsize __n); - - // Flushes output buffer, then writes unshift sequence. - /** - * @if maint - * @doctodo - * @endif - */ - bool - _M_terminate_output(); - - /** - * @if maint - * This function sets the pointers of the internal buffer, both get - * and put areas. Typically: - * - * __off == egptr() - eback() upon underflow/uflow ('read' mode); - * __off == 0 upon overflow ('write' mode); - * __off == -1 upon open, setbuf, seekoff/pos ('uncommitted' mode). - * - * NB: epptr() - pbase() == _M_buf_size - 1, since _M_buf_size - * reflects the actual allocated memory and the last cell is reserved - * for the overflow char of a full put area. - * @endif - */ - void - _M_set_buffer(streamsize __off) - { - const bool __testin = this->_M_mode & ios_base::in; - const bool __testout = this->_M_mode & ios_base::out; - - if (__testin && __off > 0) - this->setg(this->_M_buf, this->_M_buf, this->_M_buf + __off); - else - this->setg(this->_M_buf, this->_M_buf, this->_M_buf); - - if (__testout && __off == 0 && this->_M_buf_size > 1 ) - this->setp(this->_M_buf, this->_M_buf + this->_M_buf_size - 1); - else - this->setp(NULL, NULL); - } - }; - - // [27.8.1.5] Template class basic_ifstream - /** - * @brief Controlling input for files. - * - * This class supports reading from named files, using the inherited - * functions from std::basic_istream. To control the associated - * sequence, an instance of std::basic_filebuf is used, which this page - * refers to as @c sb. - */ - template<typename _CharT, typename _Traits> - class basic_ifstream : public basic_istream<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard types: - typedef basic_filebuf<char_type, traits_type> __filebuf_type; - typedef basic_istream<char_type, traits_type> __istream_type; - - private: - /** - * @if maint - * @doctodo - * @endif - */ - __filebuf_type _M_filebuf; - - public: - // Constructors/Destructors: - /** - * @brief Default constructor. - * - * Initializes @c sb using its default constructor, and passes - * @c &sb to the base class initializer. Does not open any files - * (you haven't given it a filename to open). - */ - basic_ifstream() : __istream_type(), _M_filebuf() - { this->init(&_M_filebuf); } - - /** - * @brief Create an input file stream. - * @param s Null terminated string specifying the filename. - * @param mode Open file in specified mode (see std::ios_base). - * - * @c ios_base::in is automatically included in @a mode. - * - * Tip: When using std::string to hold the filename, you must use - * .c_str() before passing it to this constructor. - */ - explicit - basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in) - : __istream_type(), _M_filebuf() - { - this->init(&_M_filebuf); - this->open(__s, __mode); - } - - /** - * @brief The destructor does nothing. - * - * The file is closed by the filebuf object, not the formatting - * stream. - */ - ~basic_ifstream() - { } - - // Members: - /** - * @brief Accessing the underlying buffer. - * @return The current basic_filebuf buffer. - * - * This hides both signatures of std::basic_ios::rdbuf(). - */ - __filebuf_type* - rdbuf() const - { return const_cast<__filebuf_type*>(&_M_filebuf); } - - /** - * @brief Wrapper to test for an open file. - * @return @c rdbuf()->is_open() - */ - bool - is_open() { return _M_filebuf.is_open(); } - - /** - * @brief Opens an external file. - * @param s The name of the file. - * @param mode The open mode flags. - * - * Calls @c std::basic_filebuf::open(s,mode|in). If that function - * fails, @c failbit is set in the stream's error state. - * - * Tip: When using std::string to hold the filename, you must use - * .c_str() before passing it to this constructor. - */ - void - open(const char* __s, ios_base::openmode __mode = ios_base::in) - { - if (!_M_filebuf.open(__s, __mode | ios_base::in)) - this->setstate(ios_base::failbit); - } - - /** - * @brief Close the file. - * - * Calls @c std::basic_filebuf::close(). If that function - * fails, @c failbit is set in the stream's error state. - */ - void - close() - { - if (!_M_filebuf.close()) - this->setstate(ios_base::failbit); - } - }; - - - // [27.8.1.8] Template class basic_ofstream - /** - * @brief Controlling output for files. - * - * This class supports reading from named files, using the inherited - * functions from std::basic_ostream. To control the associated - * sequence, an instance of std::basic_filebuf is used, which this page - * refers to as @c sb. - */ - template<typename _CharT, typename _Traits> - class basic_ofstream : public basic_ostream<_CharT,_Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard types: - typedef basic_filebuf<char_type, traits_type> __filebuf_type; - typedef basic_ostream<char_type, traits_type> __ostream_type; - - private: - /** - * @if maint - * @doctodo - * @endif - */ - __filebuf_type _M_filebuf; - - public: - // Constructors: - /** - * @brief Default constructor. - * - * Initializes @c sb using its default constructor, and passes - * @c &sb to the base class initializer. Does not open any files - * (you haven't given it a filename to open). - */ - basic_ofstream(): __ostream_type(), _M_filebuf() - { this->init(&_M_filebuf); } - - /** - * @brief Create an output file stream. - * @param s Null terminated string specifying the filename. - * @param mode Open file in specified mode (see std::ios_base). - * - * @c ios_base::out|ios_base::trunc is automatically included in - * @a mode. - * - * Tip: When using std::string to hold the filename, you must use - * .c_str() before passing it to this constructor. - */ - explicit - basic_ofstream(const char* __s, - ios_base::openmode __mode = ios_base::out|ios_base::trunc) - : __ostream_type(), _M_filebuf() - { - this->init(&_M_filebuf); - this->open(__s, __mode); - } - - /** - * @brief The destructor does nothing. - * - * The file is closed by the filebuf object, not the formatting - * stream. - */ - ~basic_ofstream() - { } - - // Members: - /** - * @brief Accessing the underlying buffer. - * @return The current basic_filebuf buffer. - * - * This hides both signatures of std::basic_ios::rdbuf(). - */ - __filebuf_type* - rdbuf() const - { return const_cast<__filebuf_type*>(&_M_filebuf); } - - /** - * @brief Wrapper to test for an open file. - * @return @c rdbuf()->is_open() - */ - bool - is_open() { return _M_filebuf.is_open(); } - - /** - * @brief Opens an external file. - * @param s The name of the file. - * @param mode The open mode flags. - * - * Calls @c std::basic_filebuf::open(s,mode|out|trunc). If that - * function fails, @c failbit is set in the stream's error state. - * - * Tip: When using std::string to hold the filename, you must use - * .c_str() before passing it to this constructor. - */ - void - open(const char* __s, - ios_base::openmode __mode = ios_base::out | ios_base::trunc) - { - if (!_M_filebuf.open(__s, __mode | ios_base::out)) - this->setstate(ios_base::failbit); - } - - /** - * @brief Close the file. - * - * Calls @c std::basic_filebuf::close(). If that function - * fails, @c failbit is set in the stream's error state. - */ - void - close() - { - if (!_M_filebuf.close()) - this->setstate(ios_base::failbit); - } - }; - - - // [27.8.1.11] Template class basic_fstream - /** - * @brief Controlling intput and output for files. - * - * This class supports reading from and writing to named files, using - * the inherited functions from std::basic_iostream. To control the - * associated sequence, an instance of std::basic_filebuf is used, which - * this page refers to as @c sb. - */ - template<typename _CharT, typename _Traits> - class basic_fstream : public basic_iostream<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard types: - typedef basic_filebuf<char_type, traits_type> __filebuf_type; - typedef basic_ios<char_type, traits_type> __ios_type; - typedef basic_iostream<char_type, traits_type> __iostream_type; - - private: - /** - * @if maint - * @doctodo - * @endif - */ - __filebuf_type _M_filebuf; - - public: - // Constructors/destructor: - /** - * @brief Default constructor. - * - * Initializes @c sb using its default constructor, and passes - * @c &sb to the base class initializer. Does not open any files - * (you haven't given it a filename to open). - */ - basic_fstream() - : __iostream_type(), _M_filebuf() - { this->init(&_M_filebuf); } - - /** - * @brief Create an input/output file stream. - * @param s Null terminated string specifying the filename. - * @param mode Open file in specified mode (see std::ios_base). - * - * Tip: When using std::string to hold the filename, you must use - * .c_str() before passing it to this constructor. - */ - explicit - basic_fstream(const char* __s, - ios_base::openmode __mode = ios_base::in | ios_base::out) - : __iostream_type(NULL), _M_filebuf() - { - this->init(&_M_filebuf); - this->open(__s, __mode); - } - - /** - * @brief The destructor does nothing. - * - * The file is closed by the filebuf object, not the formatting - * stream. - */ - ~basic_fstream() - { } - - // Members: - /** - * @brief Accessing the underlying buffer. - * @return The current basic_filebuf buffer. - * - * This hides both signatures of std::basic_ios::rdbuf(). - */ - __filebuf_type* - rdbuf() const - { return const_cast<__filebuf_type*>(&_M_filebuf); } - - /** - * @brief Wrapper to test for an open file. - * @return @c rdbuf()->is_open() - */ - bool - is_open() { return _M_filebuf.is_open(); } - - /** - * @brief Opens an external file. - * @param s The name of the file. - * @param mode The open mode flags. - * - * Calls @c std::basic_filebuf::open(s,mode). If that - * function fails, @c failbit is set in the stream's error state. - * - * Tip: When using std::string to hold the filename, you must use - * .c_str() before passing it to this constructor. - */ - void - open(const char* __s, - ios_base::openmode __mode = ios_base::in | ios_base::out) - { - if (!_M_filebuf.open(__s, __mode)) - this->setstate(ios_base::failbit); - } - - /** - * @brief Close the file. - * - * Calls @c std::basic_filebuf::close(). If that function - * fails, @c failbit is set in the stream's error state. - */ - void - close() - { - if (!_M_filebuf.close()) - this->setstate(ios_base::failbit); - } - }; -} // namespace std - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/fstream.tcc> -#endif - -#endif /* _GLIBCXX_FSTREAM */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/functional b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/functional deleted file mode 100644 index 6819f20b6f0..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/functional +++ /dev/null @@ -1,58 +0,0 @@ -// <functional> -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -/** @file functional - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_FUNCTIONAL -#define _GLIBCXX_FUNCTIONAL 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <cstddef> -#include <bits/stl_function.h> - -#endif /* _GLIBCXX_FUNCTIONAL */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/atomic_word.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/atomic_word.h deleted file mode 100644 index b46adc2a474..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/atomic_word.h +++ /dev/null @@ -1,35 +0,0 @@ -// Low-level type for atomic operations -*- C++ -*- - -// Copyright (C) 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _GLIBCXX_ATOMIC_WORD_H -#define _GLIBCXX_ATOMIC_WORD_H 1 - -typedef int _Atomic_word; - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/basic_file.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/basic_file.h deleted file mode 100644 index 6aa031b507d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/basic_file.h +++ /dev/null @@ -1,110 +0,0 @@ -// Wrapper of C-language FILE struct -*- C++ -*- - -// Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.8 File-based streams -// - -/** @file basic_file.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _BASIC_FILE_STDIO_H -#define _BASIC_FILE_STDIO_H 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <ios> - -namespace std -{ - // Generic declaration. - template<typename _CharT> - class __basic_file; - - // Specialization. - template<> - class __basic_file<char> - { - // Underlying data source/sink. - __c_file* _M_cfile; - - // True iff we opened _M_cfile, and thus must close it ourselves. - bool _M_cfile_created; - - public: - __basic_file(__c_lock* __lock = 0); - - __basic_file* - open(const char* __name, ios_base::openmode __mode, int __prot = 0664); - - __basic_file* - sys_open(__c_file* __file, ios_base::openmode); - - __basic_file* - sys_open(int __fd, ios_base::openmode __mode); - - __basic_file* - close(); - - bool - is_open() const; - - int - fd(); - - __c_file* - file(); - - ~__basic_file(); - - streamsize - xsputn(const char* __s, streamsize __n); - - streamsize - xsputn_2(const char* __s1, streamsize __n1, - const char* __s2, streamsize __n2); - - streamsize - xsgetn(char* __s, streamsize __n); - - streamoff - seekoff(streamoff __off, ios_base::seekdir __way); - - int - sync(); - - streamsize - showmanyc(); - }; -} // namespace std - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++allocator.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++allocator.h deleted file mode 100644 index 442f89cc535..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++allocator.h +++ /dev/null @@ -1,37 +0,0 @@ -// Base to std::allocator -*- C++ -*- - -// Copyright (C) 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _CXX_ALLOCATOR_H -#define _CXX_ALLOCATOR_H 1 - -// Define new_allocator as the base class to std::allocator. -#include <ext/new_allocator.h> -#define ___glibcxx_base_allocator __gnu_cxx::new_allocator - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++config.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++config.h deleted file mode 100644 index bd3a04dc141..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++config.h +++ /dev/null @@ -1,1297 +0,0 @@ -// Predefined symbols and macros -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _CXXCONFIG -#define _CXXCONFIG 1 - -// Pick up any OS-specific definitions. -#include <bits/os_defines.h> - -// The current version of the C++ library in compressed ISO date format. -#define __GLIBCXX__ 20050519 - -// Allow use of "export template." This is currently not a feature -// that g++ supports. -// #define _GLIBCXX_EXPORT_TEMPLATE 1 - -// Allow use of the GNU syntax extension, "extern template." This -// extension is fully documented in the g++ manual, but in a nutshell, -// it inhibits all implicit instantiations and is used throughout the -// library to avoid multiple weak definitions for required types that -// are already explicitly instantiated in the library binary. This -// substantially reduces the binary size of resulting executables. -#ifndef _GLIBCXX_EXTERN_TEMPLATE -# define _GLIBCXX_EXTERN_TEMPLATE 1 -#endif - -// Debug mode support. Debug mode basic_string is not allowed to be -// associated with std, because of locale and exception link -// dependence. -namespace __gnu_debug_def { } - -namespace __gnu_debug -{ - using namespace __gnu_debug_def; -} - -#ifdef _GLIBCXX_DEBUG -# define _GLIBCXX_STD __gnu_norm -namespace __gnu_norm -{ - using namespace std; -} -namespace std -{ - using namespace __gnu_debug_def __attribute__ ((strong)); -} -#else -# define _GLIBCXX_STD std -#endif - - -// The remainder of the prewritten config is automatic; all the -// user hooks are listed above. - -// Create a boolean flag to be used to determine if --fast-math is set. -#ifdef __FAST_MATH__ -# define _GLIBCXX_FAST_MATH 1 -#else -# define _GLIBCXX_FAST_MATH 0 -#endif - -// This marks string literals in header files to be extracted for eventual -// translation. It is primarily used for messages in thrown exceptions; see -// src/functexcept.cc. We use __N because the more traditional _N is used -// for something else under certain OSes (see BADNAMES). -#define __N(msgid) (msgid) - -// End of prewritten config; the discovered settings follow. -/* config.h. Generated by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ -// acconfig.h symbols and macros for libstdc++ v3 -*- C++ -*- - -// Defines libstdc++ version. -/* #undef _GLIBCXX_PACKAGE */ -/* #undef _GLIBCXX_VERSION */ - -// Needed for gettext. -/* #undef ENABLE_NLS */ -/* #undef _GLIBCXX_HAVE_CATGETS */ -/* #undef _GLIBCXX_HAVE_GETTEXT */ -/* #undef _GLIBCXX_HAVE_STPCPY */ - -// Include I/O support for 'long long' and 'unsigned long long'. -#define _GLIBCXX_USE_LONG_LONG 1 - -// Include support for 'long double'. -/* #undef _GLIBCXX_USE_LONG_DOUBLE */ - -// Define if C99 math functions (like fpclassify) should be exposed. -#define _GLIBCXX_USE_C99_MATH 1 - -// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed. -/* #undef _GLIBCXX_USE_C99 */ - -// Define if code specialized for wchar_t should be used. -/* #undef _GLIBCXX_USE_WCHAR_T */ - -// Define if using setrlimit to set resource limits during 'make check'. -#define _GLIBCXX_RES_LIMITS 1 - -// Define to use concept checking code from the boost libraries. -/* #undef _GLIBCXX_CONCEPT_CHECKS */ - -// Define to use symbol versioning in the shared library. -/* #undef _GLIBCXX_SYMVER */ - -// Define symbol versioning in assember directives. If symbol -// versioning is beigng used, and the assembler supports this kind of -// thing, then use it. -// NB: _GLIBCXX_AT_AT is a hack to work around quoting issues in m4. -#if _GLIBCXX_SYMVER - #define _GLIBCXX_ASM_SYMVER(cur, old, version) \ - asm (".symver " #cur "," #old _GLIBCXX_AT_AT #version); -#else - #define _GLIBCXX_ASM_SYMVER(cur, old, version) -#endif - -// Define if LFS support is available. -/* #undef _GLIBCXX_USE_LFS */ - -// Define if a fully dynamic basic_string is wanted. -/* #undef _GLIBCXX_FULLY_DYNAMIC_STRING */ - -// Define if NLS translations are to be used. -/* #undef _GLIBCXX_USE_NLS */ - -// Define if gthr-default.h exists (meaning that threading support is enabled). -#define _GLIBCXX_HAVE_GTHR_DEFAULT 1 - -// Define if the atan2f function exists. -#define _GLIBCXX_HAVE_ATAN2F 1 - -// Define if the atan2l function exists. -/* #undef _GLIBCXX_HAVE_ATAN2L */ - -// Define if the tanl function exists. -/* #undef _GLIBCXX_HAVE_TANL */ - -// Define if the copysignf function exists. -#define _GLIBCXX_HAVE_COPYSIGNF 1 - -// Define if getpagesize exists. -#define _GLIBCXX_HAVE_GETPAGESIZE 1 - -// Define if setenv exists. -#define _GLIBCXX_HAVE_SETENV 1 - -// Define if sigsetjmp exists. -#define _GLIBCXX_HAVE_SIGSETJMP 1 - -// Define if mbstate_t exists in wchar.h. -#define _GLIBCXX_HAVE_MBSTATE_T 1 - -// Define if you have the modff function. -#define _GLIBCXX_HAVE_MODFF 1 - -// Define if you have the modfl function. -/* #undef _GLIBCXX_HAVE_MODFL */ - -// Define if you have the expf function. -#define _GLIBCXX_HAVE_EXPF 1 - -// Define if you have the expl function. -/* #undef _GLIBCXX_HAVE_EXPL */ - -// Define if you have the hypot function. -#define _GLIBCXX_HAVE_HYPOT 1 - -// Define if you have the hypotf function. -#define _GLIBCXX_HAVE_HYPOTF 1 - -// Define if you have the hypotl function. -/* #undef _GLIBCXX_HAVE_HYPOTL */ - -// Define if the compiler/host combination has __builtin_abs -#define _GLIBCXX_HAVE___BUILTIN_ABS 1 - -// Define if the compiler/host combination has __builtin_labs -#define _GLIBCXX_HAVE___BUILTIN_LABS 1 - -// Define if the compiler/host combination has __builtin_cos -#define _GLIBCXX_HAVE___BUILTIN_COS 1 - -// Define if the compiler/host combination has __builtin_cosf -#define _GLIBCXX_HAVE___BUILTIN_COSF 1 - -// Define if the compiler/host combination has __builtin_cosl -#define _GLIBCXX_HAVE___BUILTIN_COSL 1 - -// Define if the compiler/host combination has __builtin_fabs -#define _GLIBCXX_HAVE___BUILTIN_FABS 1 - -// Define if the compiler/host combination has __builtin_fabsf -#define _GLIBCXX_HAVE___BUILTIN_FABSF 1 - -// Define if the compiler/host combination has __builtin_fabsl -#define _GLIBCXX_HAVE___BUILTIN_FABSL 1 - -// Define if the compiler/host combination has __builtin_sin -#define _GLIBCXX_HAVE___BUILTIN_SIN 1 - -// Define if the compiler/host combination has __builtin_sinf -#define _GLIBCXX_HAVE___BUILTIN_SINF 1 - -// Define if the compiler/host combination has __builtin_sinl -#define _GLIBCXX_HAVE___BUILTIN_SINL 1 - -// Define if the compiler/host combination has __builtin_sqrt -#define _GLIBCXX_HAVE___BUILTIN_SQRT 1 - -// Define if the compiler/host combination has __builtin_sqrtf -#define _GLIBCXX_HAVE___BUILTIN_SQRTF 1 - -// Define if the compiler/host combination has __builtin_sqrtl -#define _GLIBCXX_HAVE___BUILTIN_SQRTL 1 - -// Define if poll is available in <poll.h>. -#define _GLIBCXX_HAVE_POLL 1 - -// Define if S_ISREG (Posix) is available in <sys/stat.h>. -#define _GLIBCXX_HAVE_S_ISREG 1 - -// Define if S_IFREG is available in <sys/stat.h>. -/* #undef _GLIBCXX_HAVE_S_IFREG */ - -// Define if writev is available in <sys/uio.h>. -#define _GLIBCXX_HAVE_WRITEV 1 - -// Define if int64_t is available in <stdint.h>. -#define _GLIBCXX_HAVE_INT64_T 1 - -// Define if LC_MESSAGES is available in <locale.h>. -#define _GLIBCXX_HAVE_LC_MESSAGES 1 - -// Define if <float.h> exists. -#define _GLIBCXX_HAVE_FLOAT_H 1 - -// Define if modf is present in <math.h> -/* #undef _GLIBCXX_HAVE_MODF */ - - -/* Define to 1 if you have the `acosf' function. */ -#define _GLIBCXX_HAVE_ACOSF 1 - -/* Define to 1 if you have the `acosl' function. */ -/* #undef _GLIBCXX_HAVE_ACOSL */ - -/* Define to 1 if you have the `asinf' function. */ -#define _GLIBCXX_HAVE_ASINF 1 - -/* Define to 1 if you have the `asinl' function. */ -/* #undef _GLIBCXX_HAVE_ASINL */ - -/* Define to 1 if you have the `atan2f' function. */ -#define _GLIBCXX_HAVE_ATAN2F 1 - -/* Define to 1 if you have the `atan2l' function. */ -/* #undef _GLIBCXX_HAVE_ATAN2L */ - -/* Define to 1 if you have the `atanf' function. */ -#define _GLIBCXX_HAVE_ATANF 1 - -/* Define to 1 if you have the `atanl' function. */ -/* #undef _GLIBCXX_HAVE_ATANL */ - -/* Define to 1 if you have the `btowc' function. */ -#define _GLIBCXX_HAVE_BTOWC 1 - -/* Define to 1 if you have the `ceilf' function. */ -#define _GLIBCXX_HAVE_CEILF 1 - -/* Define to 1 if you have the `ceill' function. */ -/* #undef _GLIBCXX_HAVE_CEILL */ - -/* Define to 1 if you have the `copysign' function. */ -#define _GLIBCXX_HAVE_COPYSIGN 1 - -/* Define to 1 if you have the `copysignf' function. */ -#define _GLIBCXX_HAVE_COPYSIGNF 1 - -/* Define to 1 if you have the `copysignl' function. */ -/* #undef _GLIBCXX_HAVE_COPYSIGNL */ - -/* Define to 1 if you have the `cosf' function. */ -#define _GLIBCXX_HAVE_COSF 1 - -/* Define to 1 if you have the `coshf' function. */ -#define _GLIBCXX_HAVE_COSHF 1 - -/* Define to 1 if you have the `coshl' function. */ -/* #undef _GLIBCXX_HAVE_COSHL */ - -/* Define to 1 if you have the `cosl' function. */ -/* #undef _GLIBCXX_HAVE_COSL */ - -/* Define to 1 if you have the <endian.h> header file. */ -#define _GLIBCXX_HAVE_ENDIAN_H 1 - -/* Define to 1 if you have the `expf' function. */ -#define _GLIBCXX_HAVE_EXPF 1 - -/* Define to 1 if you have the `expl' function. */ -/* #undef _GLIBCXX_HAVE_EXPL */ - -/* Define to 1 if you have the `fabsf' function. */ -#define _GLIBCXX_HAVE_FABSF 1 - -/* Define to 1 if you have the `fabsl' function. */ -/* #undef _GLIBCXX_HAVE_FABSL */ - -/* Define to 1 if you have the `fgetwc' function. */ -/* #undef _GLIBCXX_HAVE_FGETWC */ - -/* Define to 1 if you have the `fgetws' function. */ -/* #undef _GLIBCXX_HAVE_FGETWS */ - -/* Define to 1 if you have the `finite' function. */ -#define _GLIBCXX_HAVE_FINITE 1 - -/* Define to 1 if you have the `finitef' function. */ -/* #undef _GLIBCXX_HAVE_FINITEF */ - -/* Define to 1 if you have the `finitel' function. */ -/* #undef _GLIBCXX_HAVE_FINITEL */ - -/* Define to 1 if you have the <float.h> header file. */ -#define _GLIBCXX_HAVE_FLOAT_H 1 - -/* Define to 1 if you have the `floorf' function. */ -#define _GLIBCXX_HAVE_FLOORF 1 - -/* Define to 1 if you have the `floorl' function. */ -/* #undef _GLIBCXX_HAVE_FLOORL */ - -/* Define to 1 if you have the `fmodf' function. */ -#define _GLIBCXX_HAVE_FMODF 1 - -/* Define to 1 if you have the `fmodl' function. */ -/* #undef _GLIBCXX_HAVE_FMODL */ - -/* Define to 1 if you have the `fpclass' function. */ -/* #undef _GLIBCXX_HAVE_FPCLASS */ - -/* Define to 1 if you have the `fputwc' function. */ -/* #undef _GLIBCXX_HAVE_FPUTWC */ - -/* Define to 1 if you have the `fputws' function. */ -/* #undef _GLIBCXX_HAVE_FPUTWS */ - -/* Define to 1 if you have the <fp.h> header file. */ -/* #undef _GLIBCXX_HAVE_FP_H */ - -/* Define to 1 if you have the `frexpf' function. */ -#define _GLIBCXX_HAVE_FREXPF 1 - -/* Define to 1 if you have the `frexpl' function. */ -/* #undef _GLIBCXX_HAVE_FREXPL */ - -/* Define to 1 if you have the `fwide' function. */ -/* #undef _GLIBCXX_HAVE_FWIDE */ - -/* Define to 1 if you have the `fwprintf' function. */ -/* #undef _GLIBCXX_HAVE_FWPRINTF */ - -/* Define to 1 if you have the `fwscanf' function. */ -/* #undef _GLIBCXX_HAVE_FWSCANF */ - -/* Define to 1 if you have the <gconv.h> header file. */ -/* #undef _GLIBCXX_HAVE_GCONV_H */ - -/* Define to 1 if you have the `getpagesize' function. */ -#define _GLIBCXX_HAVE_GETPAGESIZE 1 - -/* Define to 1 if you have the `getwc' function. */ -/* #undef _GLIBCXX_HAVE_GETWC */ - -/* Define to 1 if you have the `getwchar' function. */ -/* #undef _GLIBCXX_HAVE_GETWCHAR */ - -/* Define to 1 if you have the `hypot' function. */ -#define _GLIBCXX_HAVE_HYPOT 1 - -/* Define to 1 if you have the `hypotf' function. */ -#define _GLIBCXX_HAVE_HYPOTF 1 - -/* Define to 1 if you have the `hypotl' function. */ -/* #undef _GLIBCXX_HAVE_HYPOTL */ - -/* Define to 1 if you have the `iconv' function. */ -/* #undef _GLIBCXX_HAVE_ICONV */ - -/* Define to 1 if you have the `iconv_close' function. */ -/* #undef _GLIBCXX_HAVE_ICONV_CLOSE */ - -/* Define to 1 if you have the `iconv_open' function. */ -/* #undef _GLIBCXX_HAVE_ICONV_OPEN */ - -/* Define to 1 if you have the <ieeefp.h> header file. */ -#define _GLIBCXX_HAVE_IEEEFP_H 1 - -/* Define to 1 if you have the <inttypes.h> header file. */ -#define _GLIBCXX_HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the `isinf' function. */ -#define _GLIBCXX_HAVE_ISINF 1 - -/* Define to 1 if you have the `isinff' function. */ -/* #undef _GLIBCXX_HAVE_ISINFF */ - -/* Define to 1 if you have the `isinfl' function. */ -/* #undef _GLIBCXX_HAVE_ISINFL */ - -/* Define to 1 if you have the `isnan' function. */ -#define _GLIBCXX_HAVE_ISNAN 1 - -/* Define to 1 if you have the `isnanf' function. */ -/* #undef _GLIBCXX_HAVE_ISNANF */ - -/* Define to 1 if you have the `isnanl' function. */ -/* #undef _GLIBCXX_HAVE_ISNANL */ - -/* Define to 1 if you have the `iswblank' function. */ -#define _GLIBCXX_HAVE_ISWBLANK 1 - -/* Define to 1 if you have the `ldexpf' function. */ -#define _GLIBCXX_HAVE_LDEXPF 1 - -/* Define to 1 if you have the `ldexpl' function. */ -/* #undef _GLIBCXX_HAVE_LDEXPL */ - -/* Define to 1 if you have the <libintl.h> header file. */ -/* #undef _GLIBCXX_HAVE_LIBINTL_H */ - -/* Define to 1 if you have the `m' library (-lm). */ -#define _GLIBCXX_HAVE_LIBM 1 - -/* Only used in build directory testsuite_hooks.h. */ -#define _GLIBCXX_HAVE_LIMIT_AS 1 - -/* Only used in build directory testsuite_hooks.h. */ -#define _GLIBCXX_HAVE_LIMIT_DATA 1 - -/* Only used in build directory testsuite_hooks.h. */ -#define _GLIBCXX_HAVE_LIMIT_FSIZE 1 - -/* Only used in build directory testsuite_hooks.h. */ -#define _GLIBCXX_HAVE_LIMIT_RSS 0 - -/* Only used in build directory testsuite_hooks.h. */ -#define _GLIBCXX_HAVE_LIMIT_VMEM 0 - -/* Define to 1 if you have the <locale.h> header file. */ -#define _GLIBCXX_HAVE_LOCALE_H 1 - -/* Define to 1 if you have the `log10f' function. */ -#define _GLIBCXX_HAVE_LOG10F 1 - -/* Define to 1 if you have the `log10l' function. */ -/* #undef _GLIBCXX_HAVE_LOG10L */ - -/* Define to 1 if you have the `logf' function. */ -#define _GLIBCXX_HAVE_LOGF 1 - -/* Define to 1 if you have the `logl' function. */ -/* #undef _GLIBCXX_HAVE_LOGL */ - -/* Define to 1 if you have the <machine/endian.h> header file. */ -#define _GLIBCXX_HAVE_MACHINE_ENDIAN_H 1 - -/* Define to 1 if you have the <machine/param.h> header file. */ -#define _GLIBCXX_HAVE_MACHINE_PARAM_H 1 - -/* Define to 1 if you have the `mbrlen' function. */ -#define _GLIBCXX_HAVE_MBRLEN 1 - -/* Define to 1 if you have the `mbrtowc' function. */ -#define _GLIBCXX_HAVE_MBRTOWC 1 - -/* Define to 1 if you have the `mbsinit' function. */ -#define _GLIBCXX_HAVE_MBSINIT 1 - -/* Define to 1 if you have the `mbsrtowcs' function. */ -#define _GLIBCXX_HAVE_MBSRTOWCS 1 - -/* Define to 1 if you have the <memory.h> header file. */ -#define _GLIBCXX_HAVE_MEMORY_H 1 - -/* Define to 1 if you have a working `mmap' system call. */ -/* #undef _GLIBCXX_HAVE_MMAP */ - -/* Define to 1 if you have the `modff' function. */ -#define _GLIBCXX_HAVE_MODFF 1 - -/* Define to 1 if you have the `modfl' function. */ -/* #undef _GLIBCXX_HAVE_MODFL */ - -/* Define to 1 if you have the <nan.h> header file. */ -/* #undef _GLIBCXX_HAVE_NAN_H */ - -/* Define to 1 if you have the `nl_langinfo' function. */ -#define _GLIBCXX_HAVE_NL_LANGINFO 1 - -/* Define to 1 if you have the `powf' function. */ -#define _GLIBCXX_HAVE_POWF 1 - -/* Define to 1 if you have the `powl' function. */ -/* #undef _GLIBCXX_HAVE_POWL */ - -/* Define to 1 if you have the `putwc' function. */ -/* #undef _GLIBCXX_HAVE_PUTWC */ - -/* Define to 1 if you have the `putwchar' function. */ -/* #undef _GLIBCXX_HAVE_PUTWCHAR */ - -/* Define to 1 if you have the `qfpclass' function. */ -/* #undef _GLIBCXX_HAVE_QFPCLASS */ - -/* Define to 1 if you have the `setenv' function. */ -#define _GLIBCXX_HAVE_SETENV 1 - -/* Define if sigsetjmp is available. */ -#define _GLIBCXX_HAVE_SIGSETJMP 1 - -/* Define to 1 if you have the `sincos' function. */ -#define _GLIBCXX_HAVE_SINCOS 1 - -/* Define to 1 if you have the `sincosf' function. */ -#define _GLIBCXX_HAVE_SINCOSF 1 - -/* Define to 1 if you have the `sincosl' function. */ -/* #undef _GLIBCXX_HAVE_SINCOSL */ - -/* Define to 1 if you have the `sinf' function. */ -#define _GLIBCXX_HAVE_SINF 1 - -/* Define to 1 if you have the `sinhf' function. */ -#define _GLIBCXX_HAVE_SINHF 1 - -/* Define to 1 if you have the `sinhl' function. */ -/* #undef _GLIBCXX_HAVE_SINHL */ - -/* Define to 1 if you have the `sinl' function. */ -/* #undef _GLIBCXX_HAVE_SINL */ - -/* Define to 1 if you have the `sqrtf' function. */ -#define _GLIBCXX_HAVE_SQRTF 1 - -/* Define to 1 if you have the `sqrtl' function. */ -/* #undef _GLIBCXX_HAVE_SQRTL */ - -/* Define to 1 if you have the <stdint.h> header file. */ -#define _GLIBCXX_HAVE_STDINT_H 1 - -/* Define to 1 if you have the <stdlib.h> header file. */ -#define _GLIBCXX_HAVE_STDLIB_H 1 - -/* Define to 1 if you have the <strings.h> header file. */ -#define _GLIBCXX_HAVE_STRINGS_H 1 - -/* Define to 1 if you have the <string.h> header file. */ -#define _GLIBCXX_HAVE_STRING_H 1 - -/* Define to 1 if you have the `strtof' function. */ -#define _GLIBCXX_HAVE_STRTOF 1 - -/* Define to 1 if you have the `strtold' function. */ -/* #undef _GLIBCXX_HAVE_STRTOLD */ - -/* Define to 1 if you have the `swprintf' function. */ -/* #undef _GLIBCXX_HAVE_SWPRINTF */ - -/* Define to 1 if you have the `swscanf' function. */ -/* #undef _GLIBCXX_HAVE_SWSCANF */ - -/* Define to 1 if you have the <sys/filio.h> header file. */ -/* #undef _GLIBCXX_HAVE_SYS_FILIO_H */ - -/* Define to 1 if you have the <sys/ioctl.h> header file. */ -#define _GLIBCXX_HAVE_SYS_IOCTL_H 1 - -/* Define to 1 if you have the <sys/isa_defs.h> header file. */ -/* #undef _GLIBCXX_HAVE_SYS_ISA_DEFS_H */ - -/* Define to 1 if you have the <sys/machine.h> header file. */ -/* #undef _GLIBCXX_HAVE_SYS_MACHINE_H */ - -/* Define to 1 if you have the <sys/param.h> header file. */ -/* #undef _GLIBCXX_HAVE_SYS_PARAM_H */ - -/* Define to 1 if you have the <sys/resource.h> header file. */ -#define _GLIBCXX_HAVE_SYS_RESOURCE_H 1 - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#define _GLIBCXX_HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the <sys/time.h> header file. */ -#define _GLIBCXX_HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the <sys/types.h> header file. */ -#define _GLIBCXX_HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the <sys/uio.h> header file. */ -#define _GLIBCXX_HAVE_SYS_UIO_H 1 - -/* Define to 1 if you have the `tanf' function. */ -#define _GLIBCXX_HAVE_TANF 1 - -/* Define to 1 if you have the `tanhf' function. */ -#define _GLIBCXX_HAVE_TANHF 1 - -/* Define to 1 if you have the `tanhl' function. */ -/* #undef _GLIBCXX_HAVE_TANHL */ - -/* Define to 1 if you have the `tanl' function. */ -/* #undef _GLIBCXX_HAVE_TANL */ - -/* Define to 1 if you have the `ungetwc' function. */ -/* #undef _GLIBCXX_HAVE_UNGETWC */ - -/* Define to 1 if you have the <unistd.h> header file. */ -#define _GLIBCXX_HAVE_UNISTD_H 1 - -/* Define to 1 if you have the `vfwprintf' function. */ -/* #undef _GLIBCXX_HAVE_VFWPRINTF */ - -/* Define to 1 if you have the `vfwscanf' function. */ -/* #undef _GLIBCXX_HAVE_VFWSCANF */ - -/* Define to 1 if you have the `vswprintf' function. */ -/* #undef _GLIBCXX_HAVE_VSWPRINTF */ - -/* Define to 1 if you have the `vswscanf' function. */ -/* #undef _GLIBCXX_HAVE_VSWSCANF */ - -/* Define to 1 if you have the `vwprintf' function. */ -/* #undef _GLIBCXX_HAVE_VWPRINTF */ - -/* Define to 1 if you have the `vwscanf' function. */ -/* #undef _GLIBCXX_HAVE_VWSCANF */ - -/* Define to 1 if you have the <wchar.h> header file. */ -#define _GLIBCXX_HAVE_WCHAR_H 1 - -/* Define to 1 if you have the `wcrtomb' function. */ -#define _GLIBCXX_HAVE_WCRTOMB 1 - -/* Define to 1 if you have the `wcscat' function. */ -#define _GLIBCXX_HAVE_WCSCAT 1 - -/* Define to 1 if you have the `wcschr' function. */ -#define _GLIBCXX_HAVE_WCSCHR 1 - -/* Define to 1 if you have the `wcscmp' function. */ -#define _GLIBCXX_HAVE_WCSCMP 1 - -/* Define to 1 if you have the `wcscoll' function. */ -#define _GLIBCXX_HAVE_WCSCOLL 1 - -/* Define to 1 if you have the `wcscpy' function. */ -#define _GLIBCXX_HAVE_WCSCPY 1 - -/* Define to 1 if you have the `wcscspn' function. */ -#define _GLIBCXX_HAVE_WCSCSPN 1 - -/* Define to 1 if you have the `wcsftime' function. */ -/* #undef _GLIBCXX_HAVE_WCSFTIME */ - -/* Define to 1 if you have the `wcslen' function. */ -#define _GLIBCXX_HAVE_WCSLEN 1 - -/* Define to 1 if you have the `wcsncat' function. */ -#define _GLIBCXX_HAVE_WCSNCAT 1 - -/* Define to 1 if you have the `wcsncmp' function. */ -#define _GLIBCXX_HAVE_WCSNCMP 1 - -/* Define to 1 if you have the `wcsncpy' function. */ -#define _GLIBCXX_HAVE_WCSNCPY 1 - -/* Define to 1 if you have the `wcspbrk' function. */ -#define _GLIBCXX_HAVE_WCSPBRK 1 - -/* Define to 1 if you have the `wcsrchr' function. */ -#define _GLIBCXX_HAVE_WCSRCHR 1 - -/* Define to 1 if you have the `wcsrtombs' function. */ -#define _GLIBCXX_HAVE_WCSRTOMBS 1 - -/* Define to 1 if you have the `wcsspn' function. */ -#define _GLIBCXX_HAVE_WCSSPN 1 - -/* Define to 1 if you have the `wcsstr' function. */ -#define _GLIBCXX_HAVE_WCSSTR 1 - -/* Define to 1 if you have the `wcstod' function. */ -/* #undef _GLIBCXX_HAVE_WCSTOD */ - -/* Define to 1 if you have the `wcstof' function. */ -/* #undef _GLIBCXX_HAVE_WCSTOF */ - -/* Define to 1 if you have the `wcstok' function. */ -/* #undef _GLIBCXX_HAVE_WCSTOK */ - -/* Define to 1 if you have the `wcstol' function. */ -/* #undef _GLIBCXX_HAVE_WCSTOL */ - -/* Define to 1 if you have the `wcstoul' function. */ -/* #undef _GLIBCXX_HAVE_WCSTOUL */ - -/* Define to 1 if you have the `wcsxfrm' function. */ -/* #undef _GLIBCXX_HAVE_WCSXFRM */ - -/* Define to 1 if you have the `wctob' function. */ -#define _GLIBCXX_HAVE_WCTOB 1 - -/* Define to 1 if you have the <wctype.h> header file. */ -#define _GLIBCXX_HAVE_WCTYPE_H 1 - -/* Define to 1 if you have the `wmemchr' function. */ -#define _GLIBCXX_HAVE_WMEMCHR 1 - -/* Define to 1 if you have the `wmemcmp' function. */ -#define _GLIBCXX_HAVE_WMEMCMP 1 - -/* Define to 1 if you have the `wmemcpy' function. */ -#define _GLIBCXX_HAVE_WMEMCPY 1 - -/* Define to 1 if you have the `wmemmove' function. */ -#define _GLIBCXX_HAVE_WMEMMOVE 1 - -/* Define to 1 if you have the `wmemset' function. */ -#define _GLIBCXX_HAVE_WMEMSET 1 - -/* Define to 1 if you have the `wprintf' function. */ -#define _GLIBCXX_HAVE_WPRINTF 1 - -/* Define to 1 if you have the `wscanf' function. */ -/* #undef _GLIBCXX_HAVE_WSCANF */ - -/* Define to 1 if you have the `_acosf' function. */ -/* #undef _GLIBCXX_HAVE__ACOSF */ - -/* Define to 1 if you have the `_acosl' function. */ -/* #undef _GLIBCXX_HAVE__ACOSL */ - -/* Define to 1 if you have the `_asinf' function. */ -/* #undef _GLIBCXX_HAVE__ASINF */ - -/* Define to 1 if you have the `_asinl' function. */ -/* #undef _GLIBCXX_HAVE__ASINL */ - -/* Define to 1 if you have the `_atan2f' function. */ -/* #undef _GLIBCXX_HAVE__ATAN2F */ - -/* Define to 1 if you have the `_atan2l' function. */ -/* #undef _GLIBCXX_HAVE__ATAN2L */ - -/* Define to 1 if you have the `_atanf' function. */ -/* #undef _GLIBCXX_HAVE__ATANF */ - -/* Define to 1 if you have the `_atanl' function. */ -/* #undef _GLIBCXX_HAVE__ATANL */ - -/* Define to 1 if you have the `_ceilf' function. */ -/* #undef _GLIBCXX_HAVE__CEILF */ - -/* Define to 1 if you have the `_ceill' function. */ -/* #undef _GLIBCXX_HAVE__CEILL */ - -/* Define to 1 if you have the `_copysign' function. */ -/* #undef _GLIBCXX_HAVE__COPYSIGN */ - -/* Define to 1 if you have the `_copysignl' function. */ -/* #undef _GLIBCXX_HAVE__COPYSIGNL */ - -/* Define to 1 if you have the `_cosf' function. */ -/* #undef _GLIBCXX_HAVE__COSF */ - -/* Define to 1 if you have the `_coshf' function. */ -/* #undef _GLIBCXX_HAVE__COSHF */ - -/* Define to 1 if you have the `_coshl' function. */ -/* #undef _GLIBCXX_HAVE__COSHL */ - -/* Define to 1 if you have the `_cosl' function. */ -/* #undef _GLIBCXX_HAVE__COSL */ - -/* Define to 1 if you have the `_expf' function. */ -/* #undef _GLIBCXX_HAVE__EXPF */ - -/* Define to 1 if you have the `_expl' function. */ -/* #undef _GLIBCXX_HAVE__EXPL */ - -/* Define to 1 if you have the `_fabsf' function. */ -/* #undef _GLIBCXX_HAVE__FABSF */ - -/* Define to 1 if you have the `_fabsl' function. */ -/* #undef _GLIBCXX_HAVE__FABSL */ - -/* Define to 1 if you have the `_finite' function. */ -/* #undef _GLIBCXX_HAVE__FINITE */ - -/* Define to 1 if you have the `_finitef' function. */ -/* #undef _GLIBCXX_HAVE__FINITEF */ - -/* Define to 1 if you have the `_finitel' function. */ -/* #undef _GLIBCXX_HAVE__FINITEL */ - -/* Define to 1 if you have the `_floorf' function. */ -/* #undef _GLIBCXX_HAVE__FLOORF */ - -/* Define to 1 if you have the `_floorl' function. */ -/* #undef _GLIBCXX_HAVE__FLOORL */ - -/* Define to 1 if you have the `_fmodf' function. */ -/* #undef _GLIBCXX_HAVE__FMODF */ - -/* Define to 1 if you have the `_fmodl' function. */ -/* #undef _GLIBCXX_HAVE__FMODL */ - -/* Define to 1 if you have the `_fpclass' function. */ -/* #undef _GLIBCXX_HAVE__FPCLASS */ - -/* Define to 1 if you have the `_frexpf' function. */ -/* #undef _GLIBCXX_HAVE__FREXPF */ - -/* Define to 1 if you have the `_frexpl' function. */ -/* #undef _GLIBCXX_HAVE__FREXPL */ - -/* Define to 1 if you have the `_hypot' function. */ -/* #undef _GLIBCXX_HAVE__HYPOT */ - -/* Define to 1 if you have the `_hypotf' function. */ -/* #undef _GLIBCXX_HAVE__HYPOTF */ - -/* Define to 1 if you have the `_hypotl' function. */ -/* #undef _GLIBCXX_HAVE__HYPOTL */ - -/* Define to 1 if you have the `_isinf' function. */ -/* #undef _GLIBCXX_HAVE__ISINF */ - -/* Define to 1 if you have the `_isinff' function. */ -/* #undef _GLIBCXX_HAVE__ISINFF */ - -/* Define to 1 if you have the `_isinfl' function. */ -/* #undef _GLIBCXX_HAVE__ISINFL */ - -/* Define to 1 if you have the `_isnan' function. */ -/* #undef _GLIBCXX_HAVE__ISNAN */ - -/* Define to 1 if you have the `_isnanf' function. */ -/* #undef _GLIBCXX_HAVE__ISNANF */ - -/* Define to 1 if you have the `_isnanl' function. */ -/* #undef _GLIBCXX_HAVE__ISNANL */ - -/* Define to 1 if you have the `_ldexpf' function. */ -/* #undef _GLIBCXX_HAVE__LDEXPF */ - -/* Define to 1 if you have the `_ldexpl' function. */ -/* #undef _GLIBCXX_HAVE__LDEXPL */ - -/* Define to 1 if you have the `_log10f' function. */ -/* #undef _GLIBCXX_HAVE__LOG10F */ - -/* Define to 1 if you have the `_log10l' function. */ -/* #undef _GLIBCXX_HAVE__LOG10L */ - -/* Define to 1 if you have the `_logf' function. */ -/* #undef _GLIBCXX_HAVE__LOGF */ - -/* Define to 1 if you have the `_logl' function. */ -/* #undef _GLIBCXX_HAVE__LOGL */ - -/* Define to 1 if you have the `_modff' function. */ -/* #undef _GLIBCXX_HAVE__MODFF */ - -/* Define to 1 if you have the `_modfl' function. */ -/* #undef _GLIBCXX_HAVE__MODFL */ - -/* Define to 1 if you have the `_powf' function. */ -/* #undef _GLIBCXX_HAVE__POWF */ - -/* Define to 1 if you have the `_powl' function. */ -/* #undef _GLIBCXX_HAVE__POWL */ - -/* Define to 1 if you have the `_qfpclass' function. */ -/* #undef _GLIBCXX_HAVE__QFPCLASS */ - -/* Define to 1 if you have the `_sincos' function. */ -/* #undef _GLIBCXX_HAVE__SINCOS */ - -/* Define to 1 if you have the `_sincosf' function. */ -/* #undef _GLIBCXX_HAVE__SINCOSF */ - -/* Define to 1 if you have the `_sincosl' function. */ -/* #undef _GLIBCXX_HAVE__SINCOSL */ - -/* Define to 1 if you have the `_sinf' function. */ -/* #undef _GLIBCXX_HAVE__SINF */ - -/* Define to 1 if you have the `_sinhf' function. */ -/* #undef _GLIBCXX_HAVE__SINHF */ - -/* Define to 1 if you have the `_sinhl' function. */ -/* #undef _GLIBCXX_HAVE__SINHL */ - -/* Define to 1 if you have the `_sinl' function. */ -/* #undef _GLIBCXX_HAVE__SINL */ - -/* Define to 1 if you have the `_sqrtf' function. */ -/* #undef _GLIBCXX_HAVE__SQRTF */ - -/* Define to 1 if you have the `_sqrtl' function. */ -/* #undef _GLIBCXX_HAVE__SQRTL */ - -/* Define to 1 if you have the `_tanf' function. */ -/* #undef _GLIBCXX_HAVE__TANF */ - -/* Define to 1 if you have the `_tanhf' function. */ -/* #undef _GLIBCXX_HAVE__TANHF */ - -/* Define to 1 if you have the `_tanhl' function. */ -/* #undef _GLIBCXX_HAVE__TANHL */ - -/* Define to 1 if you have the `_tanl' function. */ -/* #undef _GLIBCXX_HAVE__TANL */ - -/* Define to 1 if you have the `__signbit' function. */ -/* #undef _GLIBCXX_HAVE___SIGNBIT */ - -/* Define to 1 if you have the `__signbitf' function. */ -#define _GLIBCXX_HAVE___SIGNBITF 1 - -/* Define to 1 if you have the `__signbitl' function. */ -/* #undef _GLIBCXX_HAVE___SIGNBITL */ - -/* Define to the address where bug reports for this package should be sent. */ -#define _GLIBCXX_PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define _GLIBCXX_PACKAGE_NAME "package-unused" - -/* Define to the full name and version of this package. */ -#define _GLIBCXX_PACKAGE_STRING "package-unused version-unused" - -/* Define to the one symbol short name of this package. */ -#define _GLIBCXX_PACKAGE_TARNAME "libstdc++" - -/* Define to the version of this package. */ -#define _GLIBCXX_PACKAGE__GLIBCXX_VERSION "version-unused" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if a full hosted library is built, or 0 if freestanding. */ -#define _GLIBCXX_HOSTED 1 - -/* Define if the compiler is configured for setjmp/longjmp exceptions. */ -#define _GLIBCXX_SJLJ_EXCEPTIONS 1 -// -// Systems that have certain non-standard functions prefixed with an -// underscore, we'll handle those here. Must come after config.h.in. -// -#if defined (_GLIBCXX_HAVE__ISNAN) && ! defined (_GLIBCXX_HAVE_ISNAN) -# define _GLIBCXX_HAVE_ISNAN 1 -# define isnan _isnan -#endif - -#if defined (_GLIBCXX_HAVE__ISNANF) && ! defined (_GLIBCXX_HAVE_ISNANF) -# define _GLIBCXX_HAVE_ISNANF 1 -# define isnanf _isnanf -#endif - -#if defined (_GLIBCXX_HAVE__ISNANL) && ! defined (_GLIBCXX_HAVE_ISNANL) -# define _GLIBCXX_HAVE_ISNANL 1 -# define isnanl _isnanl -#endif - -#if defined (_GLIBCXX_HAVE__ISINF) && ! defined (_GLIBCXX_HAVE_ISINF) -# define _GLIBCXX_HAVE_ISINF 1 -# define isinf _isinf -#endif - -#if defined (_GLIBCXX_HAVE__ISINFF) && ! defined (_GLIBCXX_HAVE_ISINFF) -# define _GLIBCXX_HAVE_ISINFF 1 -# define isinff _isinff -#endif - -#if defined (_GLIBCXX_HAVE__ISINFL) && ! defined (_GLIBCXX_HAVE_ISINFL) -# define _GLIBCXX_HAVE_ISINFL 1 -# define isinfl _isinfl -#endif - -#if defined (_GLIBCXX_HAVE__COPYSIGN) && ! defined (_GLIBCXX_HAVE_COPYSIGN) -# define _GLIBCXX_HAVE_COPYSIGN 1 -# define copysign _copysign -#endif - -#if defined (_GLIBCXX_HAVE__COPYSIGNL) && ! defined (_GLIBCXX_HAVE_COPYSIGNL) -# define _GLIBCXX_HAVE_COPYSIGNL 1 -# define copysignl _copysignl -#endif - -#if defined (_GLIBCXX_HAVE__COSF) && ! defined (_GLIBCXX_HAVE_COSF) -# define _GLIBCXX_HAVE_COSF 1 -# define cosf _cosf -#endif - -#if defined (_GLIBCXX_HAVE__ACOSF) && ! defined (_GLIBCXX_HAVE_ACOSF) -# define _GLIBCXX_HAVE_ACOSF 1 -# define acosf _acosf -#endif - -#if defined (_GLIBCXX_HAVE__ACOSL) && ! defined (_GLIBCXX_HAVE_ACOSL) -# define _GLIBCXX_HAVE_ACOSL 1 -# define acosl _acosl -#endif - -#if defined (_GLIBCXX_HAVE__ASINF) && ! defined (_GLIBCXX_HAVE_ASINF) -# define _GLIBCXX_HAVE_ASINF 1 -# define asinf _asinf -#endif - -#if defined (_GLIBCXX_HAVE__ASINL) && ! defined (_GLIBCXX_HAVE_ASINL) -# define _GLIBCXX_HAVE_ASINL 1 -# define asinl _asinl -#endif - -#if defined (_GLIBCXX_HAVE__ATANF) && ! defined (_GLIBCXX_HAVE_ATANF) -# define _GLIBCXX_HAVE_ATANF 1 -# define atanf _atanf -#endif - -#if defined (_GLIBCXX_HAVE__ATANL) && ! defined (_GLIBCXX_HAVE_ATANL) -# define _GLIBCXX_HAVE_ATANL 1 -# define atanl _atanl -#endif - -#if defined (_GLIBCXX_HAVE__CEILF) && ! defined (_GLIBCXX_HAVE_CEILF) -# define _GLIBCXX_HAVE_CEILF 1 -# define aceil _ceilf -#endif - -#if defined (_GLIBCXX_HAVE__CEILL) && ! defined (_GLIBCXX_HAVE_CEILL) -# define _GLIBCXX_HAVE_CEILL 1 -# define aceil _ceill -#endif - -#if defined (_GLIBCXX_HAVE__COSHF) && ! defined (_GLIBCXX_HAVE_COSHF) -# define _GLIBCXX_HAVE_COSHF 1 -# define coshf _coshf -#endif - -#if defined (_GLIBCXX_HAVE__COSL) && ! defined (_GLIBCXX_HAVE_COSL) -# define _GLIBCXX_HAVE_COSL 1 -# define cosl _cosl -#endif - -#if defined (_GLIBCXX_HAVE__LOGF) && ! defined (_GLIBCXX_HAVE_LOGF) -# define _GLIBCXX_HAVE_LOGF 1 -# define logf _logf -#endif - -#if defined (_GLIBCXX_HAVE__COSHL) && ! defined (_GLIBCXX_HAVE_COSHL) -# define _GLIBCXX_HAVE_COSHL 1 -# define coshl _coshl -#endif - -#if defined (_GLIBCXX_HAVE__EXPF) && ! defined (_GLIBCXX_HAVE_EXPF) -# define _GLIBCXX_HAVE_EXPF 1 -# define expf _expf -#endif - -#if defined (_GLIBCXX_HAVE__EXPL) && ! defined (_GLIBCXX_HAVE_EXPL) -# define _GLIBCXX_HAVE_EXPL 1 -# define expl _expl -#endif - -#if defined (_GLIBCXX_HAVE__FABSF) && ! defined (_GLIBCXX_HAVE_FABSF) -# define _GLIBCXX_HAVE_FABSF 1 -# define fabsf _fabsf -#endif - -#if defined (_GLIBCXX_HAVE__FABSL) && ! defined (_GLIBCXX_HAVE_FABSL) -# define _GLIBCXX_HAVE_FABSL 1 -# define fabsl _fabsl -#endif - -#if defined (_GLIBCXX_HAVE__FLOORF) && ! defined (_GLIBCXX_HAVE_FLOORF) -# define _GLIBCXX_HAVE_FLOORF 1 -# define floorf _floorf -#endif - -#if defined (_GLIBCXX_HAVE__FLOORL) && ! defined (_GLIBCXX_HAVE_FLOORL) -# define _GLIBCXX_HAVE_FLOORL 1 -# define floorl _floorl -#endif - -#if defined (_GLIBCXX_HAVE__FMODF) && ! defined (_GLIBCXX_HAVE_FMODF) -# define _GLIBCXX_HAVE_FMODF 1 -# define fmodf _fmodf -#endif - -#if defined (_GLIBCXX_HAVE__FMODL) && ! defined (_GLIBCXX_HAVE_FMODL) -# define _GLIBCXX_HAVE_FMODL 1 -# define fmodl _fmodl -#endif - -#if defined (_GLIBCXX_HAVE__FREXPF) && ! defined (_GLIBCXX_HAVE_FREXPF) -# define _GLIBCXX_HAVE_FREXPF 1 -# define frexpf _frexpf -#endif - -#if defined (_GLIBCXX_HAVE__FREXPL) && ! defined (_GLIBCXX_HAVE_FREXPL) -# define _GLIBCXX_HAVE_FREXPL 1 -# define frexpl _frexpl -#endif - -#if defined (_GLIBCXX_HAVE__LDEXPF) && ! defined (_GLIBCXX_HAVE_LDEXPF) -# define _GLIBCXX_HAVE_LDEXPF 1 -# define ldexpf _ldexpf -#endif - -#if defined (_GLIBCXX_HAVE__LDEXPL) && ! defined (_GLIBCXX_HAVE_LDEXPL) -# define _GLIBCXX_HAVE_LDEXPL 1 -# define ldexpl _ldexpl -#endif - -#if defined (_GLIBCXX_HAVE__LOG10F) && ! defined (_GLIBCXX_HAVE_LOG10F) -# define _GLIBCXX_HAVE_LOG10F 1 -# define log10f _log10f -#endif - -#if defined (_GLIBCXX_HAVE__LOGL) && ! defined (_GLIBCXX_HAVE_LOGL) -# define _GLIBCXX_HAVE_LOGL 1 -# define logl _logl -#endif - -#if defined (_GLIBCXX_HAVE__POWF) && ! defined (_GLIBCXX_HAVE_POWF) -# define _GLIBCXX_HAVE_POWF 1 -# define powf _powf -#endif - -#if defined (_GLIBCXX_HAVE__LOG10L) && ! defined (_GLIBCXX_HAVE_LOG10L) -# define _GLIBCXX_HAVE_LOG10L 1 -# define log10l _log10l -#endif - -#if defined (_GLIBCXX_HAVE__MODF) && ! defined (_GLIBCXX_HAVE_MODF) -# define _GLIBCXX_HAVE_MODF 1 -# define modf _modf -#endif - -#if defined (_GLIBCXX_HAVE__MODL) && ! defined (_GLIBCXX_HAVE_MODL) -# define _GLIBCXX_HAVE_MODL 1 -# define modl _modl -#endif - -#if defined (_GLIBCXX_HAVE__SINF) && ! defined (_GLIBCXX_HAVE_SINF) -# define _GLIBCXX_HAVE_SINF 1 -# define sinf _sinf -#endif - -#if defined (_GLIBCXX_HAVE__POWL) && ! defined (_GLIBCXX_HAVE_POWL) -# define _GLIBCXX_HAVE_POWL 1 -# define powl _powl -#endif - -#if defined (_GLIBCXX_HAVE__SINHF) && ! defined (_GLIBCXX_HAVE_SINHF) -# define _GLIBCXX_HAVE_SINHF 1 -# define sinhf _sinhf -#endif - -#if defined (_GLIBCXX_HAVE__SINL) && ! defined (_GLIBCXX_HAVE_SINL) -# define _GLIBCXX_HAVE_SINL 1 -# define sinl _sinl -#endif - -#if defined (_GLIBCXX_HAVE__SQRTF) && ! defined (_GLIBCXX_HAVE_SQRTF) -# define _GLIBCXX_HAVE_SQRTF 1 -# define sqrtf _sqrtf -#endif - -#if defined (_GLIBCXX_HAVE__SINHL) && ! defined (_GLIBCXX_HAVE_SINHL) -# define _GLIBCXX_HAVE_SINHL 1 -# define sinhl _sinhl -#endif - -#if defined (_GLIBCXX_HAVE__TANF) && ! defined (_GLIBCXX_HAVE_TANF) -# define _GLIBCXX_HAVE_TANF 1 -# define tanf _tanf -#endif - -#if defined (_GLIBCXX_HAVE__SQRTL) && ! defined (_GLIBCXX_HAVE_SQRTL) -# define _GLIBCXX_HAVE_SQRTL 1 -# define sqrtl _sqrtl -#endif - -#if defined (_GLIBCXX_HAVE__TANHF) && ! defined (_GLIBCXX_HAVE_TANHF) -# define _GLIBCXX_HAVE_TANHF 1 -# define tanhf _tanhf -#endif - -#if defined (_GLIBCXX_HAVE__TANL) && ! defined (_GLIBCXX_HAVE_TANL) -# define _GLIBCXX_HAVE_TANF 1 -# define tanf _tanf -#endif - -#if defined (_GLIBCXX_HAVE__STRTOF) && ! defined (_GLIBCXX_HAVE_STRTOF) -# define _GLIBCXX_HAVE_STRTOF 1 -# define strtof _strtof -#endif - -#if defined (_GLIBCXX_HAVE__TANHL) && ! defined (_GLIBCXX_HAVE_TANHL) -# define _GLIBCXX_HAVE_TANHL 1 -# define tanhl _tanhl -#endif - -#if defined (_GLIBCXX_HAVE__STRTOLD) && ! defined (_GLIBCXX_HAVE_STRTOLD) -# define _GLIBCXX_HAVE_STRTOLD 1 -# define strtold _strtold -#endif - -#if defined (_GLIBCXX_HAVE__SINCOS) && ! defined (_GLIBCXX_HAVE_SINCOS) -# define _GLIBCXX_HAVE_SINCOS 1 -# define sincos _sincos -#endif - -#if defined (_GLIBCXX_HAVE__SINCOSF) && ! defined (_GLIBCXX_HAVE_SINCOSF) -# define _GLIBCXX_HAVE_SINCOSF 1 -# define sincosf _sincosf -#endif - -#if defined (_GLIBCXX_HAVE__SINCOSL) && ! defined (_GLIBCXX_HAVE_SINCOSL) -# define _GLIBCXX_HAVE_SINCOSL 1 -# define sincosl _sincosl -#endif - -#if defined (_GLIBCXX_HAVE__FINITE) && ! defined (_GLIBCXX_HAVE_FINITE) -# define _GLIBCXX_HAVE_FINITE 1 -# define finite _finite -#endif - -#if defined (_GLIBCXX_HAVE__FINITEF) && ! defined (_GLIBCXX_HAVE_FINITEF) -# define _GLIBCXX_HAVE_FINITEF 1 -# define finitef _finitef -#endif - -#if defined (_GLIBCXX_HAVE__FINITEL) && ! defined (_GLIBCXX_HAVE_FINITEL) -# define _GLIBCXX_HAVE_FINITEL 1 -# define finitel _finitel -#endif - -#if defined (_GLIBCXX_HAVE__QFINITE) && ! defined (_GLIBCXX_HAVE_QFINITE) -# define _GLIBCXX_HAVE_QFINITE 1 -# define qfinite _qfinite -#endif - -#if defined (_GLIBCXX_HAVE__FPCLASS) && ! defined (_GLIBCXX_HAVE_FPCLASS) -# define _GLIBCXX_HAVE_FPCLASS 1 -# define fpclass _fpclass -#endif - -#if defined (_GLIBCXX_HAVE__QFPCLASS) && ! defined (_GLIBCXX_HAVE_QFPCLASS) -# define _GLIBCXX_HAVE_QFPCLASS 1 -# define qfpclass _qfpclass -#endif - -#endif // _CXXCONFIG_ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++io.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++io.h deleted file mode 100644 index 5659c139730..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++io.h +++ /dev/null @@ -1,86 +0,0 @@ -// underlying io library -*- C++ -*- - -// Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// c_io_stdio.h - Defines for using "C" stdio.h - -#ifndef _C_IO_STDIO_H -#define _C_IO_STDIO_H 1 - -#include <cstdio> -#include <cstddef> -#include <bits/gthr.h> - -namespace std -{ - typedef __gthread_mutex_t __c_lock; - - // for basic_file.h - typedef FILE __c_file; - - // XXX GLIBCXX_ABI Deprecated - // for ios_base.h - struct __ios_flags - { - typedef short __int_type; - - static const __int_type _S_boolalpha = 0x0001; - static const __int_type _S_dec = 0x0002; - static const __int_type _S_fixed = 0x0004; - static const __int_type _S_hex = 0x0008; - static const __int_type _S_internal = 0x0010; - static const __int_type _S_left = 0x0020; - static const __int_type _S_oct = 0x0040; - static const __int_type _S_right = 0x0080; - static const __int_type _S_scientific = 0x0100; - static const __int_type _S_showbase = 0x0200; - static const __int_type _S_showpoint = 0x0400; - static const __int_type _S_showpos = 0x0800; - static const __int_type _S_skipws = 0x1000; - static const __int_type _S_unitbuf = 0x2000; - static const __int_type _S_uppercase = 0x4000; - static const __int_type _S_adjustfield = 0x0020 | 0x0080 | 0x0010; - static const __int_type _S_basefield = 0x0002 | 0x0040 | 0x0008; - static const __int_type _S_floatfield = 0x0100 | 0x0004; - - // 27.4.2.1.3 Type ios_base::iostate - static const __int_type _S_badbit = 0x01; - static const __int_type _S_eofbit = 0x02; - static const __int_type _S_failbit = 0x04; - - // 27.4.2.1.4 Type openmode - static const __int_type _S_app = 0x01; - static const __int_type _S_ate = 0x02; - static const __int_type _S_bin = 0x04; - static const __int_type _S_in = 0x08; - static const __int_type _S_out = 0x10; - static const __int_type _S_trunc = 0x20; - }; -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++locale.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++locale.h deleted file mode 100644 index 7b2282b04f6..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/c++locale.h +++ /dev/null @@ -1,86 +0,0 @@ -// Wrapper for underlying C-language localization -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.8 Standard locale categories. -// - -// Written by Benjamin Kosnik <bkoz@redhat.com> - -#ifndef _C_LOCALE_H -#define _C_LOCALE_H 1 - -#pragma GCC system_header - -#include <clocale> -#include <cstring> // get std::strlen -#include <cstdio> // get std::snprintf or std::sprintf - -#define _GLIBCXX_NUM_CATEGORIES 0 - -namespace std -{ - typedef int* __c_locale; - - // Convert numeric value of type _Tv to string and return length of - // string. If snprintf is available use it, otherwise fall back to - // the unsafe sprintf which, in general, can be dangerous and should - // be avoided. - template<typename _Tv> - int - __convert_from_v(char* __out, - const int __size __attribute__((__unused__)), - const char* __fmt, - _Tv __v, const __c_locale&, int __prec) - { - char* __old = std::setlocale(LC_NUMERIC, NULL); - char* __sav = NULL; - if (std::strcmp(__old, "C")) - { - __sav = new char[std::strlen(__old) + 1]; - std::strcpy(__sav, __old); - std::setlocale(LC_NUMERIC, "C"); - } - -#ifdef _GLIBCXX_USE_C99 - const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); -#else - const int __ret = std::sprintf(__out, __fmt, __prec, __v); -#endif - - if (__sav) - { - std::setlocale(LC_NUMERIC, __sav); - delete [] __sav; - } - return __ret; - } -} - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/codecvt_specializations.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/codecvt_specializations.h deleted file mode 100644 index 24db4c84dc2..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/codecvt_specializations.h +++ /dev/null @@ -1,38 +0,0 @@ -// Locale support (codecvt) -*- C++ -*- - -// Copyright (C) 2000, 2001 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.2.1.5 Template class codecvt -// - -// Warning: this file is not meant for user inclusion. Use <locale>. - -// Written by Benjamin Kosnik <bkoz@cygnus.com> - -// XXX dummy file diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/ctype_base.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/ctype_base.h deleted file mode 100644 index 973d41053b2..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/ctype_base.h +++ /dev/null @@ -1,57 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2000 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h, for solaris2.5.1 - -// Support for Solaris 2.5.1 - - struct ctype_base - { - // Non-standard typedefs. - typedef const int* __to_type; - - // NB: Offsets into ctype<char>::_M_table force a particular size - // on the mask type. Because of this, we don't use an enum. - typedef char mask; - static const mask upper = _U; - static const mask lower = _L; - static const mask alpha = _U | _L; - static const mask digit = _N; - static const mask xdigit = _X | _N; - static const mask space = _S; - static const mask print = _P | _U | _L | _N | _B; - static const mask graph = _P | _U | _L | _N; - static const mask cntrl = _C; - static const mask punct = _P; - static const mask alnum = _U | _L | _N; - }; diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/ctype_inline.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/ctype_inline.h deleted file mode 100644 index 8381aced9cd..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/ctype_inline.h +++ /dev/null @@ -1,67 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2000, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.1 Locales -// - -// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) -// functions go in ctype.cc - - bool - ctype<char>:: - is(mask __m, char __c) const - { return _M_table[static_cast<unsigned char>(__c)] & __m; } - - const char* - ctype<char>:: - is(const char* __low, const char* __high, mask* __vec) const - { - while (__low < __high) - *__vec++ = _M_table[static_cast<unsigned char>(*__low++)]; - return __high; - } - - const char* - ctype<char>:: - scan_is(mask __m, const char* __low, const char* __high) const - { - while (__low < __high && !this->is(__m, *__low)) - ++__low; - return __low; - } - - const char* - ctype<char>:: - scan_not(mask __m, const char* __low, const char* __high) const - { - while (__low < __high && this->is(__m, *__low) != 0) - ++__low; - return __low; - } diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/ctype_noninline.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/ctype_noninline.h deleted file mode 100644 index d0cce941b4c..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/ctype_noninline.h +++ /dev/null @@ -1,98 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.1 Locales -// - -// Information as gleaned from /usr/include/ctype.h - - const ctype_base::mask* - ctype<char>::classic_table() throw() - { return _ctype_ + 1; } - - ctype<char>::ctype(__c_locale, const mask* __table, bool __del, - size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) - : facet(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : classic_table()) - { - memset(_M_widen, 0, sizeof(_M_widen)); - _M_widen_ok = 0; - memset(_M_narrow, 0, sizeof(_M_narrow)); - _M_narrow_ok = 0; - } - - char - ctype<char>::do_toupper(char __c) const - { - int __x = __c; - return (this->is(ctype_base::lower, __c) ? (__x - 'a' + 'A') : __x); - } - - const char* - ctype<char>::do_toupper(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = this->do_toupper(*__low); - ++__low; - } - return __high; - } - - char - ctype<char>::do_tolower(char __c) const - { - int __x = __c; - return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x); - } - - const char* - ctype<char>::do_tolower(char* __low, const char* __high) const - { - while (__low < __high) - { - *__low = this->do_tolower(*__low); - ++__low; - } - return __high; - } - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr-default.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr-default.h deleted file mode 100644 index 1898d24dbda..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr-default.h +++ /dev/null @@ -1,517 +0,0 @@ -/* Threads compatibility routines for libgcc2 and libobjc. */ -/* Compile this one with gcc. */ -/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* As a special exception, if you link this library with other files, - some of which are compiled with GCC, to produce an executable, - this library does not by itself cause the resulting executable - to be covered by the GNU General Public License. - This exception does not however invalidate any other reasons why - the executable file might be covered by the GNU General Public License. */ - -#ifndef _GLIBCXX_GCC_GTHR_POSIX_H -#define _GLIBCXX_GCC_GTHR_POSIX_H - -/* POSIX threads specific definitions. - Easy, since the interface is just one-to-one mapping. */ - -#define __GTHREADS 1 - -/* Some implementations of <pthread.h> require this to be defined. */ -#ifndef _REENTRANT -#define _REENTRANT 1 -#endif - -#include <pthread.h> -#include <unistd.h> - -typedef pthread_key_t __gthread_key_t; -typedef pthread_once_t __gthread_once_t; -typedef pthread_mutex_t __gthread_mutex_t; - -#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER -#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT - -#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK - -#pragma weak pthread_once -#pragma weak pthread_key_create -#pragma weak pthread_key_delete -#pragma weak pthread_getspecific -#pragma weak pthread_setspecific -#pragma weak pthread_create - -#pragma weak pthread_mutex_lock -#pragma weak pthread_mutex_trylock -#pragma weak pthread_mutex_unlock - -#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK) -/* Objective-C. */ -#pragma weak pthread_cond_broadcast -#pragma weak pthread_cond_destroy -#pragma weak pthread_cond_init -#pragma weak pthread_cond_signal -#pragma weak pthread_cond_wait -#pragma weak pthread_exit -#pragma weak pthread_mutex_init -#pragma weak pthread_mutex_destroy -#pragma weak pthread_self -/* These really should be protected by _POSIX_PRIORITY_SCHEDULING, but - we use them inside a _POSIX_THREAD_PRIORITY_SCHEDULING block. */ -#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING -#pragma weak sched_get_priority_max -#pragma weak sched_get_priority_min -#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ -#pragma weak sched_yield -#pragma weak pthread_attr_destroy -#pragma weak pthread_attr_init -#pragma weak pthread_attr_setdetachstate -#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING -#pragma weak pthread_getschedparam -#pragma weak pthread_setschedparam -#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ -#endif /* _LIBOBJC || _LIBOBJC_WEAK */ - -static inline int -__gthread_active_p (void) -{ - static void *const __gthread_active_ptr = (void *) &pthread_create; - return __gthread_active_ptr != 0; -} - -#else /* not __GXX_WEAK__ */ - -static inline int -__gthread_active_p (void) -{ - return 1; -} - -#endif /* __GXX_WEAK__ */ - -#ifdef _LIBOBJC - -/* This is the config.h file in libobjc/ */ -#include <config.h> - -#ifdef HAVE_SCHED_H -# include <sched.h> -#endif - -/* Key structure for maintaining thread specific storage */ -static pthread_key_t _objc_thread_storage; -static pthread_attr_t _objc_thread_attribs; - -/* Thread local storage for a single thread */ -static void *thread_local_storage = NULL; - -/* Backend initialization functions */ - -/* Initialize the threads subsystem. */ -static inline int -__gthread_objc_init_thread_system (void) -{ - if (__gthread_active_p ()) - { - /* Initialize the thread storage key */ - if (pthread_key_create (&_objc_thread_storage, NULL) == 0) - { - /* The normal default detach state for threads is - * PTHREAD_CREATE_JOINABLE which causes threads to not die - * when you think they should. */ - if (pthread_attr_init (&_objc_thread_attribs) == 0 - && pthread_attr_setdetachstate (&_objc_thread_attribs, - PTHREAD_CREATE_DETACHED) == 0) - return 0; - } - } - - return -1; -} - -/* Close the threads subsystem. */ -static inline int -__gthread_objc_close_thread_system (void) -{ - if (__gthread_active_p () - && pthread_key_delete (_objc_thread_storage) == 0 - && pthread_attr_destroy (&_objc_thread_attribs) == 0) - return 0; - - return -1; -} - -/* Backend thread functions */ - -/* Create a new thread of execution. */ -static inline objc_thread_t -__gthread_objc_thread_detach (void (*func)(void *), void *arg) -{ - objc_thread_t thread_id; - pthread_t new_thread_handle; - - if (!__gthread_active_p ()) - return NULL; - - if (!(pthread_create (&new_thread_handle, NULL, (void *) func, arg))) - thread_id = (objc_thread_t) new_thread_handle; - else - thread_id = NULL; - - return thread_id; -} - -/* Set the current thread's priority. */ -static inline int -__gthread_objc_thread_set_priority (int priority) -{ - if (!__gthread_active_p ()) - return -1; - else - { -#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING - pthread_t thread_id = pthread_self (); - int policy; - struct sched_param params; - int priority_min, priority_max; - - if (pthread_getschedparam (thread_id, &policy, ¶ms) == 0) - { - if ((priority_max = sched_get_priority_max (policy)) == -1) - return -1; - - if ((priority_min = sched_get_priority_min (policy)) == -1) - return -1; - - if (priority > priority_max) - priority = priority_max; - else if (priority < priority_min) - priority = priority_min; - params.sched_priority = priority; - - /* - * The solaris 7 and several other man pages incorrectly state that - * this should be a pointer to policy but pthread.h is universally - * at odds with this. - */ - if (pthread_setschedparam (thread_id, policy, ¶ms) == 0) - return 0; - } -#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ - return -1; - } -} - -/* Return the current thread's priority. */ -static inline int -__gthread_objc_thread_get_priority (void) -{ -#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING - if (__gthread_active_p ()) - { - int policy; - struct sched_param params; - - if (pthread_getschedparam (pthread_self (), &policy, ¶ms) == 0) - return params.sched_priority; - else - return -1; - } - else -#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ - return OBJC_THREAD_INTERACTIVE_PRIORITY; -} - -/* Yield our process time to another thread. */ -static inline void -__gthread_objc_thread_yield (void) -{ - if (__gthread_active_p ()) - sched_yield (); -} - -/* Terminate the current thread. */ -static inline int -__gthread_objc_thread_exit (void) -{ - if (__gthread_active_p ()) - /* exit the thread */ - pthread_exit (&__objc_thread_exit_status); - - /* Failed if we reached here */ - return -1; -} - -/* Returns an integer value which uniquely describes a thread. */ -static inline objc_thread_t -__gthread_objc_thread_id (void) -{ - if (__gthread_active_p ()) - return (objc_thread_t) pthread_self (); - else - return (objc_thread_t) 1; -} - -/* Sets the thread's local storage pointer. */ -static inline int -__gthread_objc_thread_set_data (void *value) -{ - if (__gthread_active_p ()) - return pthread_setspecific (_objc_thread_storage, value); - else - { - thread_local_storage = value; - return 0; - } -} - -/* Returns the thread's local storage pointer. */ -static inline void * -__gthread_objc_thread_get_data (void) -{ - if (__gthread_active_p ()) - return pthread_getspecific (_objc_thread_storage); - else - return thread_local_storage; -} - -/* Backend mutex functions */ - -/* Allocate a mutex. */ -static inline int -__gthread_objc_mutex_allocate (objc_mutex_t mutex) -{ - if (__gthread_active_p ()) - { - mutex->backend = objc_malloc (sizeof (pthread_mutex_t)); - - if (pthread_mutex_init ((pthread_mutex_t *) mutex->backend, NULL)) - { - objc_free (mutex->backend); - mutex->backend = NULL; - return -1; - } - } - - return 0; -} - -/* Deallocate a mutex. */ -static inline int -__gthread_objc_mutex_deallocate (objc_mutex_t mutex) -{ - if (__gthread_active_p ()) - { - int count; - - /* - * Posix Threads specifically require that the thread be unlocked - * for pthread_mutex_destroy to work. - */ - - do - { - count = pthread_mutex_unlock ((pthread_mutex_t *) mutex->backend); - if (count < 0) - return -1; - } - while (count); - - if (pthread_mutex_destroy ((pthread_mutex_t *) mutex->backend)) - return -1; - - objc_free (mutex->backend); - mutex->backend = NULL; - } - return 0; -} - -/* Grab a lock on a mutex. */ -static inline int -__gthread_objc_mutex_lock (objc_mutex_t mutex) -{ - if (__gthread_active_p () - && pthread_mutex_lock ((pthread_mutex_t *) mutex->backend) != 0) - { - return -1; - } - - return 0; -} - -/* Try to grab a lock on a mutex. */ -static inline int -__gthread_objc_mutex_trylock (objc_mutex_t mutex) -{ - if (__gthread_active_p () - && pthread_mutex_trylock ((pthread_mutex_t *) mutex->backend) != 0) - { - return -1; - } - - return 0; -} - -/* Unlock the mutex */ -static inline int -__gthread_objc_mutex_unlock (objc_mutex_t mutex) -{ - if (__gthread_active_p () - && pthread_mutex_unlock ((pthread_mutex_t *) mutex->backend) != 0) - { - return -1; - } - - return 0; -} - -/* Backend condition mutex functions */ - -/* Allocate a condition. */ -static inline int -__gthread_objc_condition_allocate (objc_condition_t condition) -{ - if (__gthread_active_p ()) - { - condition->backend = objc_malloc (sizeof (pthread_cond_t)); - - if (pthread_cond_init ((pthread_cond_t *) condition->backend, NULL)) - { - objc_free (condition->backend); - condition->backend = NULL; - return -1; - } - } - - return 0; -} - -/* Deallocate a condition. */ -static inline int -__gthread_objc_condition_deallocate (objc_condition_t condition) -{ - if (__gthread_active_p ()) - { - if (pthread_cond_destroy ((pthread_cond_t *) condition->backend)) - return -1; - - objc_free (condition->backend); - condition->backend = NULL; - } - return 0; -} - -/* Wait on the condition */ -static inline int -__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex) -{ - if (__gthread_active_p ()) - return pthread_cond_wait ((pthread_cond_t *) condition->backend, - (pthread_mutex_t *) mutex->backend); - else - return 0; -} - -/* Wake up all threads waiting on this condition. */ -static inline int -__gthread_objc_condition_broadcast (objc_condition_t condition) -{ - if (__gthread_active_p ()) - return pthread_cond_broadcast ((pthread_cond_t *) condition->backend); - else - return 0; -} - -/* Wake up one thread waiting on this condition. */ -static inline int -__gthread_objc_condition_signal (objc_condition_t condition) -{ - if (__gthread_active_p ()) - return pthread_cond_signal ((pthread_cond_t *) condition->backend); - else - return 0; -} - -#else /* _LIBOBJC */ - -static inline int -__gthread_once (__gthread_once_t *once, void (*func) (void)) -{ - if (__gthread_active_p ()) - return pthread_once (once, func); - else - return -1; -} - -static inline int -__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) -{ - return pthread_key_create (key, dtor); -} - -static inline int -__gthread_key_delete (__gthread_key_t key) -{ - return pthread_key_delete (key); -} - -static inline void * -__gthread_getspecific (__gthread_key_t key) -{ - return pthread_getspecific (key); -} - -static inline int -__gthread_setspecific (__gthread_key_t key, const void *ptr) -{ - return pthread_setspecific (key, ptr); -} - -static inline int -__gthread_mutex_lock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return pthread_mutex_lock (mutex); - else - return 0; -} - -static inline int -__gthread_mutex_trylock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return pthread_mutex_trylock (mutex); - else - return 0; -} - -static inline int -__gthread_mutex_unlock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return pthread_mutex_unlock (mutex); - else - return 0; -} - -#endif /* _LIBOBJC */ - -#endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr-posix.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr-posix.h deleted file mode 100644 index 1898d24dbda..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr-posix.h +++ /dev/null @@ -1,517 +0,0 @@ -/* Threads compatibility routines for libgcc2 and libobjc. */ -/* Compile this one with gcc. */ -/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* As a special exception, if you link this library with other files, - some of which are compiled with GCC, to produce an executable, - this library does not by itself cause the resulting executable - to be covered by the GNU General Public License. - This exception does not however invalidate any other reasons why - the executable file might be covered by the GNU General Public License. */ - -#ifndef _GLIBCXX_GCC_GTHR_POSIX_H -#define _GLIBCXX_GCC_GTHR_POSIX_H - -/* POSIX threads specific definitions. - Easy, since the interface is just one-to-one mapping. */ - -#define __GTHREADS 1 - -/* Some implementations of <pthread.h> require this to be defined. */ -#ifndef _REENTRANT -#define _REENTRANT 1 -#endif - -#include <pthread.h> -#include <unistd.h> - -typedef pthread_key_t __gthread_key_t; -typedef pthread_once_t __gthread_once_t; -typedef pthread_mutex_t __gthread_mutex_t; - -#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER -#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT - -#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK - -#pragma weak pthread_once -#pragma weak pthread_key_create -#pragma weak pthread_key_delete -#pragma weak pthread_getspecific -#pragma weak pthread_setspecific -#pragma weak pthread_create - -#pragma weak pthread_mutex_lock -#pragma weak pthread_mutex_trylock -#pragma weak pthread_mutex_unlock - -#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK) -/* Objective-C. */ -#pragma weak pthread_cond_broadcast -#pragma weak pthread_cond_destroy -#pragma weak pthread_cond_init -#pragma weak pthread_cond_signal -#pragma weak pthread_cond_wait -#pragma weak pthread_exit -#pragma weak pthread_mutex_init -#pragma weak pthread_mutex_destroy -#pragma weak pthread_self -/* These really should be protected by _POSIX_PRIORITY_SCHEDULING, but - we use them inside a _POSIX_THREAD_PRIORITY_SCHEDULING block. */ -#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING -#pragma weak sched_get_priority_max -#pragma weak sched_get_priority_min -#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ -#pragma weak sched_yield -#pragma weak pthread_attr_destroy -#pragma weak pthread_attr_init -#pragma weak pthread_attr_setdetachstate -#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING -#pragma weak pthread_getschedparam -#pragma weak pthread_setschedparam -#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ -#endif /* _LIBOBJC || _LIBOBJC_WEAK */ - -static inline int -__gthread_active_p (void) -{ - static void *const __gthread_active_ptr = (void *) &pthread_create; - return __gthread_active_ptr != 0; -} - -#else /* not __GXX_WEAK__ */ - -static inline int -__gthread_active_p (void) -{ - return 1; -} - -#endif /* __GXX_WEAK__ */ - -#ifdef _LIBOBJC - -/* This is the config.h file in libobjc/ */ -#include <config.h> - -#ifdef HAVE_SCHED_H -# include <sched.h> -#endif - -/* Key structure for maintaining thread specific storage */ -static pthread_key_t _objc_thread_storage; -static pthread_attr_t _objc_thread_attribs; - -/* Thread local storage for a single thread */ -static void *thread_local_storage = NULL; - -/* Backend initialization functions */ - -/* Initialize the threads subsystem. */ -static inline int -__gthread_objc_init_thread_system (void) -{ - if (__gthread_active_p ()) - { - /* Initialize the thread storage key */ - if (pthread_key_create (&_objc_thread_storage, NULL) == 0) - { - /* The normal default detach state for threads is - * PTHREAD_CREATE_JOINABLE which causes threads to not die - * when you think they should. */ - if (pthread_attr_init (&_objc_thread_attribs) == 0 - && pthread_attr_setdetachstate (&_objc_thread_attribs, - PTHREAD_CREATE_DETACHED) == 0) - return 0; - } - } - - return -1; -} - -/* Close the threads subsystem. */ -static inline int -__gthread_objc_close_thread_system (void) -{ - if (__gthread_active_p () - && pthread_key_delete (_objc_thread_storage) == 0 - && pthread_attr_destroy (&_objc_thread_attribs) == 0) - return 0; - - return -1; -} - -/* Backend thread functions */ - -/* Create a new thread of execution. */ -static inline objc_thread_t -__gthread_objc_thread_detach (void (*func)(void *), void *arg) -{ - objc_thread_t thread_id; - pthread_t new_thread_handle; - - if (!__gthread_active_p ()) - return NULL; - - if (!(pthread_create (&new_thread_handle, NULL, (void *) func, arg))) - thread_id = (objc_thread_t) new_thread_handle; - else - thread_id = NULL; - - return thread_id; -} - -/* Set the current thread's priority. */ -static inline int -__gthread_objc_thread_set_priority (int priority) -{ - if (!__gthread_active_p ()) - return -1; - else - { -#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING - pthread_t thread_id = pthread_self (); - int policy; - struct sched_param params; - int priority_min, priority_max; - - if (pthread_getschedparam (thread_id, &policy, ¶ms) == 0) - { - if ((priority_max = sched_get_priority_max (policy)) == -1) - return -1; - - if ((priority_min = sched_get_priority_min (policy)) == -1) - return -1; - - if (priority > priority_max) - priority = priority_max; - else if (priority < priority_min) - priority = priority_min; - params.sched_priority = priority; - - /* - * The solaris 7 and several other man pages incorrectly state that - * this should be a pointer to policy but pthread.h is universally - * at odds with this. - */ - if (pthread_setschedparam (thread_id, policy, ¶ms) == 0) - return 0; - } -#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ - return -1; - } -} - -/* Return the current thread's priority. */ -static inline int -__gthread_objc_thread_get_priority (void) -{ -#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING - if (__gthread_active_p ()) - { - int policy; - struct sched_param params; - - if (pthread_getschedparam (pthread_self (), &policy, ¶ms) == 0) - return params.sched_priority; - else - return -1; - } - else -#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ - return OBJC_THREAD_INTERACTIVE_PRIORITY; -} - -/* Yield our process time to another thread. */ -static inline void -__gthread_objc_thread_yield (void) -{ - if (__gthread_active_p ()) - sched_yield (); -} - -/* Terminate the current thread. */ -static inline int -__gthread_objc_thread_exit (void) -{ - if (__gthread_active_p ()) - /* exit the thread */ - pthread_exit (&__objc_thread_exit_status); - - /* Failed if we reached here */ - return -1; -} - -/* Returns an integer value which uniquely describes a thread. */ -static inline objc_thread_t -__gthread_objc_thread_id (void) -{ - if (__gthread_active_p ()) - return (objc_thread_t) pthread_self (); - else - return (objc_thread_t) 1; -} - -/* Sets the thread's local storage pointer. */ -static inline int -__gthread_objc_thread_set_data (void *value) -{ - if (__gthread_active_p ()) - return pthread_setspecific (_objc_thread_storage, value); - else - { - thread_local_storage = value; - return 0; - } -} - -/* Returns the thread's local storage pointer. */ -static inline void * -__gthread_objc_thread_get_data (void) -{ - if (__gthread_active_p ()) - return pthread_getspecific (_objc_thread_storage); - else - return thread_local_storage; -} - -/* Backend mutex functions */ - -/* Allocate a mutex. */ -static inline int -__gthread_objc_mutex_allocate (objc_mutex_t mutex) -{ - if (__gthread_active_p ()) - { - mutex->backend = objc_malloc (sizeof (pthread_mutex_t)); - - if (pthread_mutex_init ((pthread_mutex_t *) mutex->backend, NULL)) - { - objc_free (mutex->backend); - mutex->backend = NULL; - return -1; - } - } - - return 0; -} - -/* Deallocate a mutex. */ -static inline int -__gthread_objc_mutex_deallocate (objc_mutex_t mutex) -{ - if (__gthread_active_p ()) - { - int count; - - /* - * Posix Threads specifically require that the thread be unlocked - * for pthread_mutex_destroy to work. - */ - - do - { - count = pthread_mutex_unlock ((pthread_mutex_t *) mutex->backend); - if (count < 0) - return -1; - } - while (count); - - if (pthread_mutex_destroy ((pthread_mutex_t *) mutex->backend)) - return -1; - - objc_free (mutex->backend); - mutex->backend = NULL; - } - return 0; -} - -/* Grab a lock on a mutex. */ -static inline int -__gthread_objc_mutex_lock (objc_mutex_t mutex) -{ - if (__gthread_active_p () - && pthread_mutex_lock ((pthread_mutex_t *) mutex->backend) != 0) - { - return -1; - } - - return 0; -} - -/* Try to grab a lock on a mutex. */ -static inline int -__gthread_objc_mutex_trylock (objc_mutex_t mutex) -{ - if (__gthread_active_p () - && pthread_mutex_trylock ((pthread_mutex_t *) mutex->backend) != 0) - { - return -1; - } - - return 0; -} - -/* Unlock the mutex */ -static inline int -__gthread_objc_mutex_unlock (objc_mutex_t mutex) -{ - if (__gthread_active_p () - && pthread_mutex_unlock ((pthread_mutex_t *) mutex->backend) != 0) - { - return -1; - } - - return 0; -} - -/* Backend condition mutex functions */ - -/* Allocate a condition. */ -static inline int -__gthread_objc_condition_allocate (objc_condition_t condition) -{ - if (__gthread_active_p ()) - { - condition->backend = objc_malloc (sizeof (pthread_cond_t)); - - if (pthread_cond_init ((pthread_cond_t *) condition->backend, NULL)) - { - objc_free (condition->backend); - condition->backend = NULL; - return -1; - } - } - - return 0; -} - -/* Deallocate a condition. */ -static inline int -__gthread_objc_condition_deallocate (objc_condition_t condition) -{ - if (__gthread_active_p ()) - { - if (pthread_cond_destroy ((pthread_cond_t *) condition->backend)) - return -1; - - objc_free (condition->backend); - condition->backend = NULL; - } - return 0; -} - -/* Wait on the condition */ -static inline int -__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex) -{ - if (__gthread_active_p ()) - return pthread_cond_wait ((pthread_cond_t *) condition->backend, - (pthread_mutex_t *) mutex->backend); - else - return 0; -} - -/* Wake up all threads waiting on this condition. */ -static inline int -__gthread_objc_condition_broadcast (objc_condition_t condition) -{ - if (__gthread_active_p ()) - return pthread_cond_broadcast ((pthread_cond_t *) condition->backend); - else - return 0; -} - -/* Wake up one thread waiting on this condition. */ -static inline int -__gthread_objc_condition_signal (objc_condition_t condition) -{ - if (__gthread_active_p ()) - return pthread_cond_signal ((pthread_cond_t *) condition->backend); - else - return 0; -} - -#else /* _LIBOBJC */ - -static inline int -__gthread_once (__gthread_once_t *once, void (*func) (void)) -{ - if (__gthread_active_p ()) - return pthread_once (once, func); - else - return -1; -} - -static inline int -__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) -{ - return pthread_key_create (key, dtor); -} - -static inline int -__gthread_key_delete (__gthread_key_t key) -{ - return pthread_key_delete (key); -} - -static inline void * -__gthread_getspecific (__gthread_key_t key) -{ - return pthread_getspecific (key); -} - -static inline int -__gthread_setspecific (__gthread_key_t key, const void *ptr) -{ - return pthread_setspecific (key, ptr); -} - -static inline int -__gthread_mutex_lock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return pthread_mutex_lock (mutex); - else - return 0; -} - -static inline int -__gthread_mutex_trylock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return pthread_mutex_trylock (mutex); - else - return 0; -} - -static inline int -__gthread_mutex_unlock (__gthread_mutex_t *mutex) -{ - if (__gthread_active_p ()) - return pthread_mutex_unlock (mutex); - else - return 0; -} - -#endif /* _LIBOBJC */ - -#endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr-single.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr-single.h deleted file mode 100644 index 68e425b21e2..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr-single.h +++ /dev/null @@ -1,239 +0,0 @@ -/* Threads compatibility routines for libgcc2 and libobjc. */ -/* Compile this one with gcc. */ -/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* As a special exception, if you link this library with other files, - some of which are compiled with GCC, to produce an executable, - this library does not by itself cause the resulting executable - to be covered by the GNU General Public License. - This exception does not however invalidate any other reasons why - the executable file might be covered by the GNU General Public License. */ - -#ifndef _GLIBCXX_GCC_GTHR_SINGLE_H -#define _GLIBCXX_GCC_GTHR_SINGLE_H - -/* Just provide compatibility for mutex handling. */ - -typedef int __gthread_mutex_t; - -#define __GTHREAD_MUTEX_INIT 0 - -#ifdef __cplusplus -#define _GLIBCXX_UNUSED(x) -#else -#define _GLIBCXX_UNUSED(x) x __attribute__((unused)) -#endif - -#ifdef _LIBOBJC - -/* Thread local storage for a single thread */ -static void *thread_local_storage = NULL; - -/* Backend initialization functions */ - -/* Initialize the threads subsystem. */ -static inline int -__gthread_objc_init_thread_system (void) -{ - /* No thread support available */ - return -1; -} - -/* Close the threads subsystem. */ -static inline int -__gthread_objc_close_thread_system (void) -{ - /* No thread support available */ - return -1; -} - -/* Backend thread functions */ - -/* Create a new thread of execution. */ -static inline objc_thread_t -__gthread_objc_thread_detach (void (* func)(void *), void * _GLIBCXX_UNUSED(arg)) -{ - /* No thread support available */ - return NULL; -} - -/* Set the current thread's priority. */ -static inline int -__gthread_objc_thread_set_priority (int _GLIBCXX_UNUSED(priority)) -{ - /* No thread support available */ - return -1; -} - -/* Return the current thread's priority. */ -static inline int -__gthread_objc_thread_get_priority (void) -{ - return OBJC_THREAD_INTERACTIVE_PRIORITY; -} - -/* Yield our process time to another thread. */ -static inline void -__gthread_objc_thread_yield (void) -{ - return; -} - -/* Terminate the current thread. */ -static inline int -__gthread_objc_thread_exit (void) -{ - /* No thread support available */ - /* Should we really exit the program */ - /* exit (&__objc_thread_exit_status); */ - return -1; -} - -/* Returns an integer value which uniquely describes a thread. */ -static inline objc_thread_t -__gthread_objc_thread_id (void) -{ - /* No thread support, use 1. */ - return (objc_thread_t) 1; -} - -/* Sets the thread's local storage pointer. */ -static inline int -__gthread_objc_thread_set_data (void *value) -{ - thread_local_storage = value; - return 0; -} - -/* Returns the thread's local storage pointer. */ -static inline void * -__gthread_objc_thread_get_data (void) -{ - return thread_local_storage; -} - -/* Backend mutex functions */ - -/* Allocate a mutex. */ -static inline int -__gthread_objc_mutex_allocate (objc_mutex_t _GLIBCXX_UNUSED(mutex)) -{ - return 0; -} - -/* Deallocate a mutex. */ -static inline int -__gthread_objc_mutex_deallocate (objc_mutex_t _GLIBCXX_UNUSED(mutex)) -{ - return 0; -} - -/* Grab a lock on a mutex. */ -static inline int -__gthread_objc_mutex_lock (objc_mutex_t _GLIBCXX_UNUSED(mutex)) -{ - /* There can only be one thread, so we always get the lock */ - return 0; -} - -/* Try to grab a lock on a mutex. */ -static inline int -__gthread_objc_mutex_trylock (objc_mutex_t _GLIBCXX_UNUSED(mutex)) -{ - /* There can only be one thread, so we always get the lock */ - return 0; -} - -/* Unlock the mutex */ -static inline int -__gthread_objc_mutex_unlock (objc_mutex_t _GLIBCXX_UNUSED(mutex)) -{ - return 0; -} - -/* Backend condition mutex functions */ - -/* Allocate a condition. */ -static inline int -__gthread_objc_condition_allocate (objc_condition_t _GLIBCXX_UNUSED(condition)) -{ - return 0; -} - -/* Deallocate a condition. */ -static inline int -__gthread_objc_condition_deallocate (objc_condition_t _GLIBCXX_UNUSED(condition)) -{ - return 0; -} - -/* Wait on the condition */ -static inline int -__gthread_objc_condition_wait (objc_condition_t _GLIBCXX_UNUSED(condition), - objc_mutex_t _GLIBCXX_UNUSED(mutex)) -{ - return 0; -} - -/* Wake up all threads waiting on this condition. */ -static inline int -__gthread_objc_condition_broadcast (objc_condition_t _GLIBCXX_UNUSED(condition)) -{ - return 0; -} - -/* Wake up one thread waiting on this condition. */ -static inline int -__gthread_objc_condition_signal (objc_condition_t _GLIBCXX_UNUSED(condition)) -{ - return 0; -} - -#else /* _LIBOBJC */ - -static inline int -__gthread_active_p (void) -{ - return 0; -} - -static inline int -__gthread_mutex_lock (__gthread_mutex_t * _GLIBCXX_UNUSED(mutex)) -{ - return 0; -} - -static inline int -__gthread_mutex_trylock (__gthread_mutex_t * _GLIBCXX_UNUSED(mutex)) -{ - return 0; -} - -static inline int -__gthread_mutex_unlock (__gthread_mutex_t * _GLIBCXX_UNUSED(mutex)) -{ - return 0; -} - -#endif /* _LIBOBJC */ - -#undef _GLIBCXX_UNUSED - -#endif /* ! _GLIBCXX_GCC_GTHR_SINGLE_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr.h deleted file mode 100644 index fe5740c1ca0..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/gthr.h +++ /dev/null @@ -1,103 +0,0 @@ -/* Threads compatibility routines for libgcc2. */ -/* Compile this one with gcc. */ -/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* As a special exception, if you link this library with other files, - some of which are compiled with GCC, to produce an executable, - this library does not by itself cause the resulting executable - to be covered by the GNU General Public License. - This exception does not however invalidate any other reasons why - the executable file might be covered by the GNU General Public License. */ - -#ifndef _GLIBCXX_GCC_GTHR_H -#define _GLIBCXX_GCC_GTHR_H - -/* If this file is compiled with threads support, it must - #define __GTHREADS 1 - to indicate that threads support is present. Also it has define - function - int __gthread_active_p () - that returns 1 if thread system is active, 0 if not. - - The threads interface must define the following types: - __gthread_key_t - __gthread_once_t - __gthread_mutex_t - - The threads interface must define the following macros: - - __GTHREAD_ONCE_INIT - to initialize __gthread_once_t - __GTHREAD_MUTEX_INIT - to initialize __gthread_mutex_t to get a fast - non-recursive mutex. - __GTHREAD_MUTEX_INIT_FUNCTION - some systems can't initialize a mutex without a - function call. On such systems, define this to a - function which looks like this: - void __GTHREAD_MUTEX_INIT_FUNCTION (__gthread_mutex_t *) - Don't define __GTHREAD_MUTEX_INIT in this case - - The threads interface must define the following static functions: - - int __gthread_once (__gthread_once_t *once, void (*func) ()) - - int __gthread_key_create (__gthread_key_t *keyp, void (*dtor) (void *)) - int __gthread_key_delete (__gthread_key_t key) - - void *__gthread_getspecific (__gthread_key_t key) - int __gthread_setspecific (__gthread_key_t key, const void *ptr) - - int __gthread_mutex_lock (__gthread_mutex_t *mutex); - int __gthread_mutex_trylock (__gthread_mutex_t *mutex); - int __gthread_mutex_unlock (__gthread_mutex_t *mutex); - - All functions returning int should return zero on success or the error - number. If the operation is not supported, -1 is returned. - - Currently supported threads packages are - POSIX threads with -D_PTHREADS - DCE threads with -D_DCE_THREADS - Solaris/UI threads with -D_SOLARIS_THREADS -*/ - -/* Check first for thread specific defines. */ -#if _GLIBCXX__PTHREADS -#include <bits/gthr-posix.h> -#elif _GLIBCXX__DCE_THREADS -#include <bits/gthr-dce.h> -#elif _GLIBCXX__SOLARIS_THREADS -#include <bits/gthr-solaris.h> - -/* Include GTHREAD_FILE if one is defined. */ -#elif defined(_GLIBCXX_HAVE_GTHR_DEFAULT) -#if __GXX_WEAK__ -#ifndef _GLIBCXX_GTHREAD_USE_WEAK -#define _GLIBCXX_GTHREAD_USE_WEAK 1 -#endif -#endif -#include <bits/gthr-default.h> - -/* Fallback to single thread definitions. */ -#else -#include <bits/gthr-single.h> -#endif - -#endif /* ! _GLIBCXX_GCC_GTHR_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/messages_members.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/messages_members.h deleted file mode 100644 index 4a2ff4aba1e..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/messages_members.h +++ /dev/null @@ -1,84 +0,0 @@ -// std::messages implementation details, generic version -*- C++ -*- - -// Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.2.7.1.2 messages virtual functions -// - -// Written by Benjamin Kosnik <bkoz@redhat.com> - - // Non-virtual member functions. - template<typename _CharT> - messages<_CharT>::messages(size_t __refs) - : facet(__refs) - { _M_c_locale_messages = _S_get_c_locale(); } - - template<typename _CharT> - messages<_CharT>::messages(__c_locale, const char*, size_t __refs) - : facet(__refs) - { _M_c_locale_messages = _S_get_c_locale(); } - - template<typename _CharT> - typename messages<_CharT>::catalog - messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, - const char*) const - { return this->do_open(__s, __loc); } - - // Virtual member functions. - template<typename _CharT> - messages<_CharT>::~messages() - { _S_destroy_c_locale(_M_c_locale_messages); } - - template<typename _CharT> - typename messages<_CharT>::catalog - messages<_CharT>::do_open(const basic_string<char>&, const locale&) const - { return 0; } - - template<typename _CharT> - typename messages<_CharT>::string_type - messages<_CharT>::do_get(catalog, int, int, - const string_type& __dfault) const - { return __dfault; } - - template<typename _CharT> - void - messages<_CharT>::do_close(catalog) const - { } - - // messages_byname - template<typename _CharT> - messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) - : messages<_CharT>(__refs) - { - if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) - { - this->_S_destroy_c_locale(this->_M_c_locale_messages); - this->_S_create_c_locale(this->_M_c_locale_messages, __s); - } - } diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/os_defines.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/os_defines.h deleted file mode 100644 index 3b19787929f..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/os_defines.h +++ /dev/null @@ -1,36 +0,0 @@ -// Specific definitions for newlib -*- C++ -*- - -// Copyright (C) 2000 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#ifndef _GLIBCXX_OS_DEFINES -#define _GLIBCXX_OS_DEFINES 1 - -// System-specific #define, typedefs, corrections, etc, go here. This -// file will come before all others. - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/time_members.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/time_members.h deleted file mode 100644 index 9801300ceca..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin/bits/time_members.h +++ /dev/null @@ -1,71 +0,0 @@ -// std::time_get, std::time_put implementation, generic version -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.2.5.1.2 - time_get functions -// ISO C++ 14882: 22.2.5.3.2 - time_put functions -// - -// Written by Benjamin Kosnik <bkoz@redhat.com> - - template<typename _CharT> - __timepunct<_CharT>::__timepunct(size_t __refs) - : facet(__refs), _M_data(NULL) - { - _M_name_timepunct = _S_get_c_name(); - _M_initialize_timepunct(); - } - - template<typename _CharT> - __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) - : facet(__refs), _M_data(__cache) - { - _M_name_timepunct = _S_get_c_name(); - _M_initialize_timepunct(); - } - - template<typename _CharT> - __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, - size_t __refs) - : facet(__refs), _M_data(NULL) - { - char* __tmp = new char[std::strlen(__s) + 1]; - std::strcpy(__tmp, __s); - _M_name_timepunct = __tmp; - _M_initialize_timepunct(__cloc); - } - - template<typename _CharT> - __timepunct<_CharT>::~__timepunct() - { - if (_M_name_timepunct != _S_get_c_name()) - delete [] _M_name_timepunct; - delete _M_data; - _S_destroy_c_locale(_M_c_locale_timepunct); - } diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iomanip b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iomanip deleted file mode 100644 index 0d965c28bf9..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iomanip +++ /dev/null @@ -1,300 +0,0 @@ -// Standard stream manipulators -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.6.3 Standard manipulators -// - -/** @file iomanip - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_IOMANIP -#define _GLIBCXX_IOMANIP 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <istream> -#include <functional> - -namespace std -{ - // [27.6.3] standard manipulators - // Also see DR 183. - - struct _Resetiosflags { ios_base::fmtflags _M_mask; }; - - /** - * @brief Manipulator for @c setf. - * @param mask A format flags mask. - * - * Sent to a stream object, this manipulator resets the specified flags, - * via @e stream.setf(0,mask). - */ - inline _Resetiosflags - resetiosflags(ios_base::fmtflags __mask) - { - _Resetiosflags __x; - __x._M_mask = __mask; - return __x; - } - - template<typename _CharT, typename _Traits> - inline basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Resetiosflags __f) - { - __is.setf(ios_base::fmtflags(0), __f._M_mask); - return __is; - } - - template<typename _CharT, typename _Traits> - inline basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Resetiosflags __f) - { - __os.setf(ios_base::fmtflags(0), __f._M_mask); - return __os; - } - - - struct _Setiosflags { ios_base::fmtflags _M_mask; }; - - /** - * @brief Manipulator for @c setf. - * @param mask A format flags mask. - * - * Sent to a stream object, this manipulator sets the format flags - * to @a mask. - */ - inline _Setiosflags - setiosflags(ios_base::fmtflags __mask) - { - _Setiosflags __x; - __x._M_mask = __mask; - return __x; - } - - template<typename _CharT, typename _Traits> - inline basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setiosflags __f) - { - __is.setf(__f._M_mask); - return __is; - } - - template<typename _CharT, typename _Traits> - inline basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Setiosflags __f) - { - __os.setf(__f._M_mask); - return __os; - } - - - struct _Setbase { int _M_base; }; - - /** - * @brief Manipulator for @c setf. - * @param base A numeric base. - * - * Sent to a stream object, this manipulator changes the - * @c ios_base::basefield flags to @c oct, @c dec, or @c hex when @a base - * is 8, 10, or 16, accordingly, and to 0 if @a base is any other value. - */ - inline _Setbase - setbase(int __base) - { - _Setbase __x; - __x._M_base = __base; - return __x; - } - - template<typename _CharT, typename _Traits> - inline basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setbase __f) - { - __is.setf(__f._M_base == 8 ? ios_base::oct : - __f._M_base == 10 ? ios_base::dec : - __f._M_base == 16 ? ios_base::hex : - ios_base::fmtflags(0), ios_base::basefield); - return __is; - } - - template<typename _CharT, typename _Traits> - inline basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Setbase __f) - { - __os.setf(__f._M_base == 8 ? ios_base::oct : - __f._M_base == 10 ? ios_base::dec : - __f._M_base == 16 ? ios_base::hex : - ios_base::fmtflags(0), ios_base::basefield); - return __os; - } - - - template<typename _CharT> - struct _Setfill { _CharT _M_c; }; - - /** - * @brief Manipulator for @c fill. - * @param c The new fill character. - * - * Sent to a stream object, this manipulator calls @c fill(c) for that - * object. - */ - template<typename _CharT> - inline _Setfill<_CharT> - setfill(_CharT __c) - { - _Setfill<_CharT> __x; - __x._M_c = __c; - return __x; - } - - template<typename _CharT, typename _Traits> - inline basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setfill<_CharT> __f) - { - __is.fill(__f._M_c); - return __is; - } - - template<typename _CharT, typename _Traits> - inline basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Setfill<_CharT> __f) - { - __os.fill(__f._M_c); - return __os; - } - - - struct _Setprecision { int _M_n; }; - - /** - * @brief Manipulator for @c precision. - * @param n The new precision. - * - * Sent to a stream object, this manipulator calls @c precision(n) for - * that object. - */ - inline _Setprecision - setprecision(int __n) - { - _Setprecision __x; - __x._M_n = __n; - return __x; - } - - template<typename _CharT, typename _Traits> - inline basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setprecision __f) - { - __is.precision(__f._M_n); - return __is; - } - - template<typename _CharT, typename _Traits> - inline basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Setprecision __f) - { - __os.precision(__f._M_n); - return __os; - } - - - struct _Setw { int _M_n; }; - - /** - * @brief Manipulator for @c width. - * @param n The new width. - * - * Sent to a stream object, this manipulator calls @c width(n) for - * that object. - */ - inline _Setw - setw(int __n) - { - _Setw __x; - __x._M_n = __n; - return __x; - } - - template<typename _CharT, typename _Traits> - inline basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setw __f) - { - __is.width(__f._M_n); - return __is; - } - - template<typename _CharT, typename _Traits> - inline basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Setw __f) - { - __os.width(__f._M_n); - return __os; - } - - // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. - // NB: This syntax is a GNU extension. -#if _GLIBCXX_EXTERN_TEMPLATE - extern template ostream& operator<<(ostream&, _Setfill<char>); - extern template ostream& operator<<(ostream&, _Setiosflags); - extern template ostream& operator<<(ostream&, _Resetiosflags); - extern template ostream& operator<<(ostream&, _Setbase); - extern template ostream& operator<<(ostream&, _Setprecision); - extern template ostream& operator<<(ostream&, _Setw); - extern template istream& operator>>(istream&, _Setfill<char>); - extern template istream& operator>>(istream&, _Setiosflags); - extern template istream& operator>>(istream&, _Resetiosflags); - extern template istream& operator>>(istream&, _Setbase); - extern template istream& operator>>(istream&, _Setprecision); - extern template istream& operator>>(istream&, _Setw); - -#ifdef _GLIBCXX_USE_WCHAR_T - extern template wostream& operator<<(wostream&, _Setfill<wchar_t>); - extern template wostream& operator<<(wostream&, _Setiosflags); - extern template wostream& operator<<(wostream&, _Resetiosflags); - extern template wostream& operator<<(wostream&, _Setbase); - extern template wostream& operator<<(wostream&, _Setprecision); - extern template wostream& operator<<(wostream&, _Setw); - extern template wistream& operator>>(wistream&, _Setfill<wchar_t>); - extern template wistream& operator>>(wistream&, _Setiosflags); - extern template wistream& operator>>(wistream&, _Resetiosflags); - extern template wistream& operator>>(wistream&, _Setbase); - extern template wistream& operator>>(wistream&, _Setprecision); - extern template wistream& operator>>(wistream&, _Setw); -#endif -#endif -} // namespace std - -#endif /* _GLIBCXX_IOMANIP */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ios b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ios deleted file mode 100644 index 596458f1ede..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ios +++ /dev/null @@ -1,53 +0,0 @@ -// Iostreams base classes -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.4 Iostreams base classes -// - -/** @file ios - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_IOS -#define _GLIBCXX_IOS 1 - -#pragma GCC system_header - -#include <iosfwd> -#include <exception> // For ios_base::failure -#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos -#include <cstdio> // For SEEK_SET, SEEK_CUR, SEEK_END -#include <bits/localefwd.h> // For class locale -#include <bits/ios_base.h> // For ios_base declarations. -#include <streambuf> -#include <bits/basic_ios.h> - -#endif /* _GLIBCXX_IOS */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iosfwd b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iosfwd deleted file mode 100644 index 050b9e8bab7..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iosfwd +++ /dev/null @@ -1,168 +0,0 @@ -// Forwarding declarations -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.2 Forward declarations -// - -/** @file iosfwd - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_IOSFWD -#define _GLIBCXX_IOSFWD 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/c++locale.h> -#include <bits/c++io.h> -#include <cctype> // For isspace, etc. -#include <bits/stringfwd.h> // For string forward declarations. -#include <bits/postypes.h> -#include <bits/functexcept.h> - -namespace std -{ - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_ios; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_streambuf; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_istream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_ostream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_iostream; - - template<typename _CharT, typename _Traits = char_traits<_CharT>, - typename _Alloc = allocator<_CharT> > - class basic_stringbuf; - - template<typename _CharT, typename _Traits = char_traits<_CharT>, - typename _Alloc = allocator<_CharT> > - class basic_istringstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT>, - typename _Alloc = allocator<_CharT> > - class basic_ostringstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT>, - typename _Alloc = allocator<_CharT> > - class basic_stringstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_filebuf; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_ifstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_ofstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_fstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class istreambuf_iterator; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class ostreambuf_iterator; - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // Not included. (??? Apparently no LWG number?) - class ios_base; - - /** - * @defgroup s27_2_iosfwd I/O Forward Declarations - * - * Nearly all of the I/O classes are parameterized on the type of - * characters they read and write. (The major exception is ios_base at - * the top of the hierarchy.) This is a change from pre-Standard - * streams, which were not templates. - * - * For ease of use and compatibility, all of the basic_* I/O-related - * classes are given typedef names for both of the builtin character - * widths (wide and narrow). The typedefs are the same as the - * pre-Standard names, for example: - * - * @code - * typedef basic_ifstream<char> ifstream; - * @endcode - * - * Because properly forward-declaring these classes can be difficult, you - * should not do it yourself. Instead, include the <iosfwd> - * header, which contains only declarations of all the I/O classes as - * well as the typedefs. Trying to forward-declare the typedefs - * themselves (e.g., "class ostream;") is not valid ISO C++. - * - * For more specific declarations, see - * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#10 - * - * @{ - */ - typedef basic_ios<char> ios; ///< @isiosfwd - typedef basic_streambuf<char> streambuf; ///< @isiosfwd - typedef basic_istream<char> istream; ///< @isiosfwd - typedef basic_ostream<char> ostream; ///< @isiosfwd - typedef basic_iostream<char> iostream; ///< @isiosfwd - typedef basic_stringbuf<char> stringbuf; ///< @isiosfwd - typedef basic_istringstream<char> istringstream; ///< @isiosfwd - typedef basic_ostringstream<char> ostringstream; ///< @isiosfwd - typedef basic_stringstream<char> stringstream; ///< @isiosfwd - typedef basic_filebuf<char> filebuf; ///< @isiosfwd - typedef basic_ifstream<char> ifstream; ///< @isiosfwd - typedef basic_ofstream<char> ofstream; ///< @isiosfwd - typedef basic_fstream<char> fstream; ///< @isiosfwd - -#ifdef _GLIBCXX_USE_WCHAR_T - typedef basic_ios<wchar_t> wios; ///< @isiosfwd - typedef basic_streambuf<wchar_t> wstreambuf; ///< @isiosfwd - typedef basic_istream<wchar_t> wistream; ///< @isiosfwd - typedef basic_ostream<wchar_t> wostream; ///< @isiosfwd - typedef basic_iostream<wchar_t> wiostream; ///< @isiosfwd - typedef basic_stringbuf<wchar_t> wstringbuf; ///< @isiosfwd - typedef basic_istringstream<wchar_t> wistringstream; ///< @isiosfwd - typedef basic_ostringstream<wchar_t> wostringstream; ///< @isiosfwd - typedef basic_stringstream<wchar_t> wstringstream; ///< @isiosfwd - typedef basic_filebuf<wchar_t> wfilebuf; ///< @isiosfwd - typedef basic_ifstream<wchar_t> wifstream; ///< @isiosfwd - typedef basic_ofstream<wchar_t> wofstream; ///< @isiosfwd - typedef basic_fstream<wchar_t> wfstream; ///< @isiosfwd -#endif - /** @} */ -} // namespace std - -#endif /* _GLIBCXX_IOSFWD */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iostream b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iostream deleted file mode 100644 index f5049db4a91..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iostream +++ /dev/null @@ -1,80 +0,0 @@ -// Standard iostream objects -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.3 Standard iostream objects -// - -/** @file iostream - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_IOSTREAM -#define _GLIBCXX_IOSTREAM 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <ostream> -#include <istream> - -namespace std -{ - /** - * @name Standard Stream Objects - * - * The <iostream> header declares the eight <em>standard stream - * objects</em>. For other declarations, see - * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#10 and the - * @link s27_2_iosfwd I/O forward declarations @endlink - * - * They are required by default to cooperate with the global C library's - * @c FILE streams, and to be available during program startup and - * termination. For more information, see the HOWTO linked to above. - */ - //@{ - extern istream cin; ///< Linked to standard input - extern ostream cout; ///< Linked to standard output - extern ostream cerr; ///< Linked to standard error (unbuffered) - extern ostream clog; ///< Linked to standard error (buffered) - -#ifdef _GLIBCXX_USE_WCHAR_T - extern wistream wcin; ///< Linked to standard input - extern wostream wcout; ///< Linked to standard output - extern wostream wcerr; ///< Linked to standard error (unbuffered) - extern wostream wclog; ///< Linked to standard error (buffered) -#endif - //@} - - // For construction of filebuffers for cout, cin, cerr, clog et. al. - static ios_base::Init __ioinit; -} // namespace std - -#endif /* _GLIBCXX_IOSTREAM */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/istream b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/istream deleted file mode 100644 index a3a53ba73f6..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/istream +++ /dev/null @@ -1,774 +0,0 @@ -// Input streams -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.6.1 Input streams -// - -/** @file istream - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_ISTREAM -#define _GLIBCXX_ISTREAM 1 - -#pragma GCC system_header - -#include <ios> -#include <limits> // For numeric_limits - -namespace std -{ - // [27.6.1.1] Template class basic_istream - /** - * @brief Controlling input. - * - * This is the base class for all input streams. It provides text - * formatting of all builtin types, and communicates with any class - * derived from basic_streambuf to do the actual input. - */ - template<typename _CharT, typename _Traits> - class basic_istream : virtual public basic_ios<_CharT, _Traits> - { - public: - // Types (inherited from basic_ios (27.4.4)): - typedef _CharT char_type; - typedef typename _Traits::int_type int_type; - typedef typename _Traits::pos_type pos_type; - typedef typename _Traits::off_type off_type; - typedef _Traits traits_type; - - // Non-standard Types: - typedef basic_streambuf<_CharT, _Traits> __streambuf_type; - typedef basic_ios<_CharT, _Traits> __ios_type; - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > - __num_get_type; - typedef ctype<_CharT> __ctype_type; - - template<typename _CharT2, typename _Traits2> - friend basic_istream<_CharT2, _Traits2>& - operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2&); - - template<typename _CharT2, typename _Traits2> - friend basic_istream<_CharT2, _Traits2>& - operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*); - - protected: - // Data Members: - /** - * @if maint - * The number of characters extracted in the previous unformatted - * function; see gcount(). - * @endif - */ - streamsize _M_gcount; - - public: - // [27.6.1.1.1] constructor/destructor - /** - * @brief Base constructor. - * - * This ctor is almost never called by the user directly, rather from - * derived classes' initialization lists, which pass a pointer to - * their own stream buffer. - */ - explicit - basic_istream(__streambuf_type* __sb): _M_gcount(streamsize(0)) - { this->init(__sb); } - - /** - * @brief Base destructor. - * - * This does very little apart from providing a virtual base dtor. - */ - virtual - ~basic_istream() - { _M_gcount = streamsize(0); } - - // [27.6.1.1.2] prefix/suffix - class sentry; - friend class sentry; - - // [27.6.1.2] formatted input - // [27.6.1.2.3] basic_istream::operator>> - //@{ - /** - * @brief Interface for manipulators. - * - * Manuipulators such as @c std::ws and @c std::dec use these - * functions in constructs like "std::cin >> std::ws". For more - * information, see the iomanip header. - */ - inline __istream_type& - operator>>(__istream_type& (*__pf)(__istream_type&)); - - inline __istream_type& - operator>>(__ios_type& (*__pf)(__ios_type&)); - - inline __istream_type& - operator>>(ios_base& (*__pf)(ios_base&)); - //@} - - // [27.6.1.2.2] arithmetic extractors - /** - * @name Arithmetic Extractors - * - * All the @c operator>> functions (aka <em>formatted input - * functions</em>) have some common behavior. Each starts by - * constructing a temporary object of type std::basic_istream::sentry - * with the second argument (noskipws) set to false. This has several - * effects, concluding with the setting of a status flag; see the - * sentry documentation for more. - * - * If the sentry status is good, the function tries to extract - * whatever data is appropriate for the type of the argument. - * - * If an exception is thrown during extraction, ios_base::badbit - * will be turned on in the stream's error state without causing an - * ios_base::failure to be thrown. The original exception will then - * be rethrown. - */ - //@{ - /** - * @brief Basic arithmetic extractors - * @param A variable of builtin type. - * @return @c *this if successful - * - * These functions use the stream's current locale (specifically, the - * @c num_get facet) to parse the input data. - */ - __istream_type& - operator>>(bool& __n); - - __istream_type& - operator>>(short& __n); - - __istream_type& - operator>>(unsigned short& __n); - - __istream_type& - operator>>(int& __n); - - __istream_type& - operator>>(unsigned int& __n); - - __istream_type& - operator>>(long& __n); - - __istream_type& - operator>>(unsigned long& __n); - -#ifdef _GLIBCXX_USE_LONG_LONG - __istream_type& - operator>>(long long& __n); - - __istream_type& - operator>>(unsigned long long& __n); -#endif - - __istream_type& - operator>>(float& __f); - - __istream_type& - operator>>(double& __f); - - __istream_type& - operator>>(long double& __f); - - __istream_type& - operator>>(void*& __p); - - /** - * @brief Extracting into another streambuf. - * @param sb A pointer to a streambuf - * - * This function behaves like one of the basic arithmetic extractors, - * in that it also constructs a sentry object and has the same error - * handling behavior. - * - * If @a sb is NULL, the stream will set failbit in its error state. - * - * Characters are extracted from this stream and inserted into the - * @a sb streambuf until one of the following occurs: - * - * - the input stream reaches end-of-file, - * - insertion into the output buffer fails (in this case, the - * character that would have been inserted is not extracted), or - * - an exception occurs (and in this case is caught) - * - * If the function inserts no characters, failbit is set. - */ - __istream_type& - operator>>(__streambuf_type* __sb); - //@} - - // [27.6.1.3] unformatted input - /** - * @brief Character counting - * @return The number of characters extracted by the previous - * unformatted input function dispatched for this stream. - */ - inline streamsize - gcount() const - { return _M_gcount; } - - /** - * @name Unformatted Input Functions - * - * All the unformatted input functions have some common behavior. - * Each starts by constructing a temporary object of type - * std::basic_istream::sentry with the second argument (noskipws) - * set to true. This has several effects, concluding with the - * setting of a status flag; see the sentry documentation for more. - * - * If the sentry status is good, the function tries to extract - * whatever data is appropriate for the type of the argument. - * - * The number of characters extracted is stored for later retrieval - * by gcount(). - * - * If an exception is thrown during extraction, ios_base::badbit - * will be turned on in the stream's error state without causing an - * ios_base::failure to be thrown. The original exception will then - * be rethrown. - */ - //@{ - /** - * @brief Simple extraction. - * @return A character, or eof(). - * - * Tries to extract a character. If none are available, sets failbit - * and returns traits::eof(). - */ - int_type - get(); - - /** - * @brief Simple extraction. - * @param c The character in which to store data. - * @return *this - * - * Tries to extract a character and store it in @a c. If none are - * available, sets failbit and returns traits::eof(). - * - * @note This function is not overloaded on signed char and - * unsigned char. - */ - __istream_type& - get(char_type& __c); - - /** - * @brief Simple multiple-character extraction. - * @param s Pointer to an array. - * @param n Maximum number of characters to store in @a s. - * @param delim A "stop" character. - * @return *this - * - * Characters are extracted and stored into @a s until one of the - * following happens: - * - * - @c n-1 characters are stored - * - the input sequence reaches EOF - * - the next character equals @a delim, in which case the character - * is not extracted - * - * If no characters are stored, failbit is set in the stream's error - * state. - * - * In any case, a null character is stored into the next location in - * the array. - * - * @note This function is not overloaded on signed char and - * unsigned char. - */ - __istream_type& - get(char_type* __s, streamsize __n, char_type __delim); - - /** - * @brief Simple multiple-character extraction. - * @param s Pointer to an array. - * @param n Maximum number of characters to store in @a s. - * @return *this - * - * Returns @c get(s,n,widen('\n')). - */ - inline __istream_type& - get(char_type* __s, streamsize __n) - { return this->get(__s, __n, this->widen('\n')); } - - /** - * @brief Extraction into another streambuf. - * @param sb A streambuf in which to store data. - * @param delim A "stop" character. - * @return *this - * - * Characters are extracted and inserted into @a sb until one of the - * following happens: - * - * - the input sequence reaches EOF - * - insertion into the output buffer fails (in this case, the - * character that would have been inserted is not extracted) - * - the next character equals @a delim (in this case, the character - * is not extracted) - * - an exception occurs (and in this case is caught) - * - * If no characters are stored, failbit is set in the stream's error - * state. - */ - __istream_type& - get(__streambuf_type& __sb, char_type __delim); - - /** - * @brief Extraction into another streambuf. - * @param sb A streambuf in which to store data. - * @return *this - * - * Returns @c get(sb,widen('\n')). - */ - inline __istream_type& - get(__streambuf_type& __sb) - { return this->get(__sb, this->widen('\n')); } - - /** - * @brief String extraction. - * @param s A character array in which to store the data. - * @param n Maximum number of characters to extract. - * @param delim A "stop" character. - * @return *this - * - * Extracts and stores characters into @a s until one of the - * following happens. Note that these criteria are required to be - * tested in the order listed here, to allow an input line to exactly - * fill the @a s array without setting failbit. - * - * -# the input sequence reaches end-of-file, in which case eofbit - * is set in the stream error state - * -# the next character equals @c delim, in which case the character - * is extracted (and therefore counted in @c gcount()) but not stored - * -# @c n-1 characters are stored, in which case failbit is set - * in the stream error state - * - * If no characters are extracted, failbit is set. (An empty line of - * input should therefore not cause failbit to be set.) - * - * In any case, a null character is stored in the next location in - * the array. - */ - __istream_type& - getline(char_type* __s, streamsize __n, char_type __delim); - - /** - * @brief String extraction. - * @param s A character array in which to store the data. - * @param n Maximum number of characters to extract. - * @return *this - * - * Returns @c getline(s,n,widen('\n')). - */ - inline __istream_type& - getline(char_type* __s, streamsize __n) - { return this->getline(__s, __n, this->widen('\n')); } - - /** - * @brief Discarding characters - * @param n Number of characters to discard. - * @param delim A "stop" character. - * @return *this - * - * Extracts characters and throws them away until one of the - * following happens: - * - if @a n @c != @c std::numeric_limits<int>::max(), @a n - * characters are extracted - * - the input sequence reaches end-of-file - * - the next character equals @a delim (in this case, the character - * is extracted); note that this condition will never occur if - * @a delim equals @c traits::eof(). - */ - __istream_type& - ignore(streamsize __n = 1, int_type __delim = traits_type::eof()); - - /** - * @brief Looking ahead in the stream - * @return The next character, or eof(). - * - * If, after constructing the sentry object, @c good() is false, - * returns @c traits::eof(). Otherwise reads but does not extract - * the next input character. - */ - int_type - peek(); - - /** - * @brief Extraction without delimiters. - * @param s A character array. - * @param n Maximum number of characters to store. - * @return *this - * - * If the stream state is @c good(), extracts characters and stores - * them into @a s until one of the following happens: - * - @a n characters are stored - * - the input sequence reaches end-of-file, in which case the error - * state is set to @c failbit|eofbit. - * - * @note This function is not overloaded on signed char and - * unsigned char. - */ - __istream_type& - read(char_type* __s, streamsize __n); - - /** - * @brief Extraction until the buffer is exhausted, but no more. - * @param s A character array. - * @param n Maximum number of characters to store. - * @return The number of characters extracted. - * - * Extracts characters and stores them into @a s depending on the - * number of characters remaining in the streambuf's buffer, - * @c rdbuf()->in_avail(), called @c A here: - * - if @c A @c == @c -1, sets eofbit and extracts no characters - * - if @c A @c == @c 0, extracts no characters - * - if @c A @c > @c 0, extracts @c min(A,n) - * - * The goal is to empty the current buffer, and to not request any - * more from the external input sequence controlled by the streambuf. - */ - streamsize - readsome(char_type* __s, streamsize __n); - - /** - * @brief Unextracting a single character. - * @param c The character to push back into the input stream. - * @return *this - * - * If @c rdbuf() is not null, calls @c rdbuf()->sputbackc(c). - * - * If @c rdbuf() is null or if @c sputbackc() fails, sets badbit in - * the error state. - * - * @note Since no characters are extracted, the next call to - * @c gcount() will return 0, as required by DR 60. - */ - __istream_type& - putback(char_type __c); - - /** - * @brief Unextracting the previous character. - * @return *this - * - * If @c rdbuf() is not null, calls @c rdbuf()->sungetc(c). - * - * If @c rdbuf() is null or if @c sungetc() fails, sets badbit in - * the error state. - * - * @note Since no characters are extracted, the next call to - * @c gcount() will return 0, as required by DR 60. - */ - __istream_type& - unget(); - - /** - * @brief Synchronizing the stream buffer. - * @return 0 on success, -1 on failure - * - * If @c rdbuf() is a null pointer, returns -1. - * - * Otherwise, calls @c rdbuf()->pubsync(), and if that returns -1, - * sets badbit and returns -1. - * - * Otherwise, returns 0. - * - * @note This function does not count the number of characters - * extracted, if any, and therefore does not affect the next - * call to @c gcount(). - */ - int - sync(); - - /** - * @brief Getting the current read position. - * @return A file position object. - * - * If @c fail() is not false, returns @c pos_type(-1) to indicate - * failure. Otherwise returns @c rdbuf()->pubseekoff(0,cur,in). - * - * @note This function does not count the number of characters - * extracted, if any, and therefore does not affect the next - * call to @c gcount(). - */ - pos_type - tellg(); - - /** - * @brief Changing the current read position. - * @param pos A file position object. - * @return *this - * - * If @c fail() is not true, calls @c rdbuf()->pubseekpos(pos). If - * that function fails, sets failbit. - * - * @note This function does not count the number of characters - * extracted, if any, and therefore does not affect the next - * call to @c gcount(). - */ - __istream_type& - seekg(pos_type); - - /** - * @brief Changing the current read position. - * @param off A file offset object. - * @param dir The direction in which to seek. - * @return *this - * - * If @c fail() is not true, calls @c rdbuf()->pubseekoff(off,dir). - * If that function fails, sets failbit. - * - * @note This function does not count the number of characters - * extracted, if any, and therefore does not affect the next - * call to @c gcount(). - */ - __istream_type& - seekg(off_type, ios_base::seekdir); - //@} - - protected: - explicit - basic_istream(): _M_gcount(streamsize(0)) { } - }; - - /** - * @brief Performs setup work for input streams. - * - * Objects of this class are created before all of the standard - * extractors are run. It is responsible for "exception-safe prefix and - * suffix operations," although only prefix actions are currently required - * by the standard. Additional actions may be added by the - * implementation, and we list them in - * http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/howto.html#5 - * under [27.6] notes. - */ - template<typename _CharT, typename _Traits> - class basic_istream<_CharT, _Traits>::sentry - { - public: - /// Easy access to dependant types. - typedef _Traits traits_type; - typedef basic_streambuf<_CharT, _Traits> __streambuf_type; - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef typename __istream_type::__ctype_type __ctype_type; - typedef typename _Traits::int_type __int_type; - - /** - * @brief The constructor performs all the work. - * @param is The input stream to guard. - * @param noskipws Whether to consume whitespace or not. - * - * If the stream state is good (@a is.good() is true), then the - * following actions are performed, otherwise the sentry state is - * false ("not okay") and failbit is set in the stream state. - * - * The sentry's preparatory actions are: - * - * -# if the stream is tied to an output stream, @c is.tie()->flush() - * is called to synchronize the output sequence - * -# if @a noskipws is false, and @c ios_base::skipws is set in - * @c is.flags(), the sentry extracts and discards whitespace - * characters from the stream. The currently imbued locale is - * used to determine whether each character is whitespace. - * - * If the stream state is still good, then the sentry state becomes - * true ("okay"). - */ - explicit - sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false); - - /** - * @brief Quick status checking. - * @return The sentry state. - * - * For ease of use, sentries may be converted to booleans. The - * return value is that of the sentry state (true == okay). - */ - operator bool() const { return _M_ok; } - - private: - bool _M_ok; - }; - - // [27.6.1.2.3] character extraction templates - //@{ - /** - * @brief Character extractors - * @param in An input stream. - * @param c A character reference. - * @return in - * - * Behaves like one of the formatted arithmetic extractors described in - * std::basic_istream. After constructing a sentry object with good - * status, this function extracts a character (if one is available) and - * stores it in @a c. Otherwise, sets failbit in the input stream. - */ - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c); - - template<class _Traits> - basic_istream<char, _Traits>& - operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) - { return (__in >> reinterpret_cast<char&>(__c)); } - - template<class _Traits> - basic_istream<char, _Traits>& - operator>>(basic_istream<char, _Traits>& __in, signed char& __c) - { return (__in >> reinterpret_cast<char&>(__c)); } - //@} - - //@{ - /** - * @brief Character string extractors - * @param in An input stream. - * @param s A pointer to a character array. - * @return in - * - * Behaves like one of the formatted arithmetic extractors described in - * std::basic_istream. After constructing a sentry object with good - * status, this function extracts up to @c n characters and stores them - * into the array starting at @a s. @c n is defined as: - * - * - if @c width() is greater than zero, @c n is width() - * - otherwise @c n is "the number of elements of the largest array of - * @c char_type that can store a terminating @c eos." [27.6.1.2.3]/6 - * - * Characters are extracted and stored until one of the following happens: - * - @c n-1 characters are stored - * - EOF is reached - * - the next character is whitespace according to the current locale - * - the next character is a null byte (i.e., @c charT() ) - * - * @c width(0) is then called for the input stream. - * - * If no characters are extracted, sets failbit. - */ - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s); - - template<class _Traits> - basic_istream<char,_Traits>& - operator>>(basic_istream<char,_Traits>& __in, unsigned char* __s) - { return (__in >> reinterpret_cast<char*>(__s)); } - - template<class _Traits> - basic_istream<char,_Traits>& - operator>>(basic_istream<char,_Traits>& __in, signed char* __s) - { return (__in >> reinterpret_cast<char*>(__s)); } - //@} - - // 27.6.1.5 Template class basic_iostream - /** - * @brief Merging istream and ostream capabilities. - * - * This class multiply inherits from the input and output stream classes - * simply to provide a single interface. - */ - template<typename _CharT, typename _Traits> - class basic_iostream - : public basic_istream<_CharT, _Traits>, - public basic_ostream<_CharT, _Traits> - { - public: - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 271. basic_iostream missing typedefs - // Types (inherited): - typedef _CharT char_type; - typedef typename _Traits::int_type int_type; - typedef typename _Traits::pos_type pos_type; - typedef typename _Traits::off_type off_type; - typedef _Traits traits_type; - - // Non-standard Types: - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef basic_ostream<_CharT, _Traits> __ostream_type; - - /** - * @brief Constructor does nothing. - * - * Both of the parent classes are initialized with the same - * streambuf pointer passed to this constructor. - */ - explicit - basic_iostream(basic_streambuf<_CharT, _Traits>* __sb) - : __istream_type(), __ostream_type() - { this->init(__sb); } - - /** - * @brief Destructor does nothing. - */ - virtual - ~basic_iostream() { } - - protected: - explicit - basic_iostream() : __istream_type(), __ostream_type() - { } - }; - - // [27.6.1.4] standard basic_istream manipulators - /** - * @brief Quick and easy way to eat whitespace - * - * This manipulator extracts whitespace characters, stopping when the - * next character is non-whitespace, or when the input sequence is empty. - * If the sequence is empty, @c eofbit is set in the stream, but not - * @c failbit. - * - * The current locale is used to distinguish whitespace characters. - * - * Example: - * @code - * MyClass mc; - * - * std::cin >> std::ws >> mc; - * @endcode - * will skip leading whitespace before calling operator>> on cin and your - * object. Note that the same effect can be achieved by creating a - * std::basic_istream::sentry inside your definition of operator>>. - */ - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - ws(basic_istream<_CharT, _Traits>& __is); -} // namespace std - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/istream.tcc> -#endif - -#endif /* _GLIBCXX_ISTREAM */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iterator b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iterator deleted file mode 100644 index 6e3840b1e7e..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iterator +++ /dev/null @@ -1,76 +0,0 @@ -// <iterator> -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file iterator - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_ITERATOR -#define _GLIBCXX_ITERATOR 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <cstddef> -#include <bits/stl_iterator_base_types.h> -#include <bits/stl_iterator_base_funcs.h> -#include <bits/stl_iterator.h> -#include <ostream> -#include <istream> -#include <bits/stream_iterator.h> -#include <bits/streambuf_iterator.h> - -#endif /* _GLIBCXX_ITERATOR */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/limits b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/limits deleted file mode 100644 index 7f96647f95d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/limits +++ /dev/null @@ -1,1143 +0,0 @@ -// The template and inlines for the -*- C++ -*- numeric_limits classes. - -// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Note: this is not a conforming implementation. -// Written by Gabriel Dos Reis <gdr@codesourcery.com> - -// -// ISO 14882:1998 -// 18.2.1 -// - -/** @file limits - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_NUMERIC_LIMITS -#define _GLIBCXX_NUMERIC_LIMITS 1 - -#pragma GCC system_header - -#include <bits/c++config.h> - -// -// The numeric_limits<> traits document implementation-defined aspects -// of fundamental arithmetic data types (integers and floating points). -// From Standard C++ point of view, there are 13 such types: -// * integers -// bool (1) -// char, signed char, unsigned char (3) -// short, unsigned short (2) -// int, unsigned (2) -// long, unsigned long (2) -// -// * floating points -// float (1) -// double (1) -// long double (1) -// -// GNU C++ undertstands (where supported by the host C-library) -// * integer -// long long, unsigned long long (2) -// -// which brings us to 15 fundamental arithmetic data types in GNU C++. -// -// -// Since a numeric_limits<> is a bit tricky to get right, we rely on -// an interface composed of macros which should be defined in config/os -// or config/cpu when they differ from the generic (read arbitrary) -// definitions given here. -// - -// These values can be overridden in the target configuration file. -// The default values are appropriate for many 32-bit targets. - -// GCC only intrinsicly supports modulo integral types. The only remaining -// integral exceptional values is division by zero. Only targets that do not -// signal division by zero in some "hard to ignore" way should use false. -#ifndef __glibcxx_integral_traps -# define __glibcxx_integral_traps true -#endif - -// float -// - -// Default values. Should be overriden in configuration files if necessary. - -#ifndef __glibcxx_float_has_denorm_loss -# define __glibcxx_float_has_denorm_loss false -#endif -#ifndef __glibcxx_float_traps -# define __glibcxx_float_traps false -#endif -#ifndef __glibcxx_float_tinyness_before -# define __glibcxx_float_tinyness_before false -#endif - -// double - -// Default values. Should be overriden in configuration files if necessary. - -#ifndef __glibcxx_double_has_denorm_loss -# define __glibcxx_double_has_denorm_loss false -#endif -#ifndef __glibcxx_double_traps -# define __glibcxx_double_traps false -#endif -#ifndef __glibcxx_double_tinyness_before -# define __glibcxx_double_tinyness_before false -#endif - -// long double - -// Default values. Should be overriden in configuration files if necessary. - -#ifndef __glibcxx_long_double_has_denorm_loss -# define __glibcxx_long_double_has_denorm_loss false -#endif -#ifndef __glibcxx_long_double_traps -# define __glibcxx_long_double_traps false -#endif -#ifndef __glibcxx_long_double_tinyness_before -# define __glibcxx_long_double_tinyness_before false -#endif - -// You should not need to define any macros below this point. - -#define __glibcxx_signed(T) ((T)(-1) < 0) - -#define __glibcxx_min(T) \ - (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0) - -#define __glibcxx_max(T) \ - (__glibcxx_signed (T) ? ((T)1 << __glibcxx_digits (T)) - 1 : ~(T)0) - -#define __glibcxx_digits(T) \ - (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T)) - -// The fraction 643/2136 approximates log10(2) to 7 significant digits. -#define __glibcxx_digits10(T) \ - (__glibcxx_digits (T) * 643 / 2136) - - -namespace std -{ - /** - * @brief Describes the rounding style for floating-point types. - * - * This is used in the std::numeric_limits class. - */ - enum float_round_style - { - round_indeterminate = -1, ///< Self-explanatory. - round_toward_zero = 0, ///< Self-explanatory. - round_to_nearest = 1, ///< To the nearest representable value. - round_toward_infinity = 2, ///< Self-explanatory. - round_toward_neg_infinity = 3 ///< Self-explanatory. - }; - - /** - * @brief Describes the denormalization for floating-point types. - * - * These values represent the presence or absence of a variable number - * of exponent bits. This type is used in the std::numeric_limits class. - */ - enum float_denorm_style - { - /// Indeterminate at compile time whether denormalized values are allowed. - denorm_indeterminate = -1, - /// The type does not allow denormalized values. - denorm_absent = 0, - /// The type allows denormalized values. - denorm_present = 1 - }; - - /** - * @brief Part of std::numeric_limits. - * - * The @c static @c const members are usable as integral constant - * expressions. - * - * @note This is a seperate class for purposes of efficiency; you - * should only access these members as part of an instantiation - * of the std::numeric_limits class. - */ - struct __numeric_limits_base - { - /** This will be true for all fundamental types (which have - specializations), and false for everything else. */ - static const bool is_specialized = false; - - /** The number of @c radix digits that be represented without change: for - integer types, the number of non-sign bits in the mantissa; for - floating types, the number of @c radix digits in the mantissa. */ - static const int digits = 0; - /** The number of base 10 digits that can be represented without change. */ - static const int digits10 = 0; - /** True if the type is signed. */ - static const bool is_signed = false; - /** True if the type is integer. - * @if maint - * Is this supposed to be "if the type is integral"? - * @endif - */ - static const bool is_integer = false; - /** True if the type uses an exact representation. "All integer types are - exact, but not all exact types are integer. For example, rational and - fixed-exponent representations are exact but not integer." - [18.2.1.2]/15 */ - static const bool is_exact = false; - /** For integer types, specifies the base of the representation. For - floating types, specifies the base of the exponent representation. */ - static const int radix = 0; - - /** The minimum negative integer such that @c radix raised to the power of - (one less than that integer) is a normalized floating point number. */ - static const int min_exponent = 0; - /** The minimum negative integer such that 10 raised to that power is in - the range of normalized floating point numbers. */ - static const int min_exponent10 = 0; - /** The maximum positive integer such that @c radix raised to the power of - (one less than that integer) is a representable finite floating point - number. */ - static const int max_exponent = 0; - /** The maximum positive integer such that 10 raised to that power is in - the range of representable finite floating point numbers. */ - static const int max_exponent10 = 0; - - /** True if the type has a representation for positive infinity. */ - static const bool has_infinity = false; - /** True if the type has a representation for a quiet (non-signaling) - "Not a Number." */ - static const bool has_quiet_NaN = false; - /** True if the type has a representation for a signaling - "Not a Number." */ - static const bool has_signaling_NaN = false; - /** See std::float_denorm_style for more information. */ - static const float_denorm_style has_denorm = denorm_absent; - /** "True if loss of accuracy is detected as a denormalization loss, - rather than as an inexact result." [18.2.1.2]/42 */ - static const bool has_denorm_loss = false; - - /** True if-and-only-if the type adheres to the IEC 559 standard, also - known as IEEE 754. (Only makes sense for floating point types.) */ - static const bool is_iec559 = false; - /** "True if the set of values representable by the type is finite. All - built-in types are bounded, this member would be false for arbitrary - precision types." [18.2.1.2]/54 */ - static const bool is_bounded = false; - /** True if the type is @e modulo, that is, if it is possible to add two - positive numbers and have a result that wraps around to a third number - that is less. Typically false for floating types, true for unsigned - integers, and true for signed integers. */ - static const bool is_modulo = false; - - /** True if trapping is implemented for this type. */ - static const bool traps = false; - /** True if tinyness is detected before rounding. (see IEC 559) */ - static const bool tinyness_before = false; - /** See std::float_round_style for more information. This is only - meaningful for floating types; integer types will all be - round_toward_zero. */ - static const float_round_style round_style = round_toward_zero; - }; - - /** - * @brief Properties of fundamental types. - * - * This class allows a program to obtain information about the - * representation of a fundamental type on a given platform. For - * non-fundamental types, the functions will return 0 and the data - * members will all be @c false. - * - * @if maint - * _GLIBCXX_RESOLVE_LIB_DEFECTS: DRs 201 and 184 (hi Gaby!) are - * noted, but not incorporated in this documented (yet). - * @endif - */ - template<typename _Tp> - struct numeric_limits : public __numeric_limits_base - { - /** The minimum finite value, or for floating types with - denormalization, the minimum positive normalized value. */ - static _Tp min() throw() { return static_cast<_Tp>(0); } - /** The maximum finite value. */ - static _Tp max() throw() { return static_cast<_Tp>(0); } - /** The @e machine @e epsilon: the difference between 1 and the least - value greater than 1 that is representable. */ - static _Tp epsilon() throw() { return static_cast<_Tp>(0); } - /** The maximum rounding error measurement (see LIA-1). */ - static _Tp round_error() throw() { return static_cast<_Tp>(0); } - /** The representation of positive infinity, if @c has_infinity. */ - static _Tp infinity() throw() { return static_cast<_Tp>(0); } - /** The representation of a quiet "Not a Number," if @c has_quiet_NaN. */ - static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); } - /** The representation of a signaling "Not a Number," if - @c has_signaling_NaN. */ - static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); } - /** The minimum positive denormalized value. For types where - @c has_denorm is false, this is the minimum positive normalized - value. */ - static _Tp denorm_min() throw() { return static_cast<_Tp>(0); } - }; - - // Now there follow 15 explicit specializations. Yes, 15. Make sure - // you get the count right. - template<> - struct numeric_limits<bool> - { - static const bool is_specialized = true; - - static bool min() throw() - { return false; } - static bool max() throw() - { return true; } - - static const int digits = 1; - static const int digits10 = 0; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static bool epsilon() throw() - { return false; } - static bool round_error() throw() - { return false; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static bool infinity() throw() - { return false; } - static bool quiet_NaN() throw() - { return false; } - static bool signaling_NaN() throw() - { return false; } - static bool denorm_min() throw() - { return false; } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = false; - - // It is not clear what it means for a boolean type to trap. - // This is a DR on the LWG issue list. Here, I use integer - // promotion semantics. - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<char> - { - static const bool is_specialized = true; - - static char min() throw() - { return __glibcxx_min(char); } - static char max() throw() - { return __glibcxx_max(char); } - - static const int digits = __glibcxx_digits (char); - static const int digits10 = __glibcxx_digits10 (char); - static const bool is_signed = __glibcxx_signed (char); - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static char epsilon() throw() - { return 0; } - static char round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static char infinity() throw() - { return char(); } - static char quiet_NaN() throw() - { return char(); } - static char signaling_NaN() throw() - { return char(); } - static char denorm_min() throw() - { return static_cast<char>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<signed char> - { - static const bool is_specialized = true; - - static signed char min() throw() - { return -__SCHAR_MAX__ - 1; } - static signed char max() throw() - { return __SCHAR_MAX__; } - - static const int digits = __glibcxx_digits (signed char); - static const int digits10 = __glibcxx_digits10 (signed char); - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static signed char epsilon() throw() - { return 0; } - static signed char round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static signed char infinity() throw() - { return static_cast<signed char>(0); } - static signed char quiet_NaN() throw() - { return static_cast<signed char>(0); } - static signed char signaling_NaN() throw() - { return static_cast<signed char>(0); } - static signed char denorm_min() throw() - { return static_cast<signed char>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<unsigned char> - { - static const bool is_specialized = true; - - static unsigned char min() throw() - { return 0; } - static unsigned char max() throw() - { return __SCHAR_MAX__ * 2U + 1; } - - static const int digits = __glibcxx_digits (unsigned char); - static const int digits10 = __glibcxx_digits10 (unsigned char); - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned char epsilon() throw() - { return 0; } - static unsigned char round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned char infinity() throw() - { return static_cast<unsigned char>(0); } - static unsigned char quiet_NaN() throw() - { return static_cast<unsigned char>(0); } - static unsigned char signaling_NaN() throw() - { return static_cast<unsigned char>(0); } - static unsigned char denorm_min() throw() - { return static_cast<unsigned char>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<wchar_t> - { - static const bool is_specialized = true; - - static wchar_t min() throw() - { return __glibcxx_min (wchar_t); } - static wchar_t max() throw() - { return __glibcxx_max (wchar_t); } - - static const int digits = __glibcxx_digits (wchar_t); - static const int digits10 = __glibcxx_digits10 (wchar_t); - static const bool is_signed = __glibcxx_signed (wchar_t); - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static wchar_t epsilon() throw() - { return 0; } - static wchar_t round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static wchar_t infinity() throw() - { return wchar_t(); } - static wchar_t quiet_NaN() throw() - { return wchar_t(); } - static wchar_t signaling_NaN() throw() - { return wchar_t(); } - static wchar_t denorm_min() throw() - { return wchar_t(); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<short> - { - static const bool is_specialized = true; - - static short min() throw() - { return -__SHRT_MAX__ - 1; } - static short max() throw() - { return __SHRT_MAX__; } - - static const int digits = __glibcxx_digits (short); - static const int digits10 = __glibcxx_digits10 (short); - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static short epsilon() throw() - { return 0; } - static short round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static short infinity() throw() - { return short(); } - static short quiet_NaN() throw() - { return short(); } - static short signaling_NaN() throw() - { return short(); } - static short denorm_min() throw() - { return short(); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<unsigned short> - { - static const bool is_specialized = true; - - static unsigned short min() throw() - { return 0; } - static unsigned short max() throw() - { return __SHRT_MAX__ * 2U + 1; } - - static const int digits = __glibcxx_digits (unsigned short); - static const int digits10 = __glibcxx_digits10 (unsigned short); - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned short epsilon() throw() - { return 0; } - static unsigned short round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned short infinity() throw() - { return static_cast<unsigned short>(0); } - static unsigned short quiet_NaN() throw() - { return static_cast<unsigned short>(0); } - static unsigned short signaling_NaN() throw() - { return static_cast<unsigned short>(0); } - static unsigned short denorm_min() throw() - { return static_cast<unsigned short>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<int> - { - static const bool is_specialized = true; - - static int min() throw() - { return -__INT_MAX__ - 1; } - static int max() throw() - { return __INT_MAX__; } - - static const int digits = __glibcxx_digits (int); - static const int digits10 = __glibcxx_digits10 (int); - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static int epsilon() throw() - { return 0; } - static int round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static int infinity() throw() - { return static_cast<int>(0); } - static int quiet_NaN() throw() - { return static_cast<int>(0); } - static int signaling_NaN() throw() - { return static_cast<int>(0); } - static int denorm_min() throw() - { return static_cast<int>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<unsigned int> - { - static const bool is_specialized = true; - - static unsigned int min() throw() - { return 0; } - static unsigned int max() throw() - { return __INT_MAX__ * 2U + 1; } - - static const int digits = __glibcxx_digits (unsigned int); - static const int digits10 = __glibcxx_digits10 (unsigned int); - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned int epsilon() throw() - { return 0; } - static unsigned int round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned int infinity() throw() - { return static_cast<unsigned int>(0); } - static unsigned int quiet_NaN() throw() - { return static_cast<unsigned int>(0); } - static unsigned int signaling_NaN() throw() - { return static_cast<unsigned int>(0); } - static unsigned int denorm_min() throw() - { return static_cast<unsigned int>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<long> - { - static const bool is_specialized = true; - - static long min() throw() - { return -__LONG_MAX__ - 1; } - static long max() throw() - { return __LONG_MAX__; } - - static const int digits = __glibcxx_digits (long); - static const int digits10 = __glibcxx_digits10 (long); - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static long epsilon() throw() - { return 0; } - static long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static long infinity() throw() - { return static_cast<long>(0); } - static long quiet_NaN() throw() - { return static_cast<long>(0); } - static long signaling_NaN() throw() - { return static_cast<long>(0); } - static long denorm_min() throw() - { return static_cast<long>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<unsigned long> - { - static const bool is_specialized = true; - - static unsigned long min() throw() - { return 0; } - static unsigned long max() throw() - { return __LONG_MAX__ * 2UL + 1; } - - static const int digits = __glibcxx_digits (unsigned long); - static const int digits10 = __glibcxx_digits10 (unsigned long); - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned long epsilon() throw() - { return 0; } - static unsigned long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned long infinity() throw() - { return static_cast<unsigned long>(0); } - static unsigned long quiet_NaN() throw() - { return static_cast<unsigned long>(0); } - static unsigned long signaling_NaN() throw() - { return static_cast<unsigned long>(0); } - static unsigned long denorm_min() throw() - { return static_cast<unsigned long>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<long long> - { - static const bool is_specialized = true; - - static long long min() throw() - { return -__LONG_LONG_MAX__ - 1; } - static long long max() throw() - { return __LONG_LONG_MAX__; } - - static const int digits = __glibcxx_digits (long long); - static const int digits10 = __glibcxx_digits10 (long long); - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static long long epsilon() throw() - { return 0; } - static long long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static long long infinity() throw() - { return static_cast<long long>(0); } - static long long quiet_NaN() throw() - { return static_cast<long long>(0); } - static long long signaling_NaN() throw() - { return static_cast<long long>(0); } - static long long denorm_min() throw() - { return static_cast<long long>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<unsigned long long> - { - static const bool is_specialized = true; - - static unsigned long long min() throw() - { return 0; } - static unsigned long long max() throw() - { return __LONG_LONG_MAX__ * 2ULL + 1; } - - static const int digits = __glibcxx_digits (unsigned long long); - static const int digits10 = __glibcxx_digits10 (unsigned long long); - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned long long epsilon() throw() - { return 0; } - static unsigned long long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned long long infinity() throw() - { return static_cast<unsigned long long>(0); } - static unsigned long long quiet_NaN() throw() - { return static_cast<unsigned long long>(0); } - static unsigned long long signaling_NaN() throw() - { return static_cast<unsigned long long>(0); } - static unsigned long long denorm_min() throw() - { return static_cast<unsigned long long>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcxx_integral_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<> - struct numeric_limits<float> - { - static const bool is_specialized = true; - - static float min() throw() - { return __FLT_MIN__; } - static float max() throw() - { return __FLT_MAX__; } - - static const int digits = __FLT_MANT_DIG__; - static const int digits10 = __FLT_DIG__; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const int radix = __FLT_RADIX__; - static float epsilon() throw() - { return __FLT_EPSILON__; } - static float round_error() throw() - { return 0.5F; } - - static const int min_exponent = __FLT_MIN_EXP__; - static const int min_exponent10 = __FLT_MIN_10_EXP__; - static const int max_exponent = __FLT_MAX_EXP__; - static const int max_exponent10 = __FLT_MAX_10_EXP__; - - static const bool has_infinity = __FLT_HAS_INFINITY__; - static const bool has_quiet_NaN = __FLT_HAS_QUIET_NAN__; - static const bool has_signaling_NaN = has_quiet_NaN; - static const float_denorm_style has_denorm - = __FLT_DENORM_MIN__ ? denorm_present : denorm_absent; - static const bool has_denorm_loss = __glibcxx_float_has_denorm_loss; - - static float infinity() throw() - { return __builtin_huge_valf (); } - static float quiet_NaN() throw() - { return __builtin_nanf (""); } - static float signaling_NaN() throw() - { return __builtin_nansf (""); } - static float denorm_min() throw() - { return __FLT_DENORM_MIN__; } - - static const bool is_iec559 - = has_infinity && has_quiet_NaN && has_denorm == denorm_present; - static const bool is_bounded = true; - static const bool is_modulo = false; - - static const bool traps = __glibcxx_float_traps; - static const bool tinyness_before = __glibcxx_float_tinyness_before; - static const float_round_style round_style = round_to_nearest; - }; - -#undef __glibcxx_float_has_denorm_loss -#undef __glibcxx_float_traps -#undef __glibcxx_float_tinyness_before - - template<> - struct numeric_limits<double> - { - static const bool is_specialized = true; - - static double min() throw() - { return __DBL_MIN__; } - static double max() throw() - { return __DBL_MAX__; } - - static const int digits = __DBL_MANT_DIG__; - static const int digits10 = __DBL_DIG__; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const int radix = __FLT_RADIX__; - static double epsilon() throw() - { return __DBL_EPSILON__; } - static double round_error() throw() - { return 0.5; } - - static const int min_exponent = __DBL_MIN_EXP__; - static const int min_exponent10 = __DBL_MIN_10_EXP__; - static const int max_exponent = __DBL_MAX_EXP__; - static const int max_exponent10 = __DBL_MAX_10_EXP__; - - static const bool has_infinity = __DBL_HAS_INFINITY__; - static const bool has_quiet_NaN = __DBL_HAS_QUIET_NAN__; - static const bool has_signaling_NaN = has_quiet_NaN; - static const float_denorm_style has_denorm - = __DBL_DENORM_MIN__ ? denorm_present : denorm_absent; - static const bool has_denorm_loss = __glibcxx_double_has_denorm_loss; - - static double infinity() throw() - { return __builtin_huge_val(); } - static double quiet_NaN() throw() - { return __builtin_nan (""); } - static double signaling_NaN() throw() - { return __builtin_nans (""); } - static double denorm_min() throw() - { return __DBL_DENORM_MIN__; } - - static const bool is_iec559 - = has_infinity && has_quiet_NaN && has_denorm == denorm_present; - static const bool is_bounded = true; - static const bool is_modulo = false; - - static const bool traps = __glibcxx_double_traps; - static const bool tinyness_before = __glibcxx_double_tinyness_before; - static const float_round_style round_style = round_to_nearest; - }; - -#undef __glibcxx_double_has_denorm_loss -#undef __glibcxx_double_traps -#undef __glibcxx_double_tinyness_before - - template<> - struct numeric_limits<long double> - { - static const bool is_specialized = true; - - static long double min() throw() - { return __LDBL_MIN__; } - static long double max() throw() - { return __LDBL_MAX__; } - - static const int digits = __LDBL_MANT_DIG__; - static const int digits10 = __LDBL_DIG__; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const int radix = __FLT_RADIX__; - static long double epsilon() throw() - { return __LDBL_EPSILON__; } - static long double round_error() throw() - { return 0.5L; } - - static const int min_exponent = __LDBL_MIN_EXP__; - static const int min_exponent10 = __LDBL_MIN_10_EXP__; - static const int max_exponent = __LDBL_MAX_EXP__; - static const int max_exponent10 = __LDBL_MAX_10_EXP__; - - static const bool has_infinity = __LDBL_HAS_INFINITY__; - static const bool has_quiet_NaN = __LDBL_HAS_QUIET_NAN__; - static const bool has_signaling_NaN = has_quiet_NaN; - static const float_denorm_style has_denorm - = __LDBL_DENORM_MIN__ ? denorm_present : denorm_absent; - static const bool has_denorm_loss - = __glibcxx_long_double_has_denorm_loss; - - static long double infinity() throw() - { return __builtin_huge_vall (); } - static long double quiet_NaN() throw() - { return __builtin_nanl (""); } - static long double signaling_NaN() throw() - { return __builtin_nansl (""); } - static long double denorm_min() throw() - { return __LDBL_DENORM_MIN__; } - - static const bool is_iec559 - = has_infinity && has_quiet_NaN && has_denorm == denorm_present; - static const bool is_bounded = true; - static const bool is_modulo = false; - - static const bool traps = __glibcxx_long_double_traps; - static const bool tinyness_before = __glibcxx_long_double_tinyness_before; - static const float_round_style round_style = round_to_nearest; - }; - -#undef __glibcxx_long_double_has_denorm_loss -#undef __glibcxx_long_double_traps -#undef __glibcxx_long_double_tinyness_before - -} // namespace std - -#undef __glibcxx_signed -#undef __glibcxx_min -#undef __glibcxx_max -#undef __glibcxx_digits -#undef __glibcxx_digits10 - -#endif // _GLIBCXX_NUMERIC_LIMITS diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/list b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/list deleted file mode 100644 index 285a29d8131..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/list +++ /dev/null @@ -1,82 +0,0 @@ -// <list> -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file list - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_LIST -#define _GLIBCXX_LIST 1 - -#pragma GCC system_header - -#include <bits/functexcept.h> -#include <bits/stl_algobase.h> -#include <bits/allocator.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_list.h> - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/list.tcc> -#endif - -#ifdef _GLIBCXX_DEBUG -# include <debug/list> -#endif - -#endif /* _GLIBCXX_LIST */ - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/locale b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/locale deleted file mode 100644 index 43417fbdddc..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/locale +++ /dev/null @@ -1,49 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.1 Locales -// - -/** @file locale - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_LOCALE -#define _GLIBCXX_LOCALE 1 - -#pragma GCC system_header - -#include <bits/localefwd.h> -#include <bits/locale_classes.h> -#include <bits/locale_facets.h> -#include <bits/locale_facets.tcc> - -#endif /* _GLIBCXX_LOCALE */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/map b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/map deleted file mode 100644 index 4a88ae22ea3..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/map +++ /dev/null @@ -1,74 +0,0 @@ -// <map> -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file map - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_MAP -#define _GLIBCXX_MAP 1 - -#pragma GCC system_header - -#include <bits/stl_tree.h> -#include <bits/stl_map.h> -#include <bits/stl_multimap.h> - -#ifdef _GLIBCXX_DEBUG -# include <debug/map> -#endif - -#endif /* _GLIBCXX_MAP */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/memory b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/memory deleted file mode 100644 index 1d278e6cb86..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/memory +++ /dev/null @@ -1,375 +0,0 @@ -// <memory> -*- C++ -*- - -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1997-1999 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -/** @file memory - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_MEMORY -#define _GLIBCXX_MEMORY 1 - -#pragma GCC system_header - -#include <bits/stl_algobase.h> -#include <bits/allocator.h> -#include <bits/stl_construct.h> -#include <bits/stl_iterator_base_types.h> //for iterator_traits -#include <bits/stl_uninitialized.h> -#include <bits/stl_raw_storage_iter.h> -#include <debug/debug.h> -#include <limits> - -namespace std -{ - /** - * @if maint - * This is a helper function. The unused second parameter exists to - * permit the real get_temporary_buffer to use template parameter deduction. - * - * XXX This should perhaps use the pool. - * @endif - */ - template<typename _Tp> - pair<_Tp*, ptrdiff_t> - __get_temporary_buffer(ptrdiff_t __len, _Tp*) - { - const ptrdiff_t __max = numeric_limits<ptrdiff_t>::max() / sizeof(_Tp); - if (__len > __max) - __len = __max; - - while (__len > 0) - { - _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp), - nothrow)); - if (__tmp != 0) - return pair<_Tp*, ptrdiff_t>(__tmp, __len); - __len /= 2; - } - return pair<_Tp*, ptrdiff_t>(static_cast<_Tp*>(0), 0); - } - - /** - * @brief Allocates a temporary buffer. - * @param len The number of objects of type Tp. - * @return See full description. - * - * Reinventing the wheel, but this time with prettier spokes! - * - * This function tries to obtain storage for @c len adjacent Tp - * objects. The objects themselves are not constructed, of course. - * A pair<> is returned containing "the buffer s address and - * capacity (in the units of sizeof(Tp)), or a pair of 0 values if - * no storage can be obtained." Note that the capacity obtained - * may be less than that requested if the memory is unavailable; - * you should compare len with the .second return value. - * - * Provides the nothrow exception guarantee. - */ - template<typename _Tp> - inline pair<_Tp*, ptrdiff_t> - get_temporary_buffer(ptrdiff_t __len) - { return std::__get_temporary_buffer(__len, static_cast<_Tp*>(0)); } - - /** - * @brief The companion to get_temporary_buffer(). - * @param p A buffer previously allocated by get_temporary_buffer. - * @return None. - * - * Frees the memory pointed to by p. - */ - template<typename _Tp> - void - return_temporary_buffer(_Tp* __p) - { ::operator delete(__p, nothrow); } - - /** - * A wrapper class to provide auto_ptr with reference semantics. - * For example, an auto_ptr can be assigned (or constructed from) - * the result of a function which returns an auto_ptr by value. - * - * All the auto_ptr_ref stuff should happen behind the scenes. - */ - template<typename _Tp1> - struct auto_ptr_ref - { - _Tp1* _M_ptr; - - explicit - auto_ptr_ref(_Tp1* __p): _M_ptr(__p) { } - }; - - - /** - * @brief A simple smart pointer providing strict ownership semantics. - * - * The Standard says: - * <pre> - * An @c auto_ptr owns the object it holds a pointer to. Copying - * an @c auto_ptr copies the pointer and transfers ownership to the - * destination. If more than one @c auto_ptr owns the same object - * at the same time the behavior of the program is undefined. - * - * The uses of @c auto_ptr include providing temporary - * exception-safety for dynamically allocated memory, passing - * ownership of dynamically allocated memory to a function, and - * returning dynamically allocated memory from a function. @c - * auto_ptr does not meet the CopyConstructible and Assignable - * requirements for Standard Library <a - * href="tables.html#65">container</a> elements and thus - * instantiating a Standard Library container with an @c auto_ptr - * results in undefined behavior. - * </pre> - * Quoted from [20.4.5]/3. - * - * Good examples of what can and cannot be done with auto_ptr can - * be found in the libstdc++ testsuite. - * - * @if maint - * _GLIBCXX_RESOLVE_LIB_DEFECTS - * 127. auto_ptr<> conversion issues - * These resolutions have all been incorporated. - * @endif - */ - template<typename _Tp> - class auto_ptr - { - private: - _Tp* _M_ptr; - - public: - /// The pointed-to type. - typedef _Tp element_type; - - /** - * @brief An %auto_ptr is usually constructed from a raw pointer. - * @param p A pointer (defaults to NULL). - * - * This object now @e owns the object pointed to by @a p. - */ - explicit - auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { } - - /** - * @brief An %auto_ptr can be constructed from another %auto_ptr. - * @param a Another %auto_ptr of the same type. - * - * This object now @e owns the object previously owned by @a a, - * which has given up ownsership. - */ - auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { } - - /** - * @brief An %auto_ptr can be constructed from another %auto_ptr. - * @param a Another %auto_ptr of a different but related type. - * - * A pointer-to-Tp1 must be convertible to a - * pointer-to-Tp/element_type. - * - * This object now @e owns the object previously owned by @a a, - * which has given up ownsership. - */ - template<typename _Tp1> - auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { } - - /** - * @brief %auto_ptr assignment operator. - * @param a Another %auto_ptr of the same type. - * - * This object now @e owns the object previously owned by @a a, - * which has given up ownsership. The object that this one @e - * used to own and track has been deleted. - */ - auto_ptr& - operator=(auto_ptr& __a) throw() - { - reset(__a.release()); - return *this; - } - - /** - * @brief %auto_ptr assignment operator. - * @param a Another %auto_ptr of a different but related type. - * - * A pointer-to-Tp1 must be convertible to a pointer-to-Tp/element_type. - * - * This object now @e owns the object previously owned by @a a, - * which has given up ownsership. The object that this one @e - * used to own and track has been deleted. - */ - template<typename _Tp1> - auto_ptr& - operator=(auto_ptr<_Tp1>& __a) throw() - { - reset(__a.release()); - return *this; - } - - /** - * When the %auto_ptr goes out of scope, the object it owns is - * deleted. If it no longer owns anything (i.e., @c get() is - * @c NULL), then this has no effect. - * - * @if maint - * The C++ standard says there is supposed to be an empty throw - * specification here, but omitting it is standard conforming. Its - * presence can be detected only if _Tp::~_Tp() throws, but this is - * prohibited. [17.4.3.6]/2 - * @end maint - */ - ~auto_ptr() { delete _M_ptr; } - - /** - * @brief Smart pointer dereferencing. - * - * If this %auto_ptr no longer owns anything, then this - * operation will crash. (For a smart pointer, "no longer owns - * anything" is the same as being a null pointer, and you know - * what happens when you dereference one of those...) - */ - element_type& - operator*() const throw() - { - _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0); - return *_M_ptr; - } - - /** - * @brief Smart pointer dereferencing. - * - * This returns the pointer itself, which the language then will - * automatically cause to be dereferenced. - */ - element_type* - operator->() const throw() - { - _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0); - return _M_ptr; - } - - /** - * @brief Bypassing the smart pointer. - * @return The raw pointer being managed. - * - * You can get a copy of the pointer that this object owns, for - * situations such as passing to a function which only accepts - * a raw pointer. - * - * @note This %auto_ptr still owns the memory. - */ - element_type* - get() const throw() { return _M_ptr; } - - /** - * @brief Bypassing the smart pointer. - * @return The raw pointer being managed. - * - * You can get a copy of the pointer that this object owns, for - * situations such as passing to a function which only accepts - * a raw pointer. - * - * @note This %auto_ptr no longer owns the memory. When this object - * goes out of scope, nothing will happen. - */ - element_type* - release() throw() - { - element_type* __tmp = _M_ptr; - _M_ptr = 0; - return __tmp; - } - - /** - * @brief Forcibly deletes the managed object. - * @param p A pointer (defaults to NULL). - * - * This object now @e owns the object pointed to by @a p. The - * previous object has been deleted. - */ - void - reset(element_type* __p = 0) throw() - { - if (__p != _M_ptr) - { - delete _M_ptr; - _M_ptr = __p; - } - } - - /** @{ - * @brief Automatic conversions - * - * These operations convert an %auto_ptr into and from an auto_ptr_ref - * automatically as needed. This allows constructs such as - * @code - * auto_ptr<Derived> func_returning_auto_ptr(.....); - * ... - * auto_ptr<Base> ptr = func_returning_auto_ptr(.....); - * @endcode - */ - auto_ptr(auto_ptr_ref<element_type> __ref) throw() - : _M_ptr(__ref._M_ptr) { } - - auto_ptr& - operator=(auto_ptr_ref<element_type> __ref) throw() - { - if (__ref._M_ptr != this->get()) - { - delete _M_ptr; - _M_ptr = __ref._M_ptr; - } - return *this; - } - - template<typename _Tp1> - operator auto_ptr_ref<_Tp1>() throw() - { return auto_ptr_ref<_Tp1>(this->release()); } - - template<typename _Tp1> - operator auto_ptr<_Tp1>() throw() - { return auto_ptr<_Tp1>(this->release()); } - /** @} */ - }; -} // namespace std - -#endif /* _GLIBCXX_MEMORY */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/new b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/new deleted file mode 100644 index 00e99464b90..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/new +++ /dev/null @@ -1,101 +0,0 @@ -// The -*- C++ -*- dynamic memory management header. - -// Copyright (C) 1994, 1996, 1997, 1998, 2000, 2001, 2002 -// Free Software Foundation - -// This file is part of GCC. -// -// GCC is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2, or (at your option) -// any later version. -// -// GCC is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GCC; see the file COPYING. If not, write to -// the Free Software Foundation, 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file new - * The header @c new defines several functions to manage dynamic memory and - * handling memory allocation errors; see - * http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#4 for more. - */ - -#ifndef _NEW -#define _NEW - -#include <cstddef> -#include <exception> - -extern "C++" { - -namespace std -{ - /** - * @brief Exception possibly thrown by @c new. - * - * @c bad_alloc (or classes derived from it) is used to report allocation - * errors from the throwing forms of @c new. */ - class bad_alloc : public exception - { - public: - bad_alloc() throw() { } - // This declaration is not useless: - // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - virtual ~bad_alloc() throw(); - }; - - struct nothrow_t { }; - extern const nothrow_t nothrow; - /** If you write your own error handler to be called by @c new, it must - * be of this type. */ - typedef void (*new_handler)(); - /// Takes a replacement handler as the argument, returns the previous handler. - new_handler set_new_handler(new_handler) throw(); -} // namespace std - -//@{ -/** These are replaceable signatures: - * - normal single new and delete (no arguments, throw @c bad_alloc on error) - * - normal array new and delete (same) - * - @c nothrow single new and delete (take a @c nothrow argument, return - * @c NULL on error) - * - @c nothrow array new and delete (same) - * - * Placement new and delete signatures (take a memory address argument, - * does nothing) may not be replaced by a user's program. -*/ -void* operator new(std::size_t) throw (std::bad_alloc); -void* operator new[](std::size_t) throw (std::bad_alloc); -void operator delete(void*) throw(); -void operator delete[](void*) throw(); -void* operator new(std::size_t, const std::nothrow_t&) throw(); -void* operator new[](std::size_t, const std::nothrow_t&) throw(); -void operator delete(void*, const std::nothrow_t&) throw(); -void operator delete[](void*, const std::nothrow_t&) throw(); - -// Default placement versions of operator new. -inline void* operator new(std::size_t, void* __p) throw() { return __p; } -inline void* operator new[](std::size_t, void* __p) throw() { return __p; } - -// Default placement versions of operator delete. -inline void operator delete (void*, void*) throw() { } -inline void operator delete[](void*, void*) throw() { } -//@} -} // extern "C++" - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/numeric b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/numeric deleted file mode 100644 index 88661e9f5a4..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/numeric +++ /dev/null @@ -1,72 +0,0 @@ -// <numeric> -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file numeric - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_NUMERIC -#define _GLIBCXX_NUMERIC 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <cstddef> -#include <iterator> -#include <bits/stl_function.h> -#include <bits/stl_numeric.h> - -#endif /* _GLIBCXX_NUMERIC */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream deleted file mode 100644 index e3590f23515..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream +++ /dev/null @@ -1,548 +0,0 @@ -// Output streams -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.6.2 Output streams -// - -/** @file ostream - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_OSTREAM -#define _GLIBCXX_OSTREAM 1 - -#pragma GCC system_header - -#include <ios> - -namespace std -{ - // [27.6.2.1] Template class basic_ostream - /** - * @brief Controlling output. - * - * This is the base class for all output streams. It provides text - * formatting of all builtin types, and communicates with any class - * derived from basic_streambuf to do the actual output. - */ - template<typename _CharT, typename _Traits> - class basic_ostream : virtual public basic_ios<_CharT, _Traits> - { - public: - // Types (inherited from basic_ios (27.4.4)): - typedef _CharT char_type; - typedef typename _Traits::int_type int_type; - typedef typename _Traits::pos_type pos_type; - typedef typename _Traits::off_type off_type; - typedef _Traits traits_type; - - // Non-standard Types: - typedef basic_streambuf<_CharT, _Traits> __streambuf_type; - typedef basic_ios<_CharT, _Traits> __ios_type; - typedef basic_ostream<_CharT, _Traits> __ostream_type; - typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > - __num_put_type; - typedef ctype<_CharT> __ctype_type; - - template<typename _CharT2, typename _Traits2> - friend basic_ostream<_CharT2, _Traits2>& - operator<<(basic_ostream<_CharT2, _Traits2>&, _CharT2); - - template<typename _Traits2> - friend basic_ostream<char, _Traits2>& - operator<<(basic_ostream<char, _Traits2>&, char); - - template<typename _CharT2, typename _Traits2> - friend basic_ostream<_CharT2, _Traits2>& - operator<<(basic_ostream<_CharT2, _Traits2>&, const _CharT2*); - - template<typename _Traits2> - friend basic_ostream<char, _Traits2>& - operator<<(basic_ostream<char, _Traits2>&, const char*); - - template<typename _CharT2, typename _Traits2> - friend basic_ostream<_CharT2, _Traits2>& - operator<<(basic_ostream<_CharT2, _Traits2>&, const char*); - - // [27.6.2.2] constructor/destructor - /** - * @brief Base constructor. - * - * This ctor is almost never called by the user directly, rather from - * derived classes' initialization lists, which pass a pointer to - * their own stream buffer. - */ - explicit - basic_ostream(__streambuf_type* __sb) - { this->init(__sb); } - - /** - * @brief Base destructor. - * - * This does very little apart from providing a virtual base dtor. - */ - virtual - ~basic_ostream() { } - - // [27.6.2.3] prefix/suffix - class sentry; - friend class sentry; - - // [27.6.2.5] formatted output - // [27.6.2.5.3] basic_ostream::operator<< - //@{ - /** - * @brief Interface for manipulators. - * - * Manuipulators such as @c std::endl and @c std::hex use these - * functions in constructs like "std::cout << std::endl". For more - * information, see the iomanip header. - */ - inline __ostream_type& - operator<<(__ostream_type& (*__pf)(__ostream_type&)); - - inline __ostream_type& - operator<<(__ios_type& (*__pf)(__ios_type&)); - - inline __ostream_type& - operator<<(ios_base& (*__pf) (ios_base&)); - //@} - - // [27.6.2.5.2] arithmetic inserters - /** - * @name Arithmetic Inserters - * - * All the @c operator<< functions (aka <em>formatted output - * functions</em>) have some common behavior. Each starts by - * constructing a temporary object of type std::basic_ostream::sentry. - * This can have several effects, concluding with the setting of a - * status flag; see the sentry documentation for more. - * - * If the sentry status is good, the function tries to generate - * whatever data is appropriate for the type of the argument. - * - * If an exception is thrown during insertion, ios_base::badbit - * will be turned on in the stream's error state without causing an - * ios_base::failure to be thrown. The original exception will then - * be rethrown. - */ - //@{ - /** - * @brief Basic arithmetic inserters - * @param A variable of builtin type. - * @return @c *this if successful - * - * These functions use the stream's current locale (specifically, the - * @c num_get facet) to perform numeric formatting. - */ - __ostream_type& - operator<<(long __n); - - __ostream_type& - operator<<(unsigned long __n); - - __ostream_type& - operator<<(bool __n); - - __ostream_type& - operator<<(short __n) - { - ios_base::fmtflags __fmt = this->flags() & ios_base::basefield; - if (__fmt & ios_base::oct || __fmt & ios_base::hex) - return this->operator<<(static_cast<unsigned long> - (static_cast<unsigned short>(__n))); - else - return this->operator<<(static_cast<long>(__n)); - } - - __ostream_type& - operator<<(unsigned short __n) - { return this->operator<<(static_cast<unsigned long>(__n)); } - - __ostream_type& - operator<<(int __n) - { - ios_base::fmtflags __fmt = this->flags() & ios_base::basefield; - if (__fmt & ios_base::oct || __fmt & ios_base::hex) - return this->operator<<(static_cast<unsigned long> - (static_cast<unsigned int>(__n))); - else - return this->operator<<(static_cast<long>(__n)); - } - - __ostream_type& - operator<<(unsigned int __n) - { return this->operator<<(static_cast<unsigned long>(__n)); } - -#ifdef _GLIBCXX_USE_LONG_LONG - __ostream_type& - operator<<(long long __n); - - __ostream_type& - operator<<(unsigned long long __n); -#endif - - __ostream_type& - operator<<(double __f); - - __ostream_type& - operator<<(float __f) - { return this->operator<<(static_cast<double>(__f)); } - - __ostream_type& - operator<<(long double __f); - - __ostream_type& - operator<<(const void* __p); - - /** - * @brief Extracting from another streambuf. - * @param sb A pointer to a streambuf - * - * This function behaves like one of the basic arithmetic extractors, - * in that it also constructs a sentry object and has the same error - * handling behavior. - * - * If @a sb is NULL, the stream will set failbit in its error state. - * - * Characters are extracted from @a sb and inserted into @c *this - * until one of the following occurs: - * - * - the input stream reaches end-of-file, - * - insertion into the output sequence fails (in this case, the - * character that would have been inserted is not extracted), or - * - an exception occurs while getting a character from @a sb, which - * sets failbit in the error state - * - * If the function inserts no characters, failbit is set. - */ - __ostream_type& - operator<<(__streambuf_type* __sb); - //@} - - // [27.6.2.6] unformatted output functions - /** - * @name Unformatted Output Functions - * - * All the unformatted output functions have some common behavior. - * Each starts by constructing a temporary object of type - * std::basic_ostream::sentry. This has several effects, concluding - * with the setting of a status flag; see the sentry documentation - * for more. - * - * If the sentry status is good, the function tries to generate - * whatever data is appropriate for the type of the argument. - * - * If an exception is thrown during insertion, ios_base::badbit - * will be turned on in the stream's error state. If badbit is on in - * the stream's exceptions mask, the exception will be rethrown - * without completing its actions. - */ - //@{ - /** - * @brief Simple insertion. - * @param c The character to insert. - * @return *this - * - * Tries to insert @a c. - * - * @note This function is not overloaded on signed char and - * unsigned char. - */ - __ostream_type& - put(char_type __c); - - // Core write functionality, without sentry. - void - _M_write(const char_type* __s, streamsize __n) - { - streamsize __put = this->rdbuf()->sputn(__s, __n); - if (__put != __n) - this->setstate(ios_base::badbit); - } - - /** - * @brief Character string insertion. - * @param s The array to insert. - * @param n Maximum number of characters to insert. - * @return *this - * - * Characters are copied from @a s and inserted into the stream until - * one of the following happens: - * - * - @a n characters are inserted - * - inserting into the output sequence fails (in this case, badbit - * will be set in the stream's error state) - * - * @note This function is not overloaded on signed char and - * unsigned char. - */ - __ostream_type& - write(const char_type* __s, streamsize __n); - //@} - - /** - * @brief Synchronizing the stream buffer. - * @return *this - * - * If @c rdbuf() is a null pointer, changes nothing. - * - * Otherwise, calls @c rdbuf()->pubsync(), and if that returns -1, - * sets badbit. - */ - __ostream_type& - flush(); - - // [27.6.2.4] seek members - /** - * @brief Getting the current write position. - * @return A file position object. - * - * If @c fail() is not false, returns @c pos_type(-1) to indicate - * failure. Otherwise returns @c rdbuf()->pubseekoff(0,cur,out). - */ - pos_type - tellp(); - - /** - * @brief Changing the current write position. - * @param pos A file position object. - * @return *this - * - * If @c fail() is not true, calls @c rdbuf()->pubseekpos(pos). If - * that function fails, sets failbit. - */ - __ostream_type& - seekp(pos_type); - - /** - * @brief Changing the current write position. - * @param off A file offset object. - * @param dir The direction in which to seek. - * @return *this - * - * If @c fail() is not true, calls @c rdbuf()->pubseekoff(off,dir). - * If that function fails, sets failbit. - */ - __ostream_type& - seekp(off_type, ios_base::seekdir); - - protected: - explicit - basic_ostream() { } - }; - - /** - * @brief Performs setup work for output streams. - * - * Objects of this class are created before all of the standard - * inserters are run. It is responsible for "exception-safe prefix and - * suffix operations." Additional actions may be added by the - * implementation, and we list them in - * http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/howto.html#5 - * under [27.6] notes. - */ - template <typename _CharT, typename _Traits> - class basic_ostream<_CharT, _Traits>::sentry - { - // Data Members: - bool _M_ok; - basic_ostream<_CharT,_Traits>& _M_os; - - public: - /** - * @brief The constructor performs preparatory work. - * @param os The output stream to guard. - * - * If the stream state is good (@a os.good() is true), then if the - * stream is tied to another output stream, @c is.tie()->flush() - * is called to synchronize the output sequences. - * - * If the stream state is still good, then the sentry state becomes - * true ("okay"). - */ - explicit - sentry(basic_ostream<_CharT,_Traits>& __os); - - /** - * @brief Possibly flushes the stream. - * - * If @c ios_base::unitbuf is set in @c os.flags(), and - * @c std::uncaught_exception() is true, the sentry destructor calls - * @c flush() on the output stream. - */ - ~sentry() - { - // XXX MT - if (_M_os.flags() & ios_base::unitbuf && !uncaught_exception()) - { - // Can't call flush directly or else will get into recursive lock. - if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1) - _M_os.setstate(ios_base::badbit); - } - } - - /** - * @brief Quick status checking. - * @return The sentry state. - * - * For ease of use, sentries may be converted to booleans. The - * return value is that of the sentry state (true == okay). - */ - operator bool() const - { return _M_ok; } - }; - - // [27.6.2.5.4] character insertion templates - //@{ - /** - * @brief Character inserters - * @param out An output stream. - * @param c A character. - * @return out - * - * Behaves like one of the formatted arithmetic inserters described in - * std::basic_ostream. After constructing a sentry object with good - * status, this function inserts a single character and any required - * padding (as determined by [22.2.2.2.2]). @c out.width(0) is then - * called. - * - * If @a c is of type @c char and the character type of the stream is not - * @c char, the character is widened before insertion. - */ - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c); - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) - { return (__out << __out.widen(__c)); } - - // Specialization - template <class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, char __c); - - // Signed and unsigned - template<class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, signed char __c) - { return (__out << static_cast<char>(__c)); } - - template<class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) - { return (__out << static_cast<char>(__c)); } - //@} - - //@{ - /** - * @brief String inserters - * @param out An output stream. - * @param s A character string. - * @return out - * @pre @a s must be a non-NULL pointer - * - * Behaves like one of the formatted arithmetic inserters described in - * std::basic_ostream. After constructing a sentry object with good - * status, this function inserts @c traits::length(s) characters starting - * at @a s, widened if necessary, followed by any required padding (as - * determined by [22.2.2.2.2]). @c out.width(0) is then called. - */ - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s); - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits> & - operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s); - - // Partial specializationss - template<class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, const char* __s); - - // Signed and unsigned - template<class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) - { return (__out << reinterpret_cast<const char*>(__s)); } - - template<class _Traits> - basic_ostream<char, _Traits> & - operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) - { return (__out << reinterpret_cast<const char*>(__s)); } - //@} - - // [27.6.2.7] standard basic_ostream manipulators - /** - * @brief Write a newline and flush the stream. - * - * This manipulator is often mistakenly used when a simple newline is - * desired, leading to poor buffering performance. See - * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#2 for more - * on this subject. - */ - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - endl(basic_ostream<_CharT, _Traits>& __os) - { return flush(__os.put(__os.widen('\n'))); } - - /** - * @brief Write a null character into the output sequence. - * - * "Null character" is @c CharT() by definition. For CharT of @c char, - * this correctly writes the ASCII @c NUL character string terminator. - */ - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - ends(basic_ostream<_CharT, _Traits>& __os) - { return __os.put(_CharT()); } - - /** - * @brief Flushes the output stream. - * - * This manipulator simply calls the stream's @c flush() member function. - */ - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - flush(basic_ostream<_CharT, _Traits>& __os) - { return __os.flush(); } - -} // namespace std - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/ostream.tcc> -#endif - -#endif /* _GLIBCXX_OSTREAM */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/queue b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/queue deleted file mode 100644 index 9a6523bef87..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/queue +++ /dev/null @@ -1,78 +0,0 @@ -// <queue> -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file queue - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_QUEUE -#define _GLIBCXX_QUEUE 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/functexcept.h> -#include <bits/stl_algobase.h> -#include <bits/allocator.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_heap.h> -#include <bits/stl_function.h> -#include <deque> -#include <vector> -#include <bits/stl_queue.h> - -#endif /* _GLIBCXX_QUEUE */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/set b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/set deleted file mode 100644 index 7ef8c9fef3b..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/set +++ /dev/null @@ -1,74 +0,0 @@ -// <set> -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file set - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_SET -#define _GLIBCXX_SET 1 - -#pragma GCC system_header - -#include <bits/stl_tree.h> -#include <bits/stl_set.h> -#include <bits/stl_multiset.h> - -#ifdef _GLIBCXX_DEBUG -# include <debug/set> -#endif - -#endif /* _GLIBCXX_SET */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/sstream b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/sstream deleted file mode 100644 index 0a6738adf8a..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/sstream +++ /dev/null @@ -1,643 +0,0 @@ -// String based streams -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.7 String-based streams -// - -/** @file sstream - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_SSTREAM -#define _GLIBCXX_SSTREAM 1 - -#pragma GCC system_header - -#include <istream> -#include <ostream> - -namespace std -{ - // [27.7.1] template class basic_stringbuf - /** - * @brief The actual work of input and output (for std::string). - * - * This class associates either or both of its input and output sequences - * with a sequence of characters, which can be initialized from, or made - * available as, a @c std::basic_string. (Paraphrased from [27.7.1]/1.) - * - * For this class, open modes (of type @c ios_base::openmode) have - * @c in set if the input sequence can be read, and @c out set if the - * output sequence can be written. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - class basic_stringbuf : public basic_streambuf<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 251. basic_stringbuf missing allocator_type - typedef _Alloc allocator_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - //@{ - /** - * @if maint - * @doctodo - * @endif - */ - typedef basic_streambuf<char_type, traits_type> __streambuf_type; - typedef basic_string<char_type, _Traits, _Alloc> __string_type; - typedef typename __string_type::size_type __size_type; - //@} - - protected: - /** - * @if maint - * Place to stash in || out || in | out settings for current stringbuf. - * @endif - */ - ios_base::openmode _M_mode; - - // Data Members: - /** - * @if maint - * @doctodo - * @endif - */ - __string_type _M_string; - - public: - // Constructors: - /** - * @brief Starts with an empty string buffer. - * @param mode Whether the buffer can read, or write, or both. - * - * The default constructor initializes the parent class using its - * own default ctor. - */ - explicit - basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out) - : __streambuf_type(), _M_mode(__mode), _M_string() - { } - - /** - * @brief Starts with an existing string buffer. - * @param str A string to copy as a starting buffer. - * @param mode Whether the buffer can read, or write, or both. - * - * This constructor initializes the parent class using its - * own default ctor. - */ - explicit - basic_stringbuf(const __string_type& __str, - ios_base::openmode __mode = ios_base::in | ios_base::out) - : __streambuf_type(), _M_mode(), _M_string(__str.data(), __str.size()) - { _M_stringbuf_init(__mode); } - - // Get and set: - /** - * @brief Copying out the string buffer. - * @return A copy of one of the underlying sequences. - * - * "If the buffer is only created in input mode, the underlying - * character sequence is equal to the input sequence; otherwise, it - * is equal to the output sequence." [27.7.1.2]/1 - */ - __string_type - str() const - { - if (this->pptr()) - { - // The current egptr() may not be the actual string end. - if (this->pptr() > this->egptr()) - return __string_type(this->pbase(), this->pptr()); - else - return __string_type(this->pbase(), this->egptr()); - } - else - return _M_string; - } - - /** - * @brief Setting a new buffer. - * @param s The string to use as a new sequence. - * - * Deallocates any previous stored sequence, then copies @a s to - * use as a new one. - */ - void - str(const __string_type& __s) - { - // Cannot use _M_string = __s, since v3 strings are COW. - _M_string.assign(__s.data(), __s.size()); - _M_stringbuf_init(this->_M_mode); - } - - protected: - // Common initialization code goes here. - /** - * @if maint - * @doctodo - * @endif - */ - void - _M_stringbuf_init(ios_base::openmode __mode) - { - this->_M_mode = __mode; - - __size_type __len = 0; - if (this->_M_mode & (ios_base::ate | ios_base::app)) - __len = _M_string.size(); - _M_sync(const_cast<char_type*>(_M_string.data()), 0, __len); - } - - // [documentation is inherited] - virtual int_type - underflow(); - - // [documentation is inherited] - virtual int_type - pbackfail(int_type __c = traits_type::eof()); - - // [documentation is inherited] - virtual int_type - overflow(int_type __c = traits_type::eof()); - - /** - * @brief Manipulates the buffer. - * @param s Pointer to a buffer area. - * @param n Size of @a s. - * @return @c this - * - * If no buffer has already been created, and both @a s and @a n are - * non-zero, then @c s is used as a buffer; see - * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#2 - * for more. - */ - virtual __streambuf_type* - setbuf(char_type* __s, streamsize __n) - { - if (__s && __n >= 0) - { - // This is implementation-defined behavior, and assumes - // that an external char_type array of length __n exists - // and has been pre-allocated. If this is not the case, - // things will quickly blow up. - - // Step 1: Destroy the current internal array. - _M_string = __string_type(__s, __n); - - // Step 2: Use the external array. - _M_sync(__s, 0, 0); - } - return this; - } - - // [documentation is inherited] - virtual pos_type - seekoff(off_type __off, ios_base::seekdir __way, - ios_base::openmode __mode = ios_base::in | ios_base::out); - - // [documentation is inherited] - virtual pos_type - seekpos(pos_type __sp, - ios_base::openmode __mode = ios_base::in | ios_base::out); - - // Internal function for correctly updating the internal buffer - // for a particular _M_string, due to initialization or - // re-sizing of an existing _M_string. - // Assumes: contents of _M_string and internal buffer match exactly. - // __i == _M_in_cur - _M_in_beg - // __o == _M_out_cur - _M_out_beg - /** - * @if maint - * @doctodo - * @endif - */ - void - _M_sync(char_type* __base, __size_type __i, __size_type __o) - { - const bool __testin = this->_M_mode & ios_base::in; - const bool __testout = this->_M_mode & ios_base::out; - const __size_type __len = _M_string.size(); - - if (__testin) - this->setg(__base, __base + __i, __base + __len); - if (__testout) - { - this->setp(__base, __base + _M_string.capacity()); - this->pbump(__o); - // We need a pointer to the string end anyway, even when - // !__testin: in that case, however, for the correct - // functioning of the streambuf inlines all the get area - // pointers must be identical. - if (!__testin) - this->setg(__base + __len, __base + __len, __base + __len); - } - } - - // Internal function for correctly updating egptr() to the actual - // string end. - void - _M_update_egptr() - { - const bool __testin = this->_M_mode & ios_base::in; - - if (this->pptr() && this->pptr() > this->egptr()) - if (__testin) - this->setg(this->eback(), this->gptr(), this->pptr()); - else - this->setg(this->pptr(), this->pptr(), this->pptr()); - } - }; - - - // [27.7.2] Template class basic_istringstream - /** - * @brief Controlling input for std::string. - * - * This class supports reading from objects of type std::basic_string, - * using the inherited functions from std::basic_istream. To control - * the associated sequence, an instance of std::basic_stringbuf is used, - * which this page refers to as @c sb. - */ - template<typename _CharT, typename _Traits, typename _Alloc> - class basic_istringstream : public basic_istream<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 251. basic_stringbuf missing allocator_type - typedef _Alloc allocator_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard types: - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; - typedef basic_istream<char_type, traits_type> __istream_type; - - private: - /** - * @if maint - * @doctodo - * @endif - */ - __stringbuf_type _M_stringbuf; - - public: - // Constructors: - /** - * @brief Default constructor starts with an empty string buffer. - * @param mode Whether the buffer can read, or write, or both. - * - * @c ios_base::in is automatically included in @a mode. - * - * Initializes @c sb using @c mode|in, and passes @c &sb to the base - * class initializer. Does not allocate any buffer. - * - * @if maint - * That's a lie. We initialize the base class with NULL, because the - * string class does its own memory management. - * @endif - */ - explicit - basic_istringstream(ios_base::openmode __mode = ios_base::in) - : __istream_type(), _M_stringbuf(__mode | ios_base::in) - { this->init(&_M_stringbuf); } - - /** - * @brief Starts with an existing string buffer. - * @param str A string to copy as a starting buffer. - * @param mode Whether the buffer can read, or write, or both. - * - * @c ios_base::in is automatically included in @a mode. - * - * Initializes @c sb using @a str and @c mode|in, and passes @c &sb - * to the base class initializer. - * - * @if maint - * That's a lie. We initialize the base class with NULL, because the - * string class does its own memory management. - * @endif - */ - explicit - basic_istringstream(const __string_type& __str, - ios_base::openmode __mode = ios_base::in) - : __istream_type(), _M_stringbuf(__str, __mode | ios_base::in) - { this->init(&_M_stringbuf); } - - /** - * @brief The destructor does nothing. - * - * The buffer is deallocated by the stringbuf object, not the - * formatting stream. - */ - ~basic_istringstream() - { } - - // Members: - /** - * @brief Accessing the underlying buffer. - * @return The current basic_stringbuf buffer. - * - * This hides both signatures of std::basic_ios::rdbuf(). - */ - __stringbuf_type* - rdbuf() const - { return const_cast<__stringbuf_type*>(&_M_stringbuf); } - - /** - * @brief Copying out the string buffer. - * @return @c rdbuf()->str() - */ - __string_type - str() const - { return _M_stringbuf.str(); } - - /** - * @brief Setting a new buffer. - * @param s The string to use as a new sequence. - * - * Calls @c rdbuf()->str(s). - */ - void - str(const __string_type& __s) - { _M_stringbuf.str(__s); } - }; - - - // [27.7.3] Template class basic_ostringstream - /** - * @brief Controlling output for std::string. - * - * This class supports writing to objects of type std::basic_string, - * using the inherited functions from std::basic_ostream. To control - * the associated sequence, an instance of std::basic_stringbuf is used, - * which this page refers to as @c sb. - */ - template <typename _CharT, typename _Traits, typename _Alloc> - class basic_ostringstream : public basic_ostream<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 251. basic_stringbuf missing allocator_type - typedef _Alloc allocator_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard types: - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; - typedef basic_ostream<char_type, traits_type> __ostream_type; - - private: - /** - * @if maint - * @doctodo - * @endif - */ - __stringbuf_type _M_stringbuf; - - public: - // Constructors/destructor: - /** - * @brief Default constructor starts with an empty string buffer. - * @param mode Whether the buffer can read, or write, or both. - * - * @c ios_base::out is automatically included in @a mode. - * - * Initializes @c sb using @c mode|out, and passes @c &sb to the base - * class initializer. Does not allocate any buffer. - * - * @if maint - * That's a lie. We initialize the base class with NULL, because the - * string class does its own memory management. - * @endif - */ - explicit - basic_ostringstream(ios_base::openmode __mode = ios_base::out) - : __ostream_type(), _M_stringbuf(__mode | ios_base::out) - { this->init(&_M_stringbuf); } - - /** - * @brief Starts with an existing string buffer. - * @param str A string to copy as a starting buffer. - * @param mode Whether the buffer can read, or write, or both. - * - * @c ios_base::out is automatically included in @a mode. - * - * Initializes @c sb using @a str and @c mode|out, and passes @c &sb - * to the base class initializer. - * - * @if maint - * That's a lie. We initialize the base class with NULL, because the - * string class does its own memory management. - * @endif - */ - explicit - basic_ostringstream(const __string_type& __str, - ios_base::openmode __mode = ios_base::out) - : __ostream_type(), _M_stringbuf(__str, __mode | ios_base::out) - { this->init(&_M_stringbuf); } - - /** - * @brief The destructor does nothing. - * - * The buffer is deallocated by the stringbuf object, not the - * formatting stream. - */ - ~basic_ostringstream() - { } - - // Members: - /** - * @brief Accessing the underlying buffer. - * @return The current basic_stringbuf buffer. - * - * This hides both signatures of std::basic_ios::rdbuf(). - */ - __stringbuf_type* - rdbuf() const - { return const_cast<__stringbuf_type*>(&_M_stringbuf); } - - /** - * @brief Copying out the string buffer. - * @return @c rdbuf()->str() - */ - __string_type - str() const - { return _M_stringbuf.str(); } - - /** - * @brief Setting a new buffer. - * @param s The string to use as a new sequence. - * - * Calls @c rdbuf()->str(s). - */ - void - str(const __string_type& __s) - { _M_stringbuf.str(__s); } - }; - - - // [27.7.4] Template class basic_stringstream - /** - * @brief Controlling input and output for std::string. - * - * This class supports reading from and writing to objects of type - * std::basic_string, using the inherited functions from - * std::basic_iostream. To control the associated sequence, an instance - * of std::basic_stringbuf is used, which this page refers to as @c sb. - */ - template <typename _CharT, typename _Traits, typename _Alloc> - class basic_stringstream : public basic_iostream<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 251. basic_stringbuf missing allocator_type - typedef _Alloc allocator_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard Types: - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; - typedef basic_iostream<char_type, traits_type> __iostream_type; - - private: - /** - * @if maint - * @doctodo - * @endif - */ - __stringbuf_type _M_stringbuf; - - public: - // Constructors/destructors - /** - * @brief Default constructor starts with an empty string buffer. - * @param mode Whether the buffer can read, or write, or both. - * - * Initializes @c sb using @c mode, and passes @c &sb to the base - * class initializer. Does not allocate any buffer. - * - * @if maint - * That's a lie. We initialize the base class with NULL, because the - * string class does its own memory management. - * @endif - */ - explicit - basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in) - : __iostream_type(), _M_stringbuf(__m) - { this->init(&_M_stringbuf); } - - /** - * @brief Starts with an existing string buffer. - * @param str A string to copy as a starting buffer. - * @param mode Whether the buffer can read, or write, or both. - * - * Initializes @c sb using @a str and @c mode, and passes @c &sb - * to the base class initializer. - * - * @if maint - * That's a lie. We initialize the base class with NULL, because the - * string class does its own memory management. - * @endif - */ - explicit - basic_stringstream(const __string_type& __str, - ios_base::openmode __m = ios_base::out | ios_base::in) - : __iostream_type(), _M_stringbuf(__str, __m) - { this->init(&_M_stringbuf); } - - /** - * @brief The destructor does nothing. - * - * The buffer is deallocated by the stringbuf object, not the - * formatting stream. - */ - ~basic_stringstream() - { } - - // Members: - /** - * @brief Accessing the underlying buffer. - * @return The current basic_stringbuf buffer. - * - * This hides both signatures of std::basic_ios::rdbuf(). - */ - __stringbuf_type* - rdbuf() const - { return const_cast<__stringbuf_type*>(&_M_stringbuf); } - - /** - * @brief Copying out the string buffer. - * @return @c rdbuf()->str() - */ - __string_type - str() const - { return _M_stringbuf.str(); } - - /** - * @brief Setting a new buffer. - * @param s The string to use as a new sequence. - * - * Calls @c rdbuf()->str(s). - */ - void - str(const __string_type& __s) - { _M_stringbuf.str(__s); } - }; -} // namespace std - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/sstream.tcc> -#endif - -#endif /* _GLIBCXX_SSTREAM */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/stack b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/stack deleted file mode 100644 index 70f045684e0..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/stack +++ /dev/null @@ -1,73 +0,0 @@ -// <stack> -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file stack - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_STACK -#define _GLIBCXX_STACK 1 - -#pragma GCC system_header - -#include <bits/stl_algobase.h> -#include <bits/allocator.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <deque> -#include <bits/stl_stack.h> - -#endif /* _GLIBCXX_STACK */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/stdexcept b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/stdexcept deleted file mode 100644 index ebd97f50f88..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/stdexcept +++ /dev/null @@ -1,148 +0,0 @@ -// Standard exception classes -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 19.1 Exception classes -// - -/** @file stdexcept - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_STDEXCEPT -#define _GLIBCXX_STDEXCEPT 1 - -#pragma GCC system_header - -#include <exception> -#include <string> - -namespace std -{ - /** Logic errors represent problems in the internal logic of a program; - * in theory, these are preventable, and even detectable before the - * program runs (e.g., violations of class invariants). - * @brief One of two subclasses of exception. - */ - class logic_error : public exception - { - string _M_msg; - - public: - /** Takes a character string describing the error. */ - explicit - logic_error(const string& __arg); - - virtual - ~logic_error() throw(); - - /** Returns a C-style character string describing the general cause of - * the current error (the same string passed to the ctor). */ - virtual const char* - what() const throw(); - }; - - /** Thrown by the library, or by you, to report domain errors (domain in - * the mathmatical sense). */ - class domain_error : public logic_error - { - public: - explicit domain_error(const string& __arg); - }; - - /** Thrown to report invalid arguments to functions. */ - class invalid_argument : public logic_error - { - public: - explicit invalid_argument(const string& __arg); - }; - - /** Thrown when an object is constructed that would exceed its maximum - * permitted size (e.g., a basic_string instance). */ - class length_error : public logic_error - { - public: - explicit length_error(const string& __arg); - }; - - /** This represents an argument whose value is not within the expected - * range (e.g., boundary checks in basic_string). */ - class out_of_range : public logic_error - { - public: - explicit out_of_range(const string& __arg); - }; - - /** Runtime errors represent problems outside the scope of a program; - * they cannot be easily predicted and can generally only be caught as - * the program executes. - * @brief One of two subclasses of exception. - */ - class runtime_error : public exception - { - string _M_msg; - - public: - /** Takes a character string describing the error. */ - explicit - runtime_error(const string& __arg); - - virtual - ~runtime_error() throw(); - - /** Returns a C-style character string describing the general cause of - * the current error (the same string passed to the ctor). */ - virtual const char* - what() const throw(); - }; - - /** Thrown to indicate range errors in internal computations. */ - class range_error : public runtime_error - { - public: - explicit range_error(const string& __arg); - }; - - /** Thrown to indicate arithmetic overflow. */ - class overflow_error : public runtime_error - { - public: - explicit overflow_error(const string& __arg); - }; - - /** Thrown to indicate arithmetic underflow. */ - class underflow_error : public runtime_error - { - public: - explicit underflow_error(const string& __arg); - }; -} // namespace std - -#endif /* _GLIBCXX_STDEXCEPT */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/streambuf b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/streambuf deleted file mode 100644 index 42b3d782b0f..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/streambuf +++ /dev/null @@ -1,784 +0,0 @@ -// Stream buffer classes -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.5 Stream buffers -// - -/** @file streambuf - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _CLIBXX_STREAMBUF -#define _CLIBXX_STREAMBUF 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <iosfwd> -#include <bits/localefwd.h> -#include <bits/ios_base.h> - -namespace std -{ - /** - * @if maint - * Does stuff. - * @endif - */ - template<typename _CharT, typename _Traits> - streamsize - __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin, - basic_streambuf<_CharT, _Traits>* __sbout); - - /** - * @brief The actual work of input and output (interface). - * - * This is a base class. Derived stream buffers each control a - * pair of character sequences: one for input, and one for output. - * - * Section [27.5.1] of the standard describes the requirements and - * behavior of stream buffer classes. That section (three paragraphs) - * is reproduced here, for simplicity and accuracy. - * - * -# Stream buffers can impose various constraints on the sequences - * they control. Some constraints are: - * - The controlled input sequence can be not readable. - * - The controlled output sequence can be not writable. - * - The controlled sequences can be associated with the contents of - * other representations for character sequences, such as external - * files. - * - The controlled sequences can support operations @e directly to or - * from associated sequences. - * - The controlled sequences can impose limitations on how the - * program can read characters from a sequence, write characters to - * a sequence, put characters back into an input sequence, or alter - * the stream position. - * . - * -# Each sequence is characterized by three pointers which, if non-null, - * all point into the same @c charT array object. The array object - * represents, at any moment, a (sub)sequence of characters from the - * sequence. Operations performed on a sequence alter the values - * stored in these pointers, perform reads and writes directly to or - * from associated sequences, and alter "the stream position" and - * conversion state as needed to maintain this subsequence relationship. - * The three pointers are: - * - the <em>beginning pointer</em>, or lowest element address in the - * array (called @e xbeg here); - * - the <em>next pointer</em>, or next element address that is a - * current candidate for reading or writing (called @e xnext here); - * - the <em>end pointer</em>, or first element address beyond the - * end of the array (called @e xend here). - * . - * -# The following semantic constraints shall always apply for any set - * of three pointers for a sequence, using the pointer names given - * immediately above: - * - If @e xnext is not a null pointer, then @e xbeg and @e xend shall - * also be non-null pointers into the same @c charT array, as - * described above; otherwise, @e xbeg and @e xend shall also be null. - * - If @e xnext is not a null pointer and @e xnext < @e xend for an - * output sequence, then a <em>write position</em> is available. - * In this case, @e *xnext shall be assignable as the next element - * to write (to put, or to store a character value, into the sequence). - * - If @e xnext is not a null pointer and @e xbeg < @e xnext for an - * input sequence, then a <em>putback position</em> is available. - * In this case, @e xnext[-1] shall have a defined value and is the - * next (preceding) element to store a character that is put back - * into the input sequence. - * - If @e xnext is not a null pointer and @e xnext< @e xend for an - * input sequence, then a <em>read position</em> is available. - * In this case, @e *xnext shall have a defined value and is the - * next element to read (to get, or to obtain a character value, - * from the sequence). - */ - template<typename _CharT, typename _Traits> - class basic_streambuf - { - public: - //@{ - /** - * These are standard types. They permit a standardized way of - * referring to names of (or names dependant on) the template - * parameters, which are specific to the implementation. - */ - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - //@} - - //@{ - /** - * @if maint - * This is a non-standard type. - * @endif - */ - typedef basic_streambuf<char_type, traits_type> __streambuf_type; - //@} - - friend class basic_ios<char_type, traits_type>; - friend class basic_istream<char_type, traits_type>; - friend class basic_ostream<char_type, traits_type>; - friend class istreambuf_iterator<char_type, traits_type>; - friend class ostreambuf_iterator<char_type, traits_type>; - - friend streamsize - __copy_streambufs<>(__streambuf_type* __sbin, - __streambuf_type* __sbout); - - protected: - //@{ - /** - * @if maint - * This is based on _IO_FILE, just reordered to be more consistent, - * and is intended to be the most minimal abstraction for an - * internal buffer. - * - get == input == read - * - put == output == write - * @endif - */ - char_type* _M_in_beg; // Start of get area. - char_type* _M_in_cur; // Current read area. - char_type* _M_in_end; // End of get area. - char_type* _M_out_beg; // Start of put area. - char_type* _M_out_cur; // Current put area. - char_type* _M_out_end; // End of put area. - - /** - * @if maint - * Current locale setting. - * @endif - */ - locale _M_buf_locale; - - public: - /// Destructor deallocates no buffer space. - virtual - ~basic_streambuf() - { } - - // [27.5.2.2.1] locales - /** - * @brief Entry point for imbue(). - * @param loc The new locale. - * @return The previous locale. - * - * Calls the derived imbue(loc). - */ - locale - pubimbue(const locale &__loc) - { - locale __tmp(this->getloc()); - this->imbue(__loc); - _M_buf_locale = __loc; - return __tmp; - } - - /** - * @brief Locale access. - * @return The current locale in effect. - * - * If pubimbue(loc) has been called, then the most recent @c loc - * is returned. Otherwise the global locale in effect at the time - * of construction is returned. - */ - locale - getloc() const - { return _M_buf_locale; } - - // [27.5.2.2.2] buffer management and positioning - //@{ - /** - * @brief Entry points for derived buffer functions. - * - * The public versions of @c pubfoo dispatch to the protected - * derived @c foo member functions, passing the arguments (if any) - * and returning the result unchanged. - */ - __streambuf_type* - pubsetbuf(char_type* __s, streamsize __n) - { return this->setbuf(__s, __n); } - - pos_type - pubseekoff(off_type __off, ios_base::seekdir __way, - ios_base::openmode __mode = ios_base::in | ios_base::out) - { return this->seekoff(__off, __way, __mode); } - - pos_type - pubseekpos(pos_type __sp, - ios_base::openmode __mode = ios_base::in | ios_base::out) - { return this->seekpos(__sp, __mode); } - - int - pubsync() { return this->sync(); } - //@} - - // [27.5.2.2.3] get area - /** - * @brief Looking ahead into the stream. - * @return The number of characters available. - * - * If a read position is available, returns the number of characters - * available for reading before the buffer must be refilled. - * Otherwise returns the derived @c showmanyc(). - */ - streamsize - in_avail() - { - const streamsize __ret = this->egptr() - this->gptr(); - return __ret ? __ret : this->showmanyc(); - } - - /** - * @brief Getting the next character. - * @return The next character, or eof. - * - * Calls @c sbumpc(), and if that function returns - * @c traits::eof(), so does this function. Otherwise, @c sgetc(). - */ - int_type - snextc() - { - int_type __ret = traits_type::eof(); - if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(), - __ret), true)) - __ret = this->sgetc(); - return __ret; - } - - /** - * @brief Getting the next character. - * @return The next character, or eof. - * - * If the input read position is available, returns that character - * and increments the read pointer, otherwise calls and returns - * @c uflow(). - */ - int_type - sbumpc() - { - int_type __ret; - if (__builtin_expect(this->gptr() < this->egptr(), true)) - { - __ret = traits_type::to_int_type(*this->gptr()); - this->gbump(1); - } - else - __ret = this->uflow(); - return __ret; - } - - /** - * @brief Getting the next character. - * @return The next character, or eof. - * - * If the input read position is available, returns that character, - * otherwise calls and returns @c underflow(). Does not move the - * read position after fetching the character. - */ - int_type - sgetc() - { - int_type __ret; - if (__builtin_expect(this->gptr() < this->egptr(), true)) - __ret = traits_type::to_int_type(*this->gptr()); - else - __ret = this->underflow(); - return __ret; - } - - /** - * @brief Entry point for xsgetn. - * @param s A buffer area. - * @param n A count. - * - * Returns xsgetn(s,n). The effect is to fill @a s[0] through - * @a s[n-1] with characters from the input sequence, if possible. - */ - streamsize - sgetn(char_type* __s, streamsize __n) - { return this->xsgetn(__s, __n); } - - // [27.5.2.2.4] putback - /** - * @brief Pushing characters back into the input stream. - * @param c The character to push back. - * @return The previous character, if possible. - * - * Similar to sungetc(), but @a c is pushed onto the stream instead - * of "the previous character". If successful, the next character - * fetched from the input stream will be @a c. - */ - int_type - sputbackc(char_type __c) - { - int_type __ret; - const bool __testpos = this->eback() < this->gptr(); - if (__builtin_expect(!__testpos || - !traits_type::eq(__c, this->gptr()[-1]), false)) - __ret = this->pbackfail(traits_type::to_int_type(__c)); - else - { - this->gbump(-1); - __ret = traits_type::to_int_type(*this->gptr()); - } - return __ret; - } - - /** - * @brief Moving backwards in the input stream. - * @return The previous character, if possible. - * - * If a putback position is available, this function decrements the - * input pointer and returns that character. Otherwise, calls and - * returns pbackfail(). The effect is to "unget" the last character - * "gotten". - */ - int_type - sungetc() - { - int_type __ret; - if (__builtin_expect(this->eback() < this->gptr(), true)) - { - this->gbump(-1); - __ret = traits_type::to_int_type(*this->gptr()); - } - else - __ret = this->pbackfail(); - return __ret; - } - - // [27.5.2.2.5] put area - /** - * @brief Entry point for all single-character output functions. - * @param c A character to output. - * @return @a c, if possible. - * - * One of two public output functions. - * - * If a write position is available for the output sequence (i.e., - * the buffer is not full), stores @a c in that position, increments - * the position, and returns @c traits::to_int_type(c). If a write - * position is not available, returns @c overflow(c). - */ - int_type - sputc(char_type __c) - { - int_type __ret; - if (__builtin_expect(this->pptr() < this->epptr(), true)) - { - *this->pptr() = __c; - this->pbump(1); - __ret = traits_type::to_int_type(__c); - } - else - __ret = this->overflow(traits_type::to_int_type(__c)); - return __ret; - } - - /** - * @brief Entry point for all single-character output functions. - * @param s A buffer read area. - * @param n A count. - * - * One of two public output functions. - * - * - * Returns xsputn(s,n). The effect is to write @a s[0] through - * @a s[n-1] to the output sequence, if possible. - */ - streamsize - sputn(const char_type* __s, streamsize __n) - { return this->xsputn(__s, __n); } - - protected: - /** - * @brief Base constructor. - * - * Only called from derived constructors, and sets up all the - * buffer data to zero, including the pointers described in the - * basic_streambuf class description. Note that, as a result, - * - the class starts with no read nor write positions available, - * - this is not an error - */ - basic_streambuf() - : _M_in_beg(0), _M_in_cur(0), _M_in_end(0), - _M_out_beg(0), _M_out_cur(0), _M_out_end(0), - _M_buf_locale(locale()) - { } - - // [27.5.2.3.1] get area access - //@{ - /** - * @brief Access to the get area. - * - * These functions are only available to other protected functions, - * including derived classes. - * - * - eback() returns the beginning pointer for the input sequence - * - gptr() returns the next pointer for the input sequence - * - egptr() returns the end pointer for the input sequence - */ - char_type* - eback() const { return _M_in_beg; } - - char_type* - gptr() const { return _M_in_cur; } - - char_type* - egptr() const { return _M_in_end; } - //@} - - /** - * @brief Moving the read position. - * @param n The delta by which to move. - * - * This just advances the read position without returning any data. - */ - void - gbump(int __n) { _M_in_cur += __n; } - - /** - * @brief Setting the three read area pointers. - * @param gbeg A pointer. - * @param gnext A pointer. - * @param gend A pointer. - * @post @a gbeg == @c eback(), @a gnext == @c gptr(), and - * @a gend == @c egptr() - */ - void - setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) - { - _M_in_beg = __gbeg; - _M_in_cur = __gnext; - _M_in_end = __gend; - } - - // [27.5.2.3.2] put area access - //@{ - /** - * @brief Access to the put area. - * - * These functions are only available to other protected functions, - * including derived classes. - * - * - pbase() returns the beginning pointer for the output sequence - * - pptr() returns the next pointer for the output sequence - * - epptr() returns the end pointer for the output sequence - */ - char_type* - pbase() const { return _M_out_beg; } - - char_type* - pptr() const { return _M_out_cur; } - - char_type* - epptr() const { return _M_out_end; } - //@} - - /** - * @brief Moving the write position. - * @param n The delta by which to move. - * - * This just advances the write position without returning any data. - */ - void - pbump(int __n) { _M_out_cur += __n; } - - /** - * @brief Setting the three write area pointers. - * @param pbeg A pointer. - * @param pend A pointer. - * @post @a pbeg == @c pbase(), @a pbeg == @c pptr(), and - * @a pend == @c epptr() - */ - void - setp(char_type* __pbeg, char_type* __pend) - { - _M_out_beg = _M_out_cur = __pbeg; - _M_out_end = __pend; - } - - // [27.5.2.4] virtual functions - // [27.5.2.4.1] locales - /** - * @brief Changes translations. - * @param loc A new locale. - * - * Translations done during I/O which depend on the current locale - * are changed by this call. The standard adds, "Between invocations - * of this function a class derived from streambuf can safely cache - * results of calls to locale functions and to members of facets - * so obtained." - * - * @note Base class version does nothing. - */ - virtual void - imbue(const locale&) - { } - - // [27.5.2.4.2] buffer management and positioning - /** - * @brief Maniuplates the buffer. - * - * Each derived class provides its own appropriate behavior. See - * the next-to-last paragraph of - * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#2 for - * more on this function. - * - * @note Base class version does nothing, returns @c this. - */ - virtual basic_streambuf<char_type,_Traits>* - setbuf(char_type*, streamsize) - { return this; } - - /** - * @brief Alters the stream positions. - * - * Each derived class provides its own appropriate behavior. - * @note Base class version does nothing, returns a @c pos_type - * that represents an invalid stream position. - */ - virtual pos_type - seekoff(off_type, ios_base::seekdir, - ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out) - { return pos_type(off_type(-1)); } - - /** - * @brief Alters the stream positions. - * - * Each derived class provides its own appropriate behavior. - * @note Base class version does nothing, returns a @c pos_type - * that represents an invalid stream position. - */ - virtual pos_type - seekpos(pos_type, - ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out) - { return pos_type(off_type(-1)); } - - /** - * @brief Synchronizes the buffer arrays with the controlled sequences. - * @return -1 on failure. - * - * Each derived class provides its own appropriate behavior, - * including the definition of "failure". - * @note Base class version does nothing, returns zero. - */ - virtual int - sync() { return 0; } - - // [27.5.2.4.3] get area - /** - * @brief Investigating the data available. - * @return An estimate of the number of characters available in the - * input sequence, or -1. - * - * "If it returns a positive value, then successive calls to - * @c underflow() will not return @c traits::eof() until at least that - * number of characters have been supplied. If @c showmanyc() - * returns -1, then calls to @c underflow() or @c uflow() will fail." - * [27.5.2.4.3]/1 - * - * @note Base class version does nothing, returns zero. - * @note The standard adds that "the intention is not only that the - * calls [to underflow or uflow] will not return @c eof() but - * that they will return "immediately". - * @note The standard adds that "the morphemes of @c showmanyc are - * "es-how-many-see", not "show-manic". - */ - virtual streamsize - showmanyc() { return 0; } - - /** - * @brief Multiple character extraction. - * @param s A buffer area. - * @param n Maximum number of characters to assign. - * @return The number of characters assigned. - * - * Fills @a s[0] through @a s[n-1] with characters from the input - * sequence, as if by @c sbumpc(). Stops when either @a n characters - * have been copied, or when @c traits::eof() would be copied. - * - * It is expected that derived classes provide a more efficient - * implementation by overriding this definition. - */ - virtual streamsize - xsgetn(char_type* __s, streamsize __n); - - /** - * @brief Fetches more data from the controlled sequence. - * @return The first character from the <em>pending sequence</em>. - * - * Informally, this function is called when the input buffer is - * exhausted (or does not exist, as buffering need not actually be - * done). If a buffer exists, it is "refilled". In either case, the - * next available character is returned, or @c traits::eof() to - * indicate a null pending sequence. - * - * For a formal definiton of the pending sequence, see a good text - * such as Langer & Kreft, or [27.5.2.4.3]/7-14. - * - * A functioning input streambuf can be created by overriding only - * this function (no buffer area will be used). For an example, see - * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#6 - * - * @note Base class version does nothing, returns eof(). - */ - virtual int_type - underflow() - { return traits_type::eof(); } - - /** - * @brief Fetches more data from the controlled sequence. - * @return The first character from the <em>pending sequence</em>. - * - * Informally, this function does the same thing as @c underflow(), - * and in fact is required to call that function. It also returns - * the new character, like @c underflow() does. However, this - * function also moves the read position forward by one. - */ - virtual int_type - uflow() - { - int_type __ret = traits_type::eof(); - const bool __testeof = traits_type::eq_int_type(this->underflow(), - __ret); - if (!__testeof) - { - __ret = traits_type::to_int_type(*this->gptr()); - this->gbump(1); - } - return __ret; - } - - // [27.5.2.4.4] putback - /** - * @brief Tries to back up the input sequence. - * @param c The character to be inserted back into the sequence. - * @return eof() on failure, "some other value" on success - * @post The constraints of @c gptr(), @c eback(), and @c pptr() - * are the same as for @c underflow(). - * - * @note Base class version does nothing, returns eof(). - */ - virtual int_type - pbackfail(int_type /* __c */ = traits_type::eof()) - { return traits_type::eof(); } - - // Put area: - /** - * @brief Multiple character insertion. - * @param s A buffer area. - * @param n Maximum number of characters to write. - * @return The number of characters written. - * - * Writes @a s[0] through @a s[n-1] to the output sequence, as if - * by @c sputc(). Stops when either @a n characters have been - * copied, or when @c sputc() would return @c traits::eof(). - * - * It is expected that derived classes provide a more efficient - * implementation by overriding this definition. - */ - virtual streamsize - xsputn(const char_type* __s, streamsize __n); - - /** - * @brief Consumes data from the buffer; writes to the - * controlled sequence. - * @param c An additional character to consume. - * @return eof() to indicate failure, something else (usually - * @a c, or not_eof()) - * - * Informally, this function is called when the output buffer is full - * (or does not exist, as buffering need not actually be done). If a - * buffer exists, it is "consumed", with "some effect" on the - * controlled sequence. (Typically, the buffer is written out to the - * sequence verbatim.) In either case, the character @a c is also - * written out, if @a c is not @c eof(). - * - * For a formal definiton of this function, see a good text - * such as Langer & Kreft, or [27.5.2.4.5]/3-7. - * - * A functioning output streambuf can be created by overriding only - * this function (no buffer area will be used). - * - * @note Base class version does nothing, returns eof(). - */ - virtual int_type - overflow(int_type /* __c */ = traits_type::eof()) - { return traits_type::eof(); } - -#ifdef _GLIBCXX_DEPRECATED - // Annex D.6 - public: - /** - * @brief Tosses a character. - * - * Advances the read pointer, ignoring the character that would have - * been read. - * - * See http://gcc.gnu.org/ml/libstdc++/2002-05/msg00168.html - * - * @note This function has been deprecated by the standard. You - * must define @c _GLIBCXX_DEPRECATED to make this visible; see - * c++config.h. - */ - void - stossc() - { - if (this->gptr() < this->egptr()) - this->gbump(1); - else - this->uflow(); - } -#endif - - private: - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // Side effect of DR 50. - basic_streambuf(const __streambuf_type& __sb) - : _M_in_beg(__sb._M_in_beg), _M_in_cur(__sb._M_in_cur), - _M_in_end(__sb._M_in_end), _M_out_beg(__sb._M_out_beg), - _M_out_cur(__sb._M_out_cur), _M_out_end(__sb._M_out_cur), - _M_buf_locale(__sb._M_buf_locale) - { } - - __streambuf_type& - operator=(const __streambuf_type&) { return *this; }; - }; -} // namespace std - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/streambuf.tcc> -#endif - -#endif /* _GLIBCXX_STREAMBUF */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/string b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/string deleted file mode 100644 index 2b15658c768..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/string +++ /dev/null @@ -1,60 +0,0 @@ -// Components for manipulating sequences of characters -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 21 Strings library -// - -/** @file string - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_STRING -#define _GLIBCXX_STRING 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/stringfwd.h> -#include <bits/char_traits.h> -#include <memory> // For allocator. -#include <bits/type_traits.h> -#include <iosfwd> // For operators >>, <<, and getline decls. -#include <bits/stl_iterator.h> -#include <bits/stl_function.h> // For less -#include <bits/basic_string.h> - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <algorithm> // for find_if -# include <bits/basic_string.tcc> -#endif - -#endif /* _GLIBCXX_STRING */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/typeinfo b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/typeinfo deleted file mode 100644 index 98200a503e4..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/typeinfo +++ /dev/null @@ -1,156 +0,0 @@ -// RTTI support for -*- C++ -*- -// Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002 -// Free Software Foundation -// -// This file is part of GCC. -// -// GCC is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2, or (at your option) -// any later version. -// -// GCC is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GCC; see the file COPYING. If not, write to -// the Free Software Foundation, 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file typeinfo - * This header provides RTTI support. - */ - -#ifndef _TYPEINFO -#define _TYPEINFO - -#include <exception> - -extern "C++" { - -namespace __cxxabiv1 -{ - class __class_type_info; -} // namespace __cxxabiv1 - -#if !__GXX_WEAK__ || defined (__MINGW32__) || defined (__CYGWIN__) - // If weak symbols are not supported, typeinfo names are not merged. - #define __GXX_MERGED_TYPEINFO_NAMES 0 -#else - // On platforms that support weak symbols, typeinfo names are merged. - #define __GXX_MERGED_TYPEINFO_NAMES 1 -#endif - -namespace std -{ - /** - * @brief Part of RTTI. - * - * The @c type_info class describes type information generated by - * an implementation. - */ - class type_info - { - public: - /** Destructor. Being the first non-inline virtual function, this - * controls in which translation unit the vtable is emitted. The - * compiler makes use of that information to know where to emit - * the runtime-mandated type_info structures in the new-abi. */ - virtual ~type_info(); - - private: - /// Assigning type_info is not supported. Made private. - type_info& operator=(const type_info&); - type_info(const type_info&); - - protected: - const char *__name; - - protected: - explicit type_info(const char *__n): __name(__n) { } - - public: - // the public interface - /** Returns an @e implementation-defined byte string; this is not - * portable between compilers! */ - const char* name() const - { return __name; } - -#if !__GXX_MERGED_TYPEINFO_NAMES - bool before(const type_info& __arg) const; - // In old abi, or when weak symbols are not supported, there can - // be multiple instances of a type_info object for one - // type. Uniqueness must use the _name value, not object address. - bool operator==(const type_info& __arg) const; -#else - /** Returns true if @c *this precedes @c __arg in the implementation's - * collation order. */ - // In new abi we can rely on type_info's NTBS being unique, - // and therefore address comparisons are sufficient. - bool before(const type_info& __arg) const - { return __name < __arg.__name; } - bool operator==(const type_info& __arg) const - { return __name == __arg.__name; } -#endif - bool operator!=(const type_info& __arg) const - { return !operator==(__arg); } - - // the internal interface - public: - // return true if this is a pointer type of some kind - virtual bool __is_pointer_p() const; - // return true if this is a function type - virtual bool __is_function_p() const; - - // Try and catch a thrown type. Store an adjusted pointer to the - // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then - // THR_OBJ points to the thrown object. If THR_TYPE is a pointer - // type, then THR_OBJ is the pointer itself. OUTER indicates the - // number of outer pointers, and whether they were const - // qualified. - virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj, - unsigned __outer) const; - - // internally used during catch matching - virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target, - void **__obj_ptr) const; - }; - - /** - * @brief Thrown during incorrect typecasting. - * - * If you attempt an invalid @c dynamic_cast expression, an instance of - * this class (or something derived from this class) is thrown. */ - class bad_cast : public exception - { - public: - bad_cast() throw() { } - // This declaration is not useless: - // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - virtual ~bad_cast() throw(); - }; - - /** If you use a NULL pointer in a @c typeid expression, this is thrown. */ - class bad_typeid : public exception - { - public: - bad_typeid () throw() { } - // This declaration is not useless: - // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - virtual ~bad_typeid() throw(); - }; -} // namespace std - -} // extern "C++" -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/utility b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/utility deleted file mode 100644 index fe93090f939..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/utility +++ /dev/null @@ -1,70 +0,0 @@ -// <utility> -*- C++ -*- - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file utility - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_UTILITY -#define _GLIBCXX_UTILITY 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/stl_relops.h> -#include <bits/stl_pair.h> - -#endif /* _GLIBCXX_UTILITY */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/valarray b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/valarray deleted file mode 100644 index b893b335415..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/valarray +++ /dev/null @@ -1,1017 +0,0 @@ -// The template and inlines for the -*- C++ -*- valarray class. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 -// Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr> - -/** @file valarray - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_VALARRAY -#define _GLIBCXX_VALARRAY 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <cstddef> -#include <cmath> -#include <cstdlib> -#include <numeric> -#include <algorithm> -#include <debug/debug.h> - -namespace std -{ - template<class _Clos, typename _Tp> - class _Expr; - - template<typename _Tp1, typename _Tp2> - class _ValArray; - - template<class _Oper, template<class, class> class _Meta, class _Dom> - struct _UnClos; - - template<class _Oper, - template<class, class> class _Meta1, - template<class, class> class _Meta2, - class _Dom1, class _Dom2> - class _BinClos; - - template<template<class, class> class _Meta, class _Dom> - class _SClos; - - template<template<class, class> class _Meta, class _Dom> - class _GClos; - - template<template<class, class> class _Meta, class _Dom> - class _IClos; - - template<template<class, class> class _Meta, class _Dom> - class _ValFunClos; - - template<template<class, class> class _Meta, class _Dom> - class _RefFunClos; - - template<class _Tp> class valarray; // An array of type _Tp - class slice; // BLAS-like slice out of an array - template<class _Tp> class slice_array; - class gslice; // generalized slice out of an array - template<class _Tp> class gslice_array; - template<class _Tp> class mask_array; // masked array - template<class _Tp> class indirect_array; // indirected array - -} // namespace std - -#include <bits/valarray_array.h> -#include <bits/valarray_before.h> - -namespace std -{ - /** - * @brief Smart array designed to support numeric processing. - * - * A valarray is an array that provides constraints intended to allow for - * effective optimization of numeric array processing by reducing the - * aliasing that can result from pointer representations. It represents a - * one-dimensional array from which different multidimensional subsets can - * be accessed and modified. - * - * @param Tp Type of object in the array. - */ - template<class _Tp> - class valarray - { - template<class _Op> - struct _UnaryOp - { - typedef typename __fun<_Op, _Tp>::result_type __rt; - typedef _Expr<_UnClos<_Op, _ValArray, _Tp>, __rt> _Rt; - }; - public: - typedef _Tp value_type; - - // _lib.valarray.cons_ construct/destroy: - /// Construct an empty array. - valarray(); - - /// Construct an array with @a n elements. - explicit valarray(size_t); - - /// Construct an array with @a n elements initialized to @a t. - valarray(const _Tp&, size_t); - - /// Construct an array initialized to the first @a n elements of @a t. - valarray(const _Tp* __restrict__, size_t); - - /// Copy constructor. - valarray(const valarray&); - - /// Construct an array with the same size and values in @a sa. - valarray(const slice_array<_Tp>&); - - /// Construct an array with the same size and values in @a ga. - valarray(const gslice_array<_Tp>&); - - /// Construct an array with the same size and values in @a ma. - valarray(const mask_array<_Tp>&); - - /// Construct an array with the same size and values in @a ia. - valarray(const indirect_array<_Tp>&); - - template<class _Dom> - valarray(const _Expr<_Dom,_Tp>& __e); - ~valarray(); - - // _lib.valarray.assign_ assignment: - /** - * @brief Assign elements to an array. - * - * Assign elements of array to values in @a v. Results are undefined - * if @a v is not the same size as this array. - * - * @param v Valarray to get values from. - */ - valarray<_Tp>& operator=(const valarray<_Tp>&); - - /** - * @brief Assign elements to a value. - * - * Assign all elements of array to @a t. - * - * @param t Value for elements. - */ - valarray<_Tp>& operator=(const _Tp&); - - /** - * @brief Assign elements to an array subset. - * - * Assign elements of array to values in @a sa. Results are undefined - * if @a sa is not the same size as this array. - * - * @param sa Array slice to get values from. - */ - valarray<_Tp>& operator=(const slice_array<_Tp>&); - - /** - * @brief Assign elements to an array subset. - * - * Assign elements of array to values in @a ga. Results are undefined - * if @a ga is not the same size as this array. - * - * @param ga Array slice to get values from. - */ - valarray<_Tp>& operator=(const gslice_array<_Tp>&); - - /** - * @brief Assign elements to an array subset. - * - * Assign elements of array to values in @a ma. Results are undefined - * if @a ma is not the same size as this array. - * - * @param ma Array slice to get values from. - */ - valarray<_Tp>& operator=(const mask_array<_Tp>&); - - /** - * @brief Assign elements to an array subset. - * - * Assign elements of array to values in @a ia. Results are undefined - * if @a ia is not the same size as this array. - * - * @param ia Array slice to get values from. - */ - valarray<_Tp>& operator=(const indirect_array<_Tp>&); - - template<class _Dom> valarray<_Tp>& - operator= (const _Expr<_Dom,_Tp>&); - - // _lib.valarray.access_ element access: - /** - * Return a reference to the i'th array element. - * - * @param i Index of element to return. - * @return Reference to the i'th element. - */ - _Tp& operator[](size_t); - - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 389. Const overload of valarray::operator[] returns by value. - const _Tp& operator[](size_t) const; - - // _lib.valarray.sub_ subset operations: - /** - * @brief Return an array subset. - * - * Returns a new valarray containing the elements of the array - * indicated by the slice argument. The new valarray is the size of - * the input slice. @see slice. - * - * @param s The source slice. - * @return New valarray containing elements in @a s. - */ - _Expr<_SClos<_ValArray,_Tp>, _Tp> operator[](slice) const; - - /** - * @brief Return a reference to an array subset. - * - * Returns a new valarray containing the elements of the array - * indicated by the slice argument. The new valarray is the size of - * the input slice. @see slice. - * - * @param s The source slice. - * @return New valarray containing elements in @a s. - */ - slice_array<_Tp> operator[](slice); - - /** - * @brief Return an array subset. - * - * Returns a slice_array referencing the elements of the array - * indicated by the slice argument. @see gslice. - * - * @param s The source slice. - * @return Slice_array referencing elements indicated by @a s. - */ - _Expr<_GClos<_ValArray,_Tp>, _Tp> operator[](const gslice&) const; - - /** - * @brief Return a reference to an array subset. - * - * Returns a new valarray containing the elements of the array - * indicated by the gslice argument. The new valarray is - * the size of the input gslice. @see gslice. - * - * @param s The source gslice. - * @return New valarray containing elements in @a s. - */ - gslice_array<_Tp> operator[](const gslice&); - - /** - * @brief Return an array subset. - * - * Returns a new valarray containing the elements of the array - * indicated by the argument. The input is a valarray of bool which - * represents a bitmask indicating which elements should be copied into - * the new valarray. Each element of the array is added to the return - * valarray if the corresponding element of the argument is true. - * - * @param m The valarray bitmask. - * @return New valarray containing elements indicated by @a m. - */ - valarray<_Tp> operator[](const valarray<bool>&) const; - - /** - * @brief Return a reference to an array subset. - * - * Returns a new mask_array referencing the elements of the array - * indicated by the argument. The input is a valarray of bool which - * represents a bitmask indicating which elements are part of the - * subset. Elements of the array are part of the subset if the - * corresponding element of the argument is true. - * - * @param m The valarray bitmask. - * @return New valarray containing elements indicated by @a m. - */ - mask_array<_Tp> operator[](const valarray<bool>&); - - /** - * @brief Return an array subset. - * - * Returns a new valarray containing the elements of the array - * indicated by the argument. The elements in the argument are - * interpreted as the indices of elements of this valarray to copy to - * the return valarray. - * - * @param i The valarray element index list. - * @return New valarray containing elements in @a s. - */ - _Expr<_IClos<_ValArray, _Tp>, _Tp> - operator[](const valarray<size_t>&) const; - - /** - * @brief Return a reference to an array subset. - * - * Returns an indirect_array referencing the elements of the array - * indicated by the argument. The elements in the argument are - * interpreted as the indices of elements of this valarray to include - * in the subset. The returned indirect_array refers to these - * elements. - * - * @param i The valarray element index list. - * @return Indirect_array referencing elements in @a i. - */ - indirect_array<_Tp> operator[](const valarray<size_t>&); - - // _lib.valarray.unary_ unary operators: - /// Return a new valarray by applying unary + to each element. - typename _UnaryOp<__unary_plus>::_Rt operator+() const; - - /// Return a new valarray by applying unary - to each element. - typename _UnaryOp<__negate>::_Rt operator-() const; - - /// Return a new valarray by applying unary ~ to each element. - typename _UnaryOp<__bitwise_not>::_Rt operator~() const; - - /// Return a new valarray by applying unary ! to each element. - typename _UnaryOp<__logical_not>::_Rt operator!() const; - - // _lib.valarray.cassign_ computed assignment: - /// Multiply each element of array by @a t. - valarray<_Tp>& operator*=(const _Tp&); - - /// Divide each element of array by @a t. - valarray<_Tp>& operator/=(const _Tp&); - - /// Set each element e of array to e % @a t. - valarray<_Tp>& operator%=(const _Tp&); - - /// Add @a t to each element of array. - valarray<_Tp>& operator+=(const _Tp&); - - /// Subtract @a t to each element of array. - valarray<_Tp>& operator-=(const _Tp&); - - /// Set each element e of array to e ^ @a t. - valarray<_Tp>& operator^=(const _Tp&); - - /// Set each element e of array to e & @a t. - valarray<_Tp>& operator&=(const _Tp&); - - /// Set each element e of array to e | @a t. - valarray<_Tp>& operator|=(const _Tp&); - - /// Left shift each element e of array by @a t bits. - valarray<_Tp>& operator<<=(const _Tp&); - - /// Right shift each element e of array by @a t bits. - valarray<_Tp>& operator>>=(const _Tp&); - - /// Multiply elements of array by corresponding elements of @a v. - valarray<_Tp>& operator*=(const valarray<_Tp>&); - - /// Divide elements of array by corresponding elements of @a v. - valarray<_Tp>& operator/=(const valarray<_Tp>&); - - /// Modulo elements of array by corresponding elements of @a v. - valarray<_Tp>& operator%=(const valarray<_Tp>&); - - /// Add corresponding elements of @a v to elements of array. - valarray<_Tp>& operator+=(const valarray<_Tp>&); - - /// Subtract corresponding elements of @a v from elements of array. - valarray<_Tp>& operator-=(const valarray<_Tp>&); - - /// Logical xor corresponding elements of @a v with elements of array. - valarray<_Tp>& operator^=(const valarray<_Tp>&); - - /// Logical or corresponding elements of @a v with elements of array. - valarray<_Tp>& operator|=(const valarray<_Tp>&); - - /// Logical and corresponding elements of @a v with elements of array. - valarray<_Tp>& operator&=(const valarray<_Tp>&); - - /// Left shift elements of array by corresponding elements of @a v. - valarray<_Tp>& operator<<=(const valarray<_Tp>&); - - /// Right shift elements of array by corresponding elements of @a v. - valarray<_Tp>& operator>>=(const valarray<_Tp>&); - - template<class _Dom> - valarray<_Tp>& operator*=(const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator/=(const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator%=(const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator+=(const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator-=(const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator^=(const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator|=(const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator&=(const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator<<=(const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator>>=(const _Expr<_Dom,_Tp>&); - - - // _lib.valarray.members_ member functions: - /// Return the number of elements in array. - size_t size() const; - - /** - * @brief Return the sum of all elements in the array. - * - * Accumulates the sum of all elements into a Tp using +=. The order - * of adding the elements is unspecified. - */ - _Tp sum() const; - - /// Return the minimum element using operator<(). - _Tp min() const; - - /// Return the maximum element using operator<(). - _Tp max() const; - - // // FIXME: Extension - // _Tp product () const; - - /** - * @brief Return a shifted array. - * - * A new valarray is constructed as a copy of this array with elements - * in shifted positions. For an element with index i, the new position - * is i - n. The new valarray is the same size as the current one. - * New elements without a value are set to 0. Elements whos new - * position is outside the bounds of the array are discarded. - * - * Positive arguments shift toward index 0, discarding elements [0, n). - * Negative arguments discard elements from the top of the array. - * - * @param n Number of element positions to shift. - * @return New valarray with elements in shifted positions. - */ - valarray<_Tp> shift (int) const; - - /** - * @brief Return a rotated array. - * - * A new valarray is constructed as a copy of this array with elements - * in shifted positions. For an element with index i, the new position - * is (i - n) % size(). The new valarray is the same size as the - * current one. Elements that are shifted beyond the array bounds are - * shifted into the other end of the array. No elements are lost. - * - * Positive arguments shift toward index 0, wrapping around the top. - * Negative arguments shift towards the top, wrapping around to 0. - * - * @param n Number of element positions to rotate. - * @return New valarray with elements in shifted positions. - */ - valarray<_Tp> cshift(int) const; - - /** - * @brief Apply a function to the array. - * - * Returns a new valarray with elements assigned to the result of - * applying func to the corresponding element of this array. The new - * array is the same size as this one. - * - * @param func Function of Tp returning Tp to apply. - * @return New valarray with transformed elements. - */ - _Expr<_ValFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(_Tp)) const; - - /** - * @brief Apply a function to the array. - * - * Returns a new valarray with elements assigned to the result of - * applying func to the corresponding element of this array. The new - * array is the same size as this one. - * - * @param func Function of const Tp& returning Tp to apply. - * @return New valarray with transformed elements. - */ - _Expr<_RefFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(const _Tp&)) const; - - /** - * @brief Resize array. - * - * Resize this array to be @a size and set all elements to @a c. All - * references and iterators are invalidated. - * - * @param size New array size. - * @param c New value for all elements. - */ - void resize(size_t __size, _Tp __c = _Tp()); - - private: - size_t _M_size; - _Tp* __restrict__ _M_data; - - friend class _Array<_Tp>; - }; - - template<typename _Tp> - inline const _Tp& - valarray<_Tp>::operator[](size_t __i) const - { - __glibcxx_requires_subscript(__i); - return _M_data[__i]; - } - - template<typename _Tp> - inline _Tp& - valarray<_Tp>::operator[](size_t __i) - { - __glibcxx_requires_subscript(__i); - return _M_data[__i]; - } - -} // std:: - -#include <bits/valarray_after.h> - -#include <bits/slice_array.h> -#include <bits/gslice.h> -#include <bits/gslice_array.h> -#include <bits/mask_array.h> -#include <bits/indirect_array.h> - -namespace std -{ - template<typename _Tp> - inline - valarray<_Tp>::valarray() : _M_size(0), _M_data(0) {} - - template<typename _Tp> - inline - valarray<_Tp>::valarray(size_t __n) - : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) - { std::__valarray_default_construct(_M_data, _M_data + __n); } - - template<typename _Tp> - inline - valarray<_Tp>::valarray(const _Tp& __t, size_t __n) - : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) - { std::__valarray_fill_construct(_M_data, _M_data + __n, __t); } - - template<typename _Tp> - inline - valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n) - : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) - { - _GLIBCXX_DEBUG_ASSERT(__p != 0 || __n == 0); - std::__valarray_copy_construct(__p, __p + __n, _M_data); - } - - template<typename _Tp> - inline - valarray<_Tp>::valarray(const valarray<_Tp>& __v) - : _M_size(__v._M_size), _M_data(__valarray_get_storage<_Tp>(__v._M_size)) - { std::__valarray_copy_construct(__v._M_data, __v._M_data + _M_size, _M_data); } - - template<typename _Tp> - inline - valarray<_Tp>::valarray(const slice_array<_Tp>& __sa) - : _M_size(__sa._M_sz), _M_data(__valarray_get_storage<_Tp>(__sa._M_sz)) - { - std::__valarray_copy - (__sa._M_array, __sa._M_sz, __sa._M_stride, _Array<_Tp>(_M_data)); - } - - template<typename _Tp> - inline - valarray<_Tp>::valarray(const gslice_array<_Tp>& __ga) - : _M_size(__ga._M_index.size()), - _M_data(__valarray_get_storage<_Tp>(_M_size)) - { - std::__valarray_copy - (__ga._M_array, _Array<size_t>(__ga._M_index), - _Array<_Tp>(_M_data), _M_size); - } - - template<typename _Tp> - inline - valarray<_Tp>::valarray(const mask_array<_Tp>& __ma) - : _M_size(__ma._M_sz), _M_data(__valarray_get_storage<_Tp>(__ma._M_sz)) - { - std::__valarray_copy - (__ma._M_array, __ma._M_mask, _Array<_Tp>(_M_data), _M_size); - } - - template<typename _Tp> - inline - valarray<_Tp>::valarray(const indirect_array<_Tp>& __ia) - : _M_size(__ia._M_sz), _M_data(__valarray_get_storage<_Tp>(__ia._M_sz)) - { - std::__valarray_copy - (__ia._M_array, __ia._M_index, _Array<_Tp>(_M_data), _M_size); - } - - template<typename _Tp> template<class _Dom> - inline - valarray<_Tp>::valarray(const _Expr<_Dom, _Tp>& __e) - : _M_size(__e.size()), _M_data(__valarray_get_storage<_Tp>(_M_size)) - { std::__valarray_copy(__e, _M_size, _Array<_Tp>(_M_data)); } - - template<typename _Tp> - inline - valarray<_Tp>::~valarray() - { - std::__valarray_destroy_elements(_M_data, _M_data + _M_size); - std::__valarray_release_memory(_M_data); - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator=(const valarray<_Tp>& __v) - { - _GLIBCXX_DEBUG_ASSERT(_M_size == __v._M_size); - std::__valarray_copy(__v._M_data, _M_size, _M_data); - return *this; - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator=(const _Tp& __t) - { - std::__valarray_fill(_M_data, _M_size, __t); - return *this; - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator=(const slice_array<_Tp>& __sa) - { - _GLIBCXX_DEBUG_ASSERT(_M_size == __sa._M_sz); - std::__valarray_copy(__sa._M_array, __sa._M_sz, - __sa._M_stride, _Array<_Tp>(_M_data)); - return *this; - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator=(const gslice_array<_Tp>& __ga) - { - _GLIBCXX_DEBUG_ASSERT(_M_size == __ga._M_index.size()); - std::__valarray_copy(__ga._M_array, _Array<size_t>(__ga._M_index), - _Array<_Tp>(_M_data), _M_size); - return *this; - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator=(const mask_array<_Tp>& __ma) - { - _GLIBCXX_DEBUG_ASSERT(_M_size == __ma._M_sz); - std::__valarray_copy(__ma._M_array, __ma._M_mask, - _Array<_Tp>(_M_data), _M_size); - return *this; - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator=(const indirect_array<_Tp>& __ia) - { - _GLIBCXX_DEBUG_ASSERT(_M_size == __ia._M_sz); - std::__valarray_copy(__ia._M_array, __ia._M_index, - _Array<_Tp>(_M_data), _M_size); - return *this; - } - - template<typename _Tp> template<class _Dom> - inline valarray<_Tp>& - valarray<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e) - { - _GLIBCXX_DEBUG_ASSERT(_M_size == __e.size()); - std::__valarray_copy(__e, _M_size, _Array<_Tp>(_M_data)); - return *this; - } - - template<typename _Tp> - inline _Expr<_SClos<_ValArray,_Tp>, _Tp> - valarray<_Tp>::operator[](slice __s) const - { - typedef _SClos<_ValArray,_Tp> _Closure; - return _Expr<_Closure, _Tp>(_Closure (_Array<_Tp>(_M_data), __s)); - } - - template<typename _Tp> - inline slice_array<_Tp> - valarray<_Tp>::operator[](slice __s) - { - return slice_array<_Tp>(_Array<_Tp>(_M_data), __s); - } - - template<typename _Tp> - inline _Expr<_GClos<_ValArray,_Tp>, _Tp> - valarray<_Tp>::operator[](const gslice& __gs) const - { - typedef _GClos<_ValArray,_Tp> _Closure; - return _Expr<_Closure, _Tp> - (_Closure(_Array<_Tp>(_M_data), __gs._M_index->_M_index)); - } - - template<typename _Tp> - inline gslice_array<_Tp> - valarray<_Tp>::operator[](const gslice& __gs) - { - return gslice_array<_Tp> - (_Array<_Tp>(_M_data), __gs._M_index->_M_index); - } - - template<typename _Tp> - inline valarray<_Tp> - valarray<_Tp>::operator[](const valarray<bool>& __m) const - { - size_t __s = 0; - size_t __e = __m.size(); - for (size_t __i=0; __i<__e; ++__i) - if (__m[__i]) ++__s; - return valarray<_Tp>(mask_array<_Tp>(_Array<_Tp>(_M_data), __s, - _Array<bool> (__m))); - } - - template<typename _Tp> - inline mask_array<_Tp> - valarray<_Tp>::operator[](const valarray<bool>& __m) - { - size_t __s = 0; - size_t __e = __m.size(); - for (size_t __i=0; __i<__e; ++__i) - if (__m[__i]) ++__s; - return mask_array<_Tp>(_Array<_Tp>(_M_data), __s, _Array<bool>(__m)); - } - - template<typename _Tp> - inline _Expr<_IClos<_ValArray,_Tp>, _Tp> - valarray<_Tp>::operator[](const valarray<size_t>& __i) const - { - typedef _IClos<_ValArray,_Tp> _Closure; - return _Expr<_Closure, _Tp>(_Closure(*this, __i)); - } - - template<typename _Tp> - inline indirect_array<_Tp> - valarray<_Tp>::operator[](const valarray<size_t>& __i) - { - return indirect_array<_Tp>(_Array<_Tp>(_M_data), __i.size(), - _Array<size_t>(__i)); - } - - template<class _Tp> - inline size_t - valarray<_Tp>::size() const - { return _M_size; } - - template<class _Tp> - inline _Tp - valarray<_Tp>::sum() const - { - _GLIBCXX_DEBUG_ASSERT(_M_size > 0); - return std::__valarray_sum(_M_data, _M_data + _M_size); - } - -// template<typename _Tp> -// inline _Tp -// valarray<_Tp>::product () const -// { -// return __valarray_product(_M_data, _M_data + _M_size); -// } - - template <class _Tp> - inline valarray<_Tp> - valarray<_Tp>::shift(int __n) const - { - _Tp* const __a = static_cast<_Tp*> - (__builtin_alloca(sizeof(_Tp) * _M_size)); - if (__n == 0) // no shift - std::__valarray_copy_construct(_M_data, _M_data + _M_size, __a); - else if (__n > 0) // __n > 0: shift left - { - if (size_t(__n) > _M_size) - std::__valarray_default_construct(__a, __a + __n); - else - { - std::__valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a); - std::__valarray_default_construct(__a+_M_size-__n, __a + _M_size); - } - } - else // __n < 0: shift right - { - std::__valarray_copy_construct (_M_data, _M_data+_M_size+__n, __a-__n); - std::__valarray_default_construct(__a, __a - __n); - } - return valarray<_Tp> (__a, _M_size); - } - - template <class _Tp> - inline valarray<_Tp> - valarray<_Tp>::cshift (int __n) const - { - _Tp* const __a = static_cast<_Tp*> - (__builtin_alloca (sizeof(_Tp) * _M_size)); - if (__n == 0) // no cshift - std::__valarray_copy_construct(_M_data, _M_data + _M_size, __a); - else if (__n > 0) // cshift left - { - std::__valarray_copy_construct(_M_data, _M_data+__n, __a+_M_size-__n); - std::__valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a); - } - else // cshift right - { - std::__valarray_copy_construct - (_M_data + _M_size+__n, _M_data + _M_size, __a); - std::__valarray_copy_construct - (_M_data, _M_data + _M_size+__n, __a - __n); - } - return valarray<_Tp>(__a, _M_size); - } - - template <class _Tp> - inline void - valarray<_Tp>::resize (size_t __n, _Tp __c) - { - // This complication is so to make valarray<valarray<T> > work - // even though it is not required by the standard. Nobody should - // be saying valarray<valarray<T> > anyway. See the specs. - std::__valarray_destroy_elements(_M_data, _M_data + _M_size); - if (_M_size != __n) - { - std::__valarray_release_memory(_M_data); - _M_size = __n; - _M_data = __valarray_get_storage<_Tp>(__n); - } - std::__valarray_fill_construct(_M_data, _M_data + __n, __c); - } - - template<typename _Tp> - inline _Tp - valarray<_Tp>::min() const - { - _GLIBCXX_DEBUG_ASSERT(_M_size > 0); - return *std::min_element (_M_data, _M_data+_M_size); - } - - template<typename _Tp> - inline _Tp - valarray<_Tp>::max() const - { - _GLIBCXX_DEBUG_ASSERT(_M_size > 0); - return *std::max_element (_M_data, _M_data+_M_size); - } - - template<class _Tp> - inline _Expr<_ValFunClos<_ValArray,_Tp>,_Tp> - valarray<_Tp>::apply(_Tp func(_Tp)) const - { - typedef _ValFunClos<_ValArray,_Tp> _Closure; - return _Expr<_Closure,_Tp>(_Closure(*this, func)); - } - - template<class _Tp> - inline _Expr<_RefFunClos<_ValArray,_Tp>,_Tp> - valarray<_Tp>::apply(_Tp func(const _Tp &)) const - { - typedef _RefFunClos<_ValArray,_Tp> _Closure; - return _Expr<_Closure,_Tp>(_Closure(*this, func)); - } - -#define _DEFINE_VALARRAY_UNARY_OPERATOR(_Op, _Name) \ - template<typename _Tp> \ - inline typename valarray<_Tp>::template _UnaryOp<_Name>::_Rt \ - valarray<_Tp>::operator _Op() const \ - { \ - typedef _UnClos<_Name,_ValArray,_Tp> _Closure; \ - typedef typename __fun<_Name, _Tp>::result_type _Rt; \ - return _Expr<_Closure, _Rt>(_Closure(*this)); \ - } - - _DEFINE_VALARRAY_UNARY_OPERATOR(+, __unary_plus) - _DEFINE_VALARRAY_UNARY_OPERATOR(-, __negate) - _DEFINE_VALARRAY_UNARY_OPERATOR(~, __bitwise_not) - _DEFINE_VALARRAY_UNARY_OPERATOR (!, __logical_not) - -#undef _DEFINE_VALARRAY_UNARY_OPERATOR - -#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name) \ - template<class _Tp> \ - inline valarray<_Tp>& \ - valarray<_Tp>::operator _Op##=(const _Tp &__t) \ - { \ - _Array_augmented_##_Name(_Array<_Tp>(_M_data), _M_size, __t); \ - return *this; \ - } \ - \ - template<class _Tp> \ - inline valarray<_Tp>& \ - valarray<_Tp>::operator _Op##=(const valarray<_Tp> &__v) \ - { \ - _GLIBCXX_DEBUG_ASSERT(_M_size == __v._M_size); \ - _Array_augmented_##_Name(_Array<_Tp>(_M_data), _M_size, \ - _Array<_Tp>(__v._M_data)); \ - return *this; \ - } - -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(+, __plus) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(-, __minus) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(*, __multiplies) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(/, __divides) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(%, __modulus) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(^, __bitwise_xor) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(&, __bitwise_and) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(|, __bitwise_or) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(<<, __shift_left) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, __shift_right) - -#undef _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT - -#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \ - template<class _Tp> template<class _Dom> \ - inline valarray<_Tp>& \ - valarray<_Tp>::operator _Op##=(const _Expr<_Dom,_Tp>& __e) \ - { \ - _Array_augmented_##_Name(_Array<_Tp>(_M_data), __e, _M_size); \ - return *this; \ - } - -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(+, __plus) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(-, __minus) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(*, __multiplies) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(/, __divides) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(%, __modulus) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(^, __bitwise_xor) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(&, __bitwise_and) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(|, __bitwise_or) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(<<, __shift_left) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, __shift_right) - -#undef _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT - - -#define _DEFINE_BINARY_OPERATOR(_Op, _Name) \ - template<typename _Tp> \ - inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>, \ - typename __fun<_Name, _Tp>::result_type> \ - operator _Op(const valarray<_Tp>& __v, const valarray<_Tp>& __w) \ - { \ - _GLIBCXX_DEBUG_ASSERT(__v.size() == __w.size()); \ - typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \ - typedef typename __fun<_Name, _Tp>::result_type _Rt; \ - return _Expr<_Closure, _Rt>(_Closure(__v, __w)); \ - } \ - \ - template<typename _Tp> \ - inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>, \ - typename __fun<_Name, _Tp>::result_type> \ - operator _Op(const valarray<_Tp>& __v, const _Tp& __t) \ - { \ - typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \ - typedef typename __fun<_Name, _Tp>::result_type _Rt; \ - return _Expr<_Closure, _Rt>(_Closure(__v, __t)); \ - } \ - \ - template<typename _Tp> \ - inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>, \ - typename __fun<_Name, _Tp>::result_type> \ - operator _Op(const _Tp& __t, const valarray<_Tp>& __v) \ - { \ - typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \ - typedef typename __fun<_Name, _Tp>::result_type _Rt; \ - return _Expr<_Closure, _Tp>(_Closure(__t, __v)); \ - } - -_DEFINE_BINARY_OPERATOR(+, __plus) -_DEFINE_BINARY_OPERATOR(-, __minus) -_DEFINE_BINARY_OPERATOR(*, __multiplies) -_DEFINE_BINARY_OPERATOR(/, __divides) -_DEFINE_BINARY_OPERATOR(%, __modulus) -_DEFINE_BINARY_OPERATOR(^, __bitwise_xor) -_DEFINE_BINARY_OPERATOR(&, __bitwise_and) -_DEFINE_BINARY_OPERATOR(|, __bitwise_or) -_DEFINE_BINARY_OPERATOR(<<, __shift_left) -_DEFINE_BINARY_OPERATOR(>>, __shift_right) -_DEFINE_BINARY_OPERATOR(&&, __logical_and) -_DEFINE_BINARY_OPERATOR(||, __logical_or) -_DEFINE_BINARY_OPERATOR(==, __equal_to) -_DEFINE_BINARY_OPERATOR(!=, __not_equal_to) -_DEFINE_BINARY_OPERATOR(<, __less) -_DEFINE_BINARY_OPERATOR(>, __greater) -_DEFINE_BINARY_OPERATOR(<=, __less_equal) -_DEFINE_BINARY_OPERATOR(>=, __greater_equal) - -} // namespace std - -#endif /* _GLIBCXX_VALARRAY */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/vector b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/vector deleted file mode 100644 index 16e50a99ec8..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/vector +++ /dev/null @@ -1,83 +0,0 @@ -// <vector> -*- C++ -*- - -// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file vector - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _GLIBCXX_VECTOR -#define _GLIBCXX_VECTOR 1 - -#pragma GCC system_header - -#include <bits/functexcept.h> -#include <bits/stl_algobase.h> -#include <bits/allocator.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_vector.h> -#include <bits/stl_bvector.h> - -#ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/vector.tcc> -#endif - -#ifdef _GLIBCXX_DEBUG -# include <debug/vector> -#endif - -#endif /* _GLIBCXX_VECTOR */ - diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/emmintrin.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/emmintrin.h deleted file mode 100644 index 286906324a5..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/emmintrin.h +++ /dev/null @@ -1,1491 +0,0 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ - -#ifndef _EMMINTRIN_H_INCLUDED -#define _EMMINTRIN_H_INCLUDED - -#ifdef __SSE2__ -#include <xmmintrin.h> - -/* SSE2 */ -typedef double __v2df __attribute__ ((mode (V2DF))); -typedef int __v2di __attribute__ ((mode (V2DI))); -typedef int __v4si __attribute__ ((mode (V4SI))); -typedef int __v8hi __attribute__ ((mode (V8HI))); -typedef int __v16qi __attribute__ ((mode (V16QI))); - -/* Create a selector for use with the SHUFPD instruction. */ -#define _MM_SHUFFLE2(fp1,fp0) \ - (((fp1) << 1) | (fp0)) - -#define __m128i __v2di -#define __m128d __v2df - -/* Create a vector with element 0 as *P and the rest zero. */ -static __inline __m128d -_mm_load_sd (double const *__P) -{ - return (__m128d) __builtin_ia32_loadsd (__P); -} - -/* Create a vector with all two elements equal to *P. */ -static __inline __m128d -_mm_load1_pd (double const *__P) -{ - __v2df __tmp = __builtin_ia32_loadsd (__P); - return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,0)); -} - -static __inline __m128d -_mm_load_pd1 (double const *__P) -{ - return _mm_load1_pd (__P); -} - -/* Load two DPFP values from P. The address must be 16-byte aligned. */ -static __inline __m128d -_mm_load_pd (double const *__P) -{ - return (__m128d) __builtin_ia32_loadapd (__P); -} - -/* Load two DPFP values from P. The address need not be 16-byte aligned. */ -static __inline __m128d -_mm_loadu_pd (double const *__P) -{ - return (__m128d) __builtin_ia32_loadupd (__P); -} - -/* Load two DPFP values in reverse order. The address must be aligned. */ -static __inline __m128d -_mm_loadr_pd (double const *__P) -{ - __v2df __tmp = __builtin_ia32_loadapd (__P); - return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,1)); -} - -/* Create a vector with element 0 as F and the rest zero. */ -static __inline __m128d -_mm_set_sd (double __F) -{ - return (__m128d) __builtin_ia32_loadsd (&__F); -} - -/* Create a vector with all two elements equal to F. */ -static __inline __m128d -_mm_set1_pd (double __F) -{ - __v2df __tmp = __builtin_ia32_loadsd (&__F); - return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,0)); -} - -static __inline __m128d -_mm_set_pd1 (double __F) -{ - return _mm_set1_pd (__F); -} - -/* Create the vector [Z Y]. */ -static __inline __m128d -_mm_set_pd (double __Z, double __Y) -{ - return (__v2df) {__Y, __Z}; -} - -/* Create the vector [Y Z]. */ -static __inline __m128d -_mm_setr_pd (double __Z, double __Y) -{ - return _mm_set_pd (__Y, __Z); -} - -/* Create a vector of zeros. */ -static __inline __m128d -_mm_setzero_pd (void) -{ - return (__m128d) __builtin_ia32_setzeropd (); -} - -/* Stores the lower DPFP value. */ -static __inline void -_mm_store_sd (double *__P, __m128d __A) -{ - __builtin_ia32_storesd (__P, (__v2df)__A); -} - -/* Store the lower DPFP value across two words. */ -static __inline void -_mm_store1_pd (double *__P, __m128d __A) -{ - __v2df __va = (__v2df)__A; - __v2df __tmp = __builtin_ia32_shufpd (__va, __va, _MM_SHUFFLE2 (0,0)); - __builtin_ia32_storeapd (__P, __tmp); -} - -static __inline void -_mm_store_pd1 (double *__P, __m128d __A) -{ - _mm_store1_pd (__P, __A); -} - -/* Store two DPFP values. The address must be 16-byte aligned. */ -static __inline void -_mm_store_pd (double *__P, __m128d __A) -{ - __builtin_ia32_storeapd (__P, (__v2df)__A); -} - -/* Store two DPFP values. The address need not be 16-byte aligned. */ -static __inline void -_mm_storeu_pd (double *__P, __m128d __A) -{ - __builtin_ia32_storeupd (__P, (__v2df)__A); -} - -/* Store two DPFP values in reverse order. The address must be aligned. */ -static __inline void -_mm_storer_pd (double *__P, __m128d __A) -{ - __v2df __va = (__v2df)__A; - __v2df __tmp = __builtin_ia32_shufpd (__va, __va, _MM_SHUFFLE2 (0,1)); - __builtin_ia32_storeapd (__P, __tmp); -} - -/* Sets the low DPFP value of A from the low value of B. */ -static __inline __m128d -_mm_move_sd (__m128d __A, __m128d __B) -{ - return (__m128d) __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B); -} - - -static __inline __m128d -_mm_add_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_addpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_add_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_addsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_sub_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_subpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_sub_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_subsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_mul_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_mulpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_mul_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_mulsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_div_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_divpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_div_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_divsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_sqrt_pd (__m128d __A) -{ - return (__m128d)__builtin_ia32_sqrtpd ((__v2df)__A); -} - -/* Return pair {sqrt (A[0), B[1]}. */ -static __inline __m128d -_mm_sqrt_sd (__m128d __A, __m128d __B) -{ - __v2df __tmp = __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B); - return (__m128d)__builtin_ia32_sqrtsd ((__v2df)__tmp); -} - -static __inline __m128d -_mm_min_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_minpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_min_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_minsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_max_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_maxpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_max_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_maxsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_and_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_andpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_andnot_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_andnpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_or_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_orpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_xor_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_xorpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpeq_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpeqpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmplt_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpltpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmple_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmplepd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpgt_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpgtpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpge_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpgepd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpneq_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpneqpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpnlt_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpnltpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpnle_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpnlepd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpngt_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpngtpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpnge_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpngepd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpord_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpordpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpunord_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpunordpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpeq_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpeqsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmplt_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpltsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmple_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmplesd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpgt_sd (__m128d __A, __m128d __B) -{ - return (__m128d) __builtin_ia32_movsd ((__v2df) __A, - (__v2df) - __builtin_ia32_cmpltsd ((__v2df) __B, - (__v2df) - __A)); -} - -static __inline __m128d -_mm_cmpge_sd (__m128d __A, __m128d __B) -{ - return (__m128d) __builtin_ia32_movsd ((__v2df) __A, - (__v2df) - __builtin_ia32_cmplesd ((__v2df) __B, - (__v2df) - __A)); -} - -static __inline __m128d -_mm_cmpneq_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpneqsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpnlt_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpnltsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpnle_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpnlesd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpngt_sd (__m128d __A, __m128d __B) -{ - return (__m128d) __builtin_ia32_movsd ((__v2df) __A, - (__v2df) - __builtin_ia32_cmpnltsd ((__v2df) __B, - (__v2df) - __A)); -} - -static __inline __m128d -_mm_cmpnge_sd (__m128d __A, __m128d __B) -{ - return (__m128d) __builtin_ia32_movsd ((__v2df) __A, - (__v2df) - __builtin_ia32_cmpnlesd ((__v2df) __B, - (__v2df) - __A)); -} - -static __inline __m128d -_mm_cmpord_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpordsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpunord_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpunordsd ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comieq_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdeq ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comilt_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdlt ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comile_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdle ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comigt_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdgt ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comige_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdge ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comineq_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdneq ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomieq_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdeq ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomilt_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdlt ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomile_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdle ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomigt_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdgt ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomige_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdge ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomineq_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdneq ((__v2df)__A, (__v2df)__B); -} - -/* Create a vector with element 0 as *P and the rest zero. */ - -static __inline __m128i -_mm_load_si128 (__m128i const *__P) -{ - return (__m128i) __builtin_ia32_loaddqa ((char const *)__P); -} - -static __inline __m128i -_mm_loadu_si128 (__m128i const *__P) -{ - return (__m128i) __builtin_ia32_loaddqu ((char const *)__P); -} - -static __inline __m128i -_mm_loadl_epi64 (__m128i const *__P) -{ - return (__m128i) __builtin_ia32_movq2dq (*(unsigned long long *)__P); -} - -static __inline void -_mm_store_si128 (__m128i *__P, __m128i __B) -{ - __builtin_ia32_storedqa ((char *)__P, (__v16qi)__B); -} - -static __inline void -_mm_storeu_si128 (__m128i *__P, __m128i __B) -{ - __builtin_ia32_storedqu ((char *)__P, (__v16qi)__B); -} - -static __inline void -_mm_storel_epi64 (__m128i *__P, __m128i __B) -{ - *(long long *)__P = __builtin_ia32_movdq2q ((__v2di)__B); -} - -static __inline __m64 -_mm_movepi64_pi64 (__m128i __B) -{ - return (__m64) __builtin_ia32_movdq2q ((__v2di)__B); -} - -static __inline __m128i -_mm_move_epi64 (__m128i __A) -{ - return (__m128i) __builtin_ia32_movq ((__v2di)__A); -} - -/* Create a vector of zeros. */ -static __inline __m128i -_mm_setzero_si128 (void) -{ - return (__m128i) __builtin_ia32_setzero128 (); -} - -static __inline __m128i -_mm_set_epi64 (__m64 __A, __m64 __B) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - __v2di __tmp2 = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__B); - return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp2, __tmp); -} - -/* Create the vector [Z Y X W]. */ -static __inline __m128i -_mm_set_epi32 (int __Z, int __Y, int __X, int __W) -{ - union { - int __a[4]; - __m128i __v; - } __u; - - __u.__a[0] = __W; - __u.__a[1] = __X; - __u.__a[2] = __Y; - __u.__a[3] = __Z; - - return __u.__v; -} - -#ifdef __x86_64__ -/* Create the vector [Z Y]. */ -static __inline __m128i -_mm_set_epi64x (long long __Z, long long __Y) -{ - union { - long __a[2]; - __m128i __v; - } __u; - - __u.__a[0] = __Y; - __u.__a[1] = __Z; - - return __u.__v; -} -#endif - -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_set_epi16 (short __Z, short __Y, short __X, short __W, - short __V, short __U, short __T, short __S) -{ - union { - short __a[8]; - __m128i __v; - } __u; - - __u.__a[0] = __S; - __u.__a[1] = __T; - __u.__a[2] = __U; - __u.__a[3] = __V; - __u.__a[4] = __W; - __u.__a[5] = __X; - __u.__a[6] = __Y; - __u.__a[7] = __Z; - - return __u.__v; -} - -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_set_epi8 (char __Z, char __Y, char __X, char __W, - char __V, char __U, char __T, char __S, - char __Z1, char __Y1, char __X1, char __W1, - char __V1, char __U1, char __T1, char __S1) -{ - union { - char __a[16]; - __m128i __v; - } __u; - - __u.__a[0] = __S1; - __u.__a[1] = __T1; - __u.__a[2] = __U1; - __u.__a[3] = __V1; - __u.__a[4] = __W1; - __u.__a[5] = __X1; - __u.__a[6] = __Y1; - __u.__a[7] = __Z1; - __u.__a[8] = __S; - __u.__a[9] = __T; - __u.__a[10] = __U; - __u.__a[11] = __V; - __u.__a[12] = __W; - __u.__a[13] = __X; - __u.__a[14] = __Y; - __u.__a[15] = __Z; - - return __u.__v; -} - -static __inline __m128i -_mm_set1_epi64 (__m64 __A) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp, __tmp); -} - -static __inline __m128i -_mm_set1_epi32 (int __A) -{ - __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__A); - return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0)); -} - -#ifdef __x86_64__ -static __inline __m128i -_mm_set1_epi64x (long long __A) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - return (__m128i) __builtin_ia32_shufpd ((__v2df)__tmp, (__v2df)__tmp, _MM_SHUFFLE2 (0,0)); -} -#endif - -static __inline __m128i -_mm_set1_epi16 (short __A) -{ - int __Acopy = (unsigned short)__A; - __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__Acopy); - __tmp = (__v4si)__builtin_ia32_punpcklwd128 ((__v8hi)__tmp, (__v8hi)__tmp); - return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0)); -} - -static __inline __m128i -_mm_set1_epi8 (char __A) -{ - int __Acopy = (unsigned char)__A; - __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__Acopy); - __tmp = (__v4si)__builtin_ia32_punpcklbw128 ((__v16qi)__tmp, (__v16qi)__tmp); - __tmp = (__v4si)__builtin_ia32_punpcklbw128 ((__v16qi)__tmp, (__v16qi)__tmp); - return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0)); -} - -static __inline __m128i -_mm_setr_epi64 (__m64 __A, __m64 __B) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - __v2di __tmp2 = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__B); - return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp, __tmp2); -} - -/* Create the vector [Z Y X W]. */ -static __inline __m128i -_mm_setr_epi32 (int __W, int __X, int __Y, int __Z) -{ - union { - int __a[4]; - __m128i __v; - } __u; - - __u.__a[0] = __W; - __u.__a[1] = __X; - __u.__a[2] = __Y; - __u.__a[3] = __Z; - - return __u.__v; -} -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_setr_epi16 (short __S, short __T, short __U, short __V, - short __W, short __X, short __Y, short __Z) -{ - union { - short __a[8]; - __m128i __v; - } __u; - - __u.__a[0] = __S; - __u.__a[1] = __T; - __u.__a[2] = __U; - __u.__a[3] = __V; - __u.__a[4] = __W; - __u.__a[5] = __X; - __u.__a[6] = __Y; - __u.__a[7] = __Z; - - return __u.__v; -} - -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_setr_epi8 (char __S1, char __T1, char __U1, char __V1, - char __W1, char __X1, char __Y1, char __Z1, - char __S, char __T, char __U, char __V, - char __W, char __X, char __Y, char __Z) -{ - union { - char __a[16]; - __m128i __v; - } __u; - - __u.__a[0] = __S1; - __u.__a[1] = __T1; - __u.__a[2] = __U1; - __u.__a[3] = __V1; - __u.__a[4] = __W1; - __u.__a[5] = __X1; - __u.__a[6] = __Y1; - __u.__a[7] = __Z1; - __u.__a[8] = __S; - __u.__a[9] = __T; - __u.__a[10] = __U; - __u.__a[11] = __V; - __u.__a[12] = __W; - __u.__a[13] = __X; - __u.__a[14] = __Y; - __u.__a[15] = __Z; - - return __u.__v; -} - -static __inline __m128d -_mm_cvtepi32_pd (__m128i __A) -{ - return (__m128d)__builtin_ia32_cvtdq2pd ((__v4si) __A); -} - -static __inline __m128 -_mm_cvtepi32_ps (__m128i __A) -{ - return (__m128)__builtin_ia32_cvtdq2ps ((__v4si) __A); -} - -static __inline __m128i -_mm_cvtpd_epi32 (__m128d __A) -{ - return (__m128i)__builtin_ia32_cvtpd2dq ((__v2df) __A); -} - -static __inline __m64 -_mm_cvtpd_pi32 (__m128d __A) -{ - return (__m64)__builtin_ia32_cvtpd2pi ((__v2df) __A); -} - -static __inline __m128 -_mm_cvtpd_ps (__m128d __A) -{ - return (__m128)__builtin_ia32_cvtpd2ps ((__v2df) __A); -} - -static __inline __m128i -_mm_cvttpd_epi32 (__m128d __A) -{ - return (__m128i)__builtin_ia32_cvttpd2dq ((__v2df) __A); -} - -static __inline __m64 -_mm_cvttpd_pi32 (__m128d __A) -{ - return (__m64)__builtin_ia32_cvttpd2pi ((__v2df) __A); -} - -static __inline __m128d -_mm_cvtpi32_pd (__m64 __A) -{ - return (__m128d)__builtin_ia32_cvtpi2pd ((__v2si) __A); -} - -static __inline __m128i -_mm_cvtps_epi32 (__m128 __A) -{ - return (__m128i)__builtin_ia32_cvtps2dq ((__v4sf) __A); -} - -static __inline __m128i -_mm_cvttps_epi32 (__m128 __A) -{ - return (__m128i)__builtin_ia32_cvttps2dq ((__v4sf) __A); -} - -static __inline __m128d -_mm_cvtps_pd (__m128 __A) -{ - return (__m128d)__builtin_ia32_cvtps2pd ((__v4sf) __A); -} - -static __inline int -_mm_cvtsd_si32 (__m128d __A) -{ - return __builtin_ia32_cvtsd2si ((__v2df) __A); -} - -#ifdef __x86_64__ -static __inline long long -_mm_cvtsd_si64x (__m128d __A) -{ - return __builtin_ia32_cvtsd2si64 ((__v2df) __A); -} -#endif - -static __inline int -_mm_cvttsd_si32 (__m128d __A) -{ - return __builtin_ia32_cvttsd2si ((__v2df) __A); -} - -#ifdef __x86_64__ -static __inline long long -_mm_cvttsd_si64x (__m128d __A) -{ - return __builtin_ia32_cvttsd2si64 ((__v2df) __A); -} -#endif - -static __inline __m128 -_mm_cvtsd_ss (__m128 __A, __m128d __B) -{ - return (__m128)__builtin_ia32_cvtsd2ss ((__v4sf) __A, (__v2df) __B); -} - -static __inline __m128d -_mm_cvtsi32_sd (__m128d __A, int __B) -{ - return (__m128d)__builtin_ia32_cvtsi2sd ((__v2df) __A, __B); -} - -#ifdef __x86_64__ -static __inline __m128d -_mm_cvtsi64x_sd (__m128d __A, long long __B) -{ - return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B); -} -#endif - -static __inline __m128d -_mm_cvtss_sd (__m128d __A, __m128 __B) -{ - return (__m128d)__builtin_ia32_cvtss2sd ((__v2df) __A, (__v4sf)__B); -} - -#define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, (__C))) - -static __inline __m128d -_mm_unpackhi_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_unpckhpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_unpacklo_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_unpcklpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_loadh_pd (__m128d __A, double const *__B) -{ - return (__m128d)__builtin_ia32_loadhpd ((__v2df)__A, (__v2si *)__B); -} - -static __inline void -_mm_storeh_pd (double *__A, __m128d __B) -{ - __builtin_ia32_storehpd ((__v2si *)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_loadl_pd (__m128d __A, double const *__B) -{ - return (__m128d)__builtin_ia32_loadlpd ((__v2df)__A, (__v2si *)__B); -} - -static __inline void -_mm_storel_pd (double *__A, __m128d __B) -{ - __builtin_ia32_storelpd ((__v2si *)__A, (__v2df)__B); -} - -static __inline int -_mm_movemask_pd (__m128d __A) -{ - return __builtin_ia32_movmskpd ((__v2df)__A); -} - -static __inline __m128i -_mm_packs_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_packsswb128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_packs_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_packssdw128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_packus_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_packuswb128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_unpackhi_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpckhbw128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_unpackhi_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpckhwd128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_unpackhi_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpckhdq128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_unpackhi_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_unpacklo_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpcklbw128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_unpacklo_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpcklwd128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_unpacklo_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpckldq128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_unpacklo_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpcklqdq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_add_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_add_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_add_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddd128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_add_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_adds_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddsb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_adds_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddsw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_adds_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddusb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_adds_epu16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddusw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_sub_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_sub_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_sub_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubd128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_sub_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_subs_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubsb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_subs_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubsw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_subs_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubusb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_subs_epu16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubusw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_madd_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmaddwd128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_mulhi_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmulhw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_mullo_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmullw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m64 -_mm_mul_su32 (__m64 __A, __m64 __B) -{ - return (__m64)__builtin_ia32_pmuludq ((__v2si)__A, (__v2si)__B); -} - -static __inline __m128i -_mm_mul_epu32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmuludq128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_sll_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psllw128 ((__v8hi)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sll_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pslld128 ((__v4si)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sll_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psllq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sra_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psraw128 ((__v8hi)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sra_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrad128 ((__v4si)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_srl_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrlw128 ((__v8hi)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_srl_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrld128 ((__v4si)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_srl_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrlq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_slli_epi16 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psllwi128 ((__v8hi)__A, __B); -} - -static __inline __m128i -_mm_slli_epi32 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_pslldi128 ((__v4si)__A, __B); -} - -static __inline __m128i -_mm_slli_epi64 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psllqi128 ((__v2di)__A, __B); -} - -static __inline __m128i -_mm_srai_epi16 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psrawi128 ((__v8hi)__A, __B); -} - -static __inline __m128i -_mm_srai_epi32 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psradi128 ((__v4si)__A, __B); -} - -#if 0 -static __m128i __attribute__((__always_inline__)) -_mm_srli_si128 (__m128i __A, const int __B) -{ - return ((__m128i)__builtin_ia32_psrldqi128 (__A, __B)) -} - -static __m128i __attribute__((__always_inline__)) -_mm_srli_si128 (__m128i __A, const int __B) -{ - return ((__m128i)__builtin_ia32_pslldqi128 (__A, __B)) -} -#endif -#define _mm_srli_si128(__A, __B) ((__m128i)__builtin_ia32_psrldqi128 (__A, __B)) -#define _mm_slli_si128(__A, __B) ((__m128i)__builtin_ia32_pslldqi128 (__A, __B)) - -static __inline __m128i -_mm_srli_epi16 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psrlwi128 ((__v8hi)__A, __B); -} - -static __inline __m128i -_mm_srli_epi32 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psrldi128 ((__v4si)__A, __B); -} - -static __inline __m128i -_mm_srli_epi64 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psrlqi128 ((__v2di)__A, __B); -} - -static __inline __m128i -_mm_and_si128 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pand128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_andnot_si128 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pandn128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_or_si128 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_por128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_xor_si128 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pxor128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_cmpeq_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpeqb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_cmpeq_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpeqw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_cmpeq_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpeqd128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_cmplt_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__B, (__v16qi)__A); -} - -static __inline __m128i -_mm_cmplt_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__B, (__v8hi)__A); -} - -static __inline __m128i -_mm_cmplt_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__B, (__v4si)__A); -} - -static __inline __m128i -_mm_cmpgt_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_cmpgt_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_cmpgt_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__A, (__v4si)__B); -} - -#define _mm_extract_epi16(__A, __B) __builtin_ia32_pextrw128 ((__v8hi)__A, __B) - -#define _mm_insert_epi16(__A, __B, __C) ((__m128i)__builtin_ia32_pinsrw128 ((__v8hi)__A, __B, __C)) - -static __inline __m128i -_mm_max_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmaxsw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_max_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmaxub128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_min_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pminsw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_min_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pminub128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline int -_mm_movemask_epi8 (__m128i __A) -{ - return __builtin_ia32_pmovmskb128 ((__v16qi)__A); -} - -static __inline __m128i -_mm_mulhi_epu16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmulhuw128 ((__v8hi)__A, (__v8hi)__B); -} - -#define _mm_shufflehi_epi16(__A, __B) ((__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __B)) -#define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __B)) -#define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)__A, __B)) - -static __inline void -_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) -{ - __builtin_ia32_maskmovdqu ((__v16qi)__A, (__v16qi)__B, __C); -} - -static __inline __m128i -_mm_avg_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pavgb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_avg_epu16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pavgw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_sad_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psadbw128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline void -_mm_stream_si32 (int *__A, int __B) -{ - __builtin_ia32_movnti (__A, __B); -} - -static __inline void -_mm_stream_si128 (__m128i *__A, __m128i __B) -{ - __builtin_ia32_movntdq ((__v2di *)__A, (__v2di)__B); -} - -static __inline void -_mm_stream_pd (double *__A, __m128d __B) -{ - __builtin_ia32_movntpd (__A, (__v2df)__B); -} - -static __inline __m128i -_mm_movpi64_epi64 (__m64 __A) -{ - return (__m128i)__builtin_ia32_movq2dq ((unsigned long long)__A); -} - -static __inline void -_mm_clflush (void const *__A) -{ - return __builtin_ia32_clflush (__A); -} - -static __inline void -_mm_lfence (void) -{ - __builtin_ia32_lfence (); -} - -static __inline void -_mm_mfence (void) -{ - __builtin_ia32_mfence (); -} - -static __inline __m128i -_mm_cvtsi32_si128 (int __A) -{ - return (__m128i) __builtin_ia32_loadd (&__A); -} - -#ifdef __x86_64__ -static __inline __m128i -_mm_cvtsi64x_si128 (long long __A) -{ - return (__m128i) __builtin_ia32_movq2dq (__A); -} -#endif - -static __inline int -_mm_cvtsi128_si32 (__m128i __A) -{ - int __tmp; - __builtin_ia32_stored (&__tmp, (__v4si)__A); - return __tmp; -} - -#ifdef __x86_64__ -static __inline long long -_mm_cvtsi128_si64x (__m128i __A) -{ - return __builtin_ia32_movdq2q ((__v2di)__A); -} -#endif - -#endif /* __SSE2__ */ - -#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/float.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/float.h deleted file mode 100644 index 75fcd5422d9..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/float.h +++ /dev/null @@ -1,162 +0,0 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* - * ISO C Standard: 5.2.4.2.2 Characteristics of floating types <float.h> - */ - -#ifndef _FLOAT_H___ -#define _FLOAT_H___ - -/* Radix of exponent representation, b. */ -#undef FLT_RADIX -#define FLT_RADIX __FLT_RADIX__ - -/* Number of base-FLT_RADIX digits in the significand, p. */ -#undef FLT_MANT_DIG -#undef DBL_MANT_DIG -#undef LDBL_MANT_DIG -#define FLT_MANT_DIG __FLT_MANT_DIG__ -#define DBL_MANT_DIG __DBL_MANT_DIG__ -#define LDBL_MANT_DIG __LDBL_MANT_DIG__ - -/* Number of decimal digits, q, such that any floating-point number with q - decimal digits can be rounded into a floating-point number with p radix b - digits and back again without change to the q decimal digits, - - p * log10(b) if b is a power of 10 - floor((p - 1) * log10(b)) otherwise -*/ -#undef FLT_DIG -#undef DBL_DIG -#undef LDBL_DIG -#define FLT_DIG __FLT_DIG__ -#define DBL_DIG __DBL_DIG__ -#define LDBL_DIG __LDBL_DIG__ - -/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */ -#undef FLT_MIN_EXP -#undef DBL_MIN_EXP -#undef LDBL_MIN_EXP -#define FLT_MIN_EXP __FLT_MIN_EXP__ -#define DBL_MIN_EXP __DBL_MIN_EXP__ -#define LDBL_MIN_EXP __LDBL_MIN_EXP__ - -/* Minimum negative integer such that 10 raised to that power is in the - range of normalized floating-point numbers, - - ceil(log10(b) * (emin - 1)) -*/ -#undef FLT_MIN_10_EXP -#undef DBL_MIN_10_EXP -#undef LDBL_MIN_10_EXP -#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ -#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ -#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ - -/* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */ -#undef FLT_MAX_EXP -#undef DBL_MAX_EXP -#undef LDBL_MAX_EXP -#define FLT_MAX_EXP __FLT_MAX_EXP__ -#define DBL_MAX_EXP __DBL_MAX_EXP__ -#define LDBL_MAX_EXP __LDBL_MAX_EXP__ - -/* Maximum integer such that 10 raised to that power is in the range of - representable finite floating-point numbers, - - floor(log10((1 - b**-p) * b**emax)) -*/ -#undef FLT_MAX_10_EXP -#undef DBL_MAX_10_EXP -#undef LDBL_MAX_10_EXP -#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ -#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ -#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ - -/* Maximum representable finite floating-point number, - - (1 - b**-p) * b**emax -*/ -#undef FLT_MAX -#undef DBL_MAX -#undef LDBL_MAX -#define FLT_MAX __FLT_MAX__ -#define DBL_MAX __DBL_MAX__ -#define LDBL_MAX __LDBL_MAX__ - -/* The difference between 1 and the least value greater than 1 that is - representable in the given floating point type, b**1-p. */ -#undef FLT_EPSILON -#undef DBL_EPSILON -#undef LDBL_EPSILON -#define FLT_EPSILON __FLT_EPSILON__ -#define DBL_EPSILON __DBL_EPSILON__ -#define LDBL_EPSILON __LDBL_EPSILON__ - -/* Minimum normalized positive floating-point number, b**(emin - 1). */ -#undef FLT_MIN -#undef DBL_MIN -#undef LDBL_MIN -#define FLT_MIN __FLT_MIN__ -#define DBL_MIN __DBL_MIN__ -#define LDBL_MIN __LDBL_MIN__ - -/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */ -/* ??? This is supposed to change with calls to fesetround in <fenv.h>. */ -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -/* The floating-point expression evaluation method. - -1 indeterminate - 0 evaluate all operations and constants just to the range and - precision of the type - 1 evaluate operations and constants of type float and double - to the range and precision of the double type, evaluate - long double operations and constants to the range and - precision of the long double type - 2 evaluate all operations and constants to the range and - precision of the long double type - - ??? This ought to change with the setting of the fp control word; - the value provided by the compiler assumes the widest setting. */ -#undef FLT_EVAL_METHOD -#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ - -/* Number of decimal digits, n, such that any floating-point number in the - widest supported floating type with pmax radix b digits can be rounded - to a floating-point number with n decimal digits and back again without - change to the value, - - pmax * log10(b) if b is a power of 10 - ceil(1 + pmax * log10(b)) otherwise -*/ -#undef DECIMAL_DIG -#define DECIMAL_DIG __DECIMAL_DIG__ - -#endif /* C99 */ -#endif /* _FLOAT_H___ */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/iso646.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/iso646.h deleted file mode 100644 index f09672a9787..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/iso646.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* - * ISO C Standard: 7.9 Alternative spellings <iso646.h> - */ - -#ifndef _ISO646_H -#define _ISO646_H - -#ifndef __cplusplus -#define and && -#define and_eq &= -#define bitand & -#define bitor | -#define compl ~ -#define not ! -#define not_eq != -#define or || -#define or_eq |= -#define xor ^ -#define xor_eq ^= -#endif - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/limits.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/limits.h deleted file mode 100644 index 30e08a716a9..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/limits.h +++ /dev/null @@ -1,125 +0,0 @@ -/* This administrivia gets added to the beginning of limits.h - if the system has its own version of limits.h. */ - -/* We use _GCC_LIMITS_H_ because we want this not to match - any macros that the system's limits.h uses for its own purposes. */ -#ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */ -#define _GCC_LIMITS_H_ - -#ifndef _LIBC_LIMITS_H_ -/* Use "..." so that we find syslimits.h only in this same directory. */ -#include "syslimits.h" -#endif -#ifndef _LIMITS_H___ -#define _LIMITS_H___ - -/* Number of bits in a `char'. */ -#undef CHAR_BIT -#define CHAR_BIT __CHAR_BIT__ - -/* Maximum length of a multibyte character. */ -#ifndef MB_LEN_MAX -#define MB_LEN_MAX 1 -#endif - -/* Minimum and maximum values a `signed char' can hold. */ -#undef SCHAR_MIN -#define SCHAR_MIN (-SCHAR_MAX - 1) -#undef SCHAR_MAX -#define SCHAR_MAX __SCHAR_MAX__ - -/* Maximum value an `unsigned char' can hold. (Minimum is 0). */ -#undef UCHAR_MAX -#if __SCHAR_MAX__ == __INT_MAX__ -# define UCHAR_MAX (SCHAR_MAX * 2U + 1U) -#else -# define UCHAR_MAX (SCHAR_MAX * 2 + 1) -#endif - -/* Minimum and maximum values a `char' can hold. */ -#ifdef __CHAR_UNSIGNED__ -# undef CHAR_MIN -# if __SCHAR_MAX__ == __INT_MAX__ -# define CHAR_MIN 0U -# else -# define CHAR_MIN 0 -# endif -# undef CHAR_MAX -# define CHAR_MAX UCHAR_MAX -#else -# undef CHAR_MIN -# define CHAR_MIN SCHAR_MIN -# undef CHAR_MAX -# define CHAR_MAX SCHAR_MAX -#endif - -/* Minimum and maximum values a `signed short int' can hold. */ -#undef SHRT_MIN -#define SHRT_MIN (-SHRT_MAX - 1) -#undef SHRT_MAX -#define SHRT_MAX __SHRT_MAX__ - -/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */ -#undef USHRT_MAX -#if __SHRT_MAX__ == __INT_MAX__ -# define USHRT_MAX (SHRT_MAX * 2U + 1U) -#else -# define USHRT_MAX (SHRT_MAX * 2 + 1) -#endif - -/* Minimum and maximum values a `signed int' can hold. */ -#undef INT_MIN -#define INT_MIN (-INT_MAX - 1) -#undef INT_MAX -#define INT_MAX __INT_MAX__ - -/* Maximum value an `unsigned int' can hold. (Minimum is 0). */ -#undef UINT_MAX -#define UINT_MAX (INT_MAX * 2U + 1U) - -/* Minimum and maximum values a `signed long int' can hold. - (Same as `int'). */ -#undef LONG_MIN -#define LONG_MIN (-LONG_MAX - 1L) -#undef LONG_MAX -#define LONG_MAX __LONG_MAX__ - -/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */ -#undef ULONG_MAX -#define ULONG_MAX (LONG_MAX * 2UL + 1UL) - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -/* Minimum and maximum values a `signed long long int' can hold. */ -# undef LLONG_MIN -# define LLONG_MIN (-LLONG_MAX - 1LL) -# undef LLONG_MAX -# define LLONG_MAX __LONG_LONG_MAX__ - -/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ -# undef ULLONG_MAX -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) -#endif - -#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__) -/* Minimum and maximum values a `signed long long int' can hold. */ -# undef LONG_LONG_MIN -# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL) -# undef LONG_LONG_MAX -# define LONG_LONG_MAX __LONG_LONG_MAX__ - -/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ -# undef ULONG_LONG_MAX -# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL) -#endif - -#endif /* _LIMITS_H___ */ -/* This administrivia gets added to the end of limits.h - if the system has its own version of limits.h. */ - -#else /* not _GCC_LIMITS_H_ */ - -#ifdef _GCC_NEXT_LIMITS_H -#include_next <limits.h> /* recurse down to the real one */ -#endif - -#endif /* not _GCC_LIMITS_H_ */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/mm_malloc.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/mm_malloc.h deleted file mode 100644 index 5e626640ae4..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/mm_malloc.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (C) 2004 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -#ifndef _MM_MALLOC_H_INCLUDED -#define _MM_MALLOC_H_INCLUDED - -#include <stdlib.h> -#include <errno.h> - -static __inline__ void* -_mm_malloc (size_t size, size_t align) -{ - void * malloc_ptr; - void * aligned_ptr; - - /* Error if align is not a power of two. */ - if (align & (align - 1)) - { - errno = EINVAL; - return ((void*) 0); - } - - if (size == 0) - return ((void *) 0); - - /* Assume malloc'd pointer is aligned at least to sizeof (void*). - If necessary, add another sizeof (void*) to store the value - returned by malloc. Effectively this enforces a minimum alignment - of sizeof double. */ - if (align < 2 * sizeof (void *)) - align = 2 * sizeof (void *); - - malloc_ptr = malloc (size + align); - if (!malloc_ptr) - return ((void *) 0); - - /* Align We have at least sizeof (void *) space below malloc'd ptr. */ - aligned_ptr = (void *) (((size_t) malloc_ptr + align) - & ~((size_t) (align) - 1)); - - /* Store the original pointer just before p. */ - ((void **) aligned_ptr) [-1] = malloc_ptr; - - return aligned_ptr; -} - -static __inline__ void -_mm_free (void * aligned_ptr) -{ - if (aligned_ptr) - free (((void **) aligned_ptr) [-1]); -} - -#endif /* _MM_MALLOC_H_INCLUDED */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/mmintrin.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/mmintrin.h deleted file mode 100644 index bd775e8e3a6..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/mmintrin.h +++ /dev/null @@ -1,917 +0,0 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ - -#ifndef _MMINTRIN_H_INCLUDED -#define _MMINTRIN_H_INCLUDED - -#ifndef __MMX__ -# error "MMX instruction set not enabled" -#else -/* The data type intended for user use. */ -typedef int __m64 __attribute__ ((__mode__ (__V2SI__))); - -/* Internal data types for implementing the intrinsics. */ -typedef int __v2si __attribute__ ((__mode__ (__V2SI__))); -typedef int __v4hi __attribute__ ((__mode__ (__V4HI__))); -typedef int __v8qi __attribute__ ((__mode__ (__V8QI__))); - -/* Empty the multimedia state. */ -static __inline void -_mm_empty (void) -{ - __builtin_ia32_emms (); -} - -static __inline void -_m_empty (void) -{ - _mm_empty (); -} - -/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ -static __inline __m64 -_mm_cvtsi32_si64 (int __i) -{ - long long __tmp = (unsigned int)__i; - return (__m64) __tmp; -} - -static __inline __m64 -_m_from_int (int __i) -{ - return _mm_cvtsi32_si64 (__i); -} - -#ifdef __x86_64__ -/* Convert I to a __m64 object. */ -static __inline __m64 -_mm_cvtsi64x_si64 (long long __i) -{ - return (__m64) __i; -} - -/* Convert I to a __m64 object. */ -static __inline __m64 -_mm_set_pi64x (long long __i) -{ - return (__m64) __i; -} -#endif - -/* Convert the lower 32 bits of the __m64 object into an integer. */ -static __inline int -_mm_cvtsi64_si32 (__m64 __i) -{ - long long __tmp = (long long)__i; - return __tmp; -} - -static __inline int -_m_to_int (__m64 __i) -{ - return _mm_cvtsi64_si32 (__i); -} - -#ifdef __x86_64__ -/* Convert the lower 32 bits of the __m64 object into an integer. */ -static __inline long long -_mm_cvtsi64_si64x (__m64 __i) -{ - return (long long)__i; -} -#endif - -/* Pack the four 16-bit values from M1 into the lower four 8-bit values of - the result, and the four 16-bit values from M2 into the upper four 8-bit - values of the result, all with signed saturation. */ -static __inline __m64 -_mm_packs_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_packsswb ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_packsswb (__m64 __m1, __m64 __m2) -{ - return _mm_packs_pi16 (__m1, __m2); -} - -/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of - the result, and the two 32-bit values from M2 into the upper two 16-bit - values of the result, all with signed saturation. */ -static __inline __m64 -_mm_packs_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_packssdw ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_packssdw (__m64 __m1, __m64 __m2) -{ - return _mm_packs_pi32 (__m1, __m2); -} - -/* Pack the four 16-bit values from M1 into the lower four 8-bit values of - the result, and the four 16-bit values from M2 into the upper four 8-bit - values of the result, all with unsigned saturation. */ -static __inline __m64 -_mm_packs_pu16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_packuswb ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_packuswb (__m64 __m1, __m64 __m2) -{ - return _mm_packs_pu16 (__m1, __m2); -} - -/* Interleave the four 8-bit values from the high half of M1 with the four - 8-bit values from the high half of M2. */ -static __inline __m64 -_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpckhbw ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_punpckhbw (__m64 __m1, __m64 __m2) -{ - return _mm_unpackhi_pi8 (__m1, __m2); -} - -/* Interleave the two 16-bit values from the high half of M1 with the two - 16-bit values from the high half of M2. */ -static __inline __m64 -_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpckhwd ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_punpckhwd (__m64 __m1, __m64 __m2) -{ - return _mm_unpackhi_pi16 (__m1, __m2); -} - -/* Interleave the 32-bit value from the high half of M1 with the 32-bit - value from the high half of M2. */ -static __inline __m64 -_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpckhdq ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_punpckhdq (__m64 __m1, __m64 __m2) -{ - return _mm_unpackhi_pi32 (__m1, __m2); -} - -/* Interleave the four 8-bit values from the low half of M1 with the four - 8-bit values from the low half of M2. */ -static __inline __m64 -_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpcklbw ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_punpcklbw (__m64 __m1, __m64 __m2) -{ - return _mm_unpacklo_pi8 (__m1, __m2); -} - -/* Interleave the two 16-bit values from the low half of M1 with the two - 16-bit values from the low half of M2. */ -static __inline __m64 -_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpcklwd ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_punpcklwd (__m64 __m1, __m64 __m2) -{ - return _mm_unpacklo_pi16 (__m1, __m2); -} - -/* Interleave the 32-bit value from the low half of M1 with the 32-bit - value from the low half of M2. */ -static __inline __m64 -_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpckldq ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_punpckldq (__m64 __m1, __m64 __m2) -{ - return _mm_unpacklo_pi32 (__m1, __m2); -} - -/* Add the 8-bit values in M1 to the 8-bit values in M2. */ -static __inline __m64 -_mm_add_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_paddb (__m64 __m1, __m64 __m2) -{ - return _mm_add_pi8 (__m1, __m2); -} - -/* Add the 16-bit values in M1 to the 16-bit values in M2. */ -static __inline __m64 -_mm_add_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_paddw (__m64 __m1, __m64 __m2) -{ - return _mm_add_pi16 (__m1, __m2); -} - -/* Add the 32-bit values in M1 to the 32-bit values in M2. */ -static __inline __m64 -_mm_add_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddd ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_paddd (__m64 __m1, __m64 __m2) -{ - return _mm_add_pi32 (__m1, __m2); -} - -/* Add the 64-bit values in M1 to the 64-bit values in M2. */ -static __inline __m64 -_mm_add_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2); -} - -/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed - saturated arithmetic. */ -static __inline __m64 -_mm_adds_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddsb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_paddsb (__m64 __m1, __m64 __m2) -{ - return _mm_adds_pi8 (__m1, __m2); -} - -/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed - saturated arithmetic. */ -static __inline __m64 -_mm_adds_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddsw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_paddsw (__m64 __m1, __m64 __m2) -{ - return _mm_adds_pi16 (__m1, __m2); -} - -/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned - saturated arithmetic. */ -static __inline __m64 -_mm_adds_pu8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddusb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_paddusb (__m64 __m1, __m64 __m2) -{ - return _mm_adds_pu8 (__m1, __m2); -} - -/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned - saturated arithmetic. */ -static __inline __m64 -_mm_adds_pu16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddusw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_paddusw (__m64 __m1, __m64 __m2) -{ - return _mm_adds_pu16 (__m1, __m2); -} - -/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ -static __inline __m64 -_mm_sub_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_psubb (__m64 __m1, __m64 __m2) -{ - return _mm_sub_pi8 (__m1, __m2); -} - -/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ -static __inline __m64 -_mm_sub_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_psubw (__m64 __m1, __m64 __m2) -{ - return _mm_sub_pi16 (__m1, __m2); -} - -/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ -static __inline __m64 -_mm_sub_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubd ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_psubd (__m64 __m1, __m64 __m2) -{ - return _mm_sub_pi32 (__m1, __m2); -} - -/* Add the 64-bit values in M1 to the 64-bit values in M2. */ -static __inline __m64 -_mm_sub_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubq ((long long)__m1, (long long)__m2); -} - -/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed - saturating arithmetic. */ -static __inline __m64 -_mm_subs_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubsb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_psubsb (__m64 __m1, __m64 __m2) -{ - return _mm_subs_pi8 (__m1, __m2); -} - -/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using - signed saturating arithmetic. */ -static __inline __m64 -_mm_subs_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubsw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_psubsw (__m64 __m1, __m64 __m2) -{ - return _mm_subs_pi16 (__m1, __m2); -} - -/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using - unsigned saturating arithmetic. */ -static __inline __m64 -_mm_subs_pu8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubusb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_psubusb (__m64 __m1, __m64 __m2) -{ - return _mm_subs_pu8 (__m1, __m2); -} - -/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using - unsigned saturating arithmetic. */ -static __inline __m64 -_mm_subs_pu16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubusw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_psubusw (__m64 __m1, __m64 __m2) -{ - return _mm_subs_pu16 (__m1, __m2); -} - -/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing - four 32-bit intermediate results, which are then summed by pairs to - produce two 32-bit results. */ -static __inline __m64 -_mm_madd_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pmaddwd ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_pmaddwd (__m64 __m1, __m64 __m2) -{ - return _mm_madd_pi16 (__m1, __m2); -} - -/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in - M2 and produce the high 16 bits of the 32-bit results. */ -static __inline __m64 -_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pmulhw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_pmulhw (__m64 __m1, __m64 __m2) -{ - return _mm_mulhi_pi16 (__m1, __m2); -} - -/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce - the low 16 bits of the results. */ -static __inline __m64 -_mm_mullo_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pmullw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_pmullw (__m64 __m1, __m64 __m2) -{ - return _mm_mullo_pi16 (__m1, __m2); -} - -/* Shift four 16-bit values in M left by COUNT. */ -static __inline __m64 -_mm_sll_pi16 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (long long)__count); -} - -static __inline __m64 -_m_psllw (__m64 __m, __m64 __count) -{ - return _mm_sll_pi16 (__m, __count); -} - -static __inline __m64 -_mm_slli_pi16 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psllw ((__v4hi)__m, __count); -} - -static __inline __m64 -_m_psllwi (__m64 __m, int __count) -{ - return _mm_slli_pi16 (__m, __count); -} - -/* Shift two 32-bit values in M left by COUNT. */ -static __inline __m64 -_mm_sll_pi32 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_pslld ((__v2si)__m, (long long)__count); -} - -static __inline __m64 -_m_pslld (__m64 __m, __m64 __count) -{ - return _mm_sll_pi32 (__m, __count); -} - -static __inline __m64 -_mm_slli_pi32 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_pslld ((__v2si)__m, __count); -} - -static __inline __m64 -_m_pslldi (__m64 __m, int __count) -{ - return _mm_slli_pi32 (__m, __count); -} - -/* Shift the 64-bit value in M left by COUNT. */ -static __inline __m64 -_mm_sll_si64 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count); -} - -static __inline __m64 -_m_psllq (__m64 __m, __m64 __count) -{ - return _mm_sll_si64 (__m, __count); -} - -static __inline __m64 -_mm_slli_si64 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count); -} - -static __inline __m64 -_m_psllqi (__m64 __m, int __count) -{ - return _mm_slli_si64 (__m, __count); -} - -/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ -static __inline __m64 -_mm_sra_pi16 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (long long)__count); -} - -static __inline __m64 -_m_psraw (__m64 __m, __m64 __count) -{ - return _mm_sra_pi16 (__m, __count); -} - -static __inline __m64 -_mm_srai_pi16 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psraw ((__v4hi)__m, __count); -} - -static __inline __m64 -_m_psrawi (__m64 __m, int __count) -{ - return _mm_srai_pi16 (__m, __count); -} - -/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ -static __inline __m64 -_mm_sra_pi32 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psrad ((__v2si)__m, (long long)__count); -} - -static __inline __m64 -_m_psrad (__m64 __m, __m64 __count) -{ - return _mm_sra_pi32 (__m, __count); -} - -static __inline __m64 -_mm_srai_pi32 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psrad ((__v2si)__m, __count); -} - -static __inline __m64 -_m_psradi (__m64 __m, int __count) -{ - return _mm_srai_pi32 (__m, __count); -} - -/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ -static __inline __m64 -_mm_srl_pi16 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (long long)__count); -} - -static __inline __m64 -_m_psrlw (__m64 __m, __m64 __count) -{ - return _mm_srl_pi16 (__m, __count); -} - -static __inline __m64 -_mm_srli_pi16 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, __count); -} - -static __inline __m64 -_m_psrlwi (__m64 __m, int __count) -{ - return _mm_srli_pi16 (__m, __count); -} - -/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ -static __inline __m64 -_mm_srl_pi32 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psrld ((__v2si)__m, (long long)__count); -} - -static __inline __m64 -_m_psrld (__m64 __m, __m64 __count) -{ - return _mm_srl_pi32 (__m, __count); -} - -static __inline __m64 -_mm_srli_pi32 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psrld ((__v2si)__m, __count); -} - -static __inline __m64 -_m_psrldi (__m64 __m, int __count) -{ - return _mm_srli_pi32 (__m, __count); -} - -/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ -static __inline __m64 -_mm_srl_si64 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count); -} - -static __inline __m64 -_m_psrlq (__m64 __m, __m64 __count) -{ - return _mm_srl_si64 (__m, __count); -} - -static __inline __m64 -_mm_srli_si64 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count); -} - -static __inline __m64 -_m_psrlqi (__m64 __m, int __count) -{ - return _mm_srli_si64 (__m, __count); -} - -/* Bit-wise AND the 64-bit values in M1 and M2. */ -static __inline __m64 -_mm_and_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pand ((long long)__m1, (long long)__m2); -} - -static __inline __m64 -_m_pand (__m64 __m1, __m64 __m2) -{ - return _mm_and_si64 (__m1, __m2); -} - -/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the - 64-bit value in M2. */ -static __inline __m64 -_mm_andnot_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pandn ((long long)__m1, (long long)__m2); -} - -static __inline __m64 -_m_pandn (__m64 __m1, __m64 __m2) -{ - return _mm_andnot_si64 (__m1, __m2); -} - -/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ -static __inline __m64 -_mm_or_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64)__builtin_ia32_por ((long long)__m1, (long long)__m2); -} - -static __inline __m64 -_m_por (__m64 __m1, __m64 __m2) -{ - return _mm_or_si64 (__m1, __m2); -} - -/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ -static __inline __m64 -_mm_xor_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64)__builtin_ia32_pxor ((long long)__m1, (long long)__m2); -} - -static __inline __m64 -_m_pxor (__m64 __m1, __m64 __m2) -{ - return _mm_xor_si64 (__m1, __m2); -} - -/* Compare eight 8-bit values. The result of the comparison is 0xFF if the - test is true and zero if false. */ -static __inline __m64 -_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_pcmpeqb (__m64 __m1, __m64 __m2) -{ - return _mm_cmpeq_pi8 (__m1, __m2); -} - -static __inline __m64 -_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpgtb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_pcmpgtb (__m64 __m1, __m64 __m2) -{ - return _mm_cmpgt_pi8 (__m1, __m2); -} - -/* Compare four 16-bit values. The result of the comparison is 0xFFFF if - the test is true and zero if false. */ -static __inline __m64 -_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpeqw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_pcmpeqw (__m64 __m1, __m64 __m2) -{ - return _mm_cmpeq_pi16 (__m1, __m2); -} - -static __inline __m64 -_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpgtw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_pcmpgtw (__m64 __m1, __m64 __m2) -{ - return _mm_cmpgt_pi16 (__m1, __m2); -} - -/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if - the test is true and zero if false. */ -static __inline __m64 -_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpeqd ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_pcmpeqd (__m64 __m1, __m64 __m2) -{ - return _mm_cmpeq_pi32 (__m1, __m2); -} - -static __inline __m64 -_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_pcmpgtd (__m64 __m1, __m64 __m2) -{ - return _mm_cmpgt_pi32 (__m1, __m2); -} - -/* Creates a 64-bit zero. */ -static __inline __m64 -_mm_setzero_si64 (void) -{ - return (__m64)__builtin_ia32_mmx_zero (); -} - -/* Creates a vector of two 32-bit values; I0 is least significant. */ -static __inline __m64 -_mm_set_pi32 (int __i1, int __i0) -{ - union { - __m64 __q; - struct { - unsigned int __i0; - unsigned int __i1; - } __s; - } __u; - - __u.__s.__i0 = __i0; - __u.__s.__i1 = __i1; - - return __u.__q; -} - -/* Creates a vector of four 16-bit values; W0 is least significant. */ -static __inline __m64 -_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) -{ - unsigned int __i1 = (unsigned short)__w3 << 16 | (unsigned short)__w2; - unsigned int __i0 = (unsigned short)__w1 << 16 | (unsigned short)__w0; - return _mm_set_pi32 (__i1, __i0); - -} - -/* Creates a vector of eight 8-bit values; B0 is least significant. */ -static __inline __m64 -_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, - char __b3, char __b2, char __b1, char __b0) -{ - unsigned int __i1, __i0; - - __i1 = (unsigned char)__b7; - __i1 = __i1 << 8 | (unsigned char)__b6; - __i1 = __i1 << 8 | (unsigned char)__b5; - __i1 = __i1 << 8 | (unsigned char)__b4; - - __i0 = (unsigned char)__b3; - __i0 = __i0 << 8 | (unsigned char)__b2; - __i0 = __i0 << 8 | (unsigned char)__b1; - __i0 = __i0 << 8 | (unsigned char)__b0; - - return _mm_set_pi32 (__i1, __i0); -} - -/* Similar, but with the arguments in reverse order. */ -static __inline __m64 -_mm_setr_pi32 (int __i0, int __i1) -{ - return _mm_set_pi32 (__i1, __i0); -} - -static __inline __m64 -_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) -{ - return _mm_set_pi16 (__w3, __w2, __w1, __w0); -} - -static __inline __m64 -_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, - char __b4, char __b5, char __b6, char __b7) -{ - return _mm_set_pi8 (__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0); -} - -/* Creates a vector of two 32-bit values, both elements containing I. */ -static __inline __m64 -_mm_set1_pi32 (int __i) -{ - return _mm_set_pi32 (__i, __i); -} - -/* Creates a vector of four 16-bit values, all elements containing W. */ -static __inline __m64 -_mm_set1_pi16 (short __w) -{ - unsigned int __i = (unsigned short)__w << 16 | (unsigned short)__w; - return _mm_set1_pi32 (__i); -} - -/* Creates a vector of eight 8-bit values, all elements containing B. */ -static __inline __m64 -_mm_set1_pi8 (char __b) -{ - unsigned int __w = (unsigned char)__b << 8 | (unsigned char)__b; - unsigned int __i = __w << 16 | __w; - return _mm_set1_pi32 (__i); -} - -#endif /* __MMX__ */ -#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/pmmintrin.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/pmmintrin.h deleted file mode 100644 index 3b18e2a11bd..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/pmmintrin.h +++ /dev/null @@ -1,132 +0,0 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ - -#ifndef _PMMINTRIN_H_INCLUDED -#define _PMMINTRIN_H_INCLUDED - -#ifdef __SSE3__ -#include <xmmintrin.h> -#include <emmintrin.h> - -/* Additional bits in the MXCSR. */ -#define _MM_DENORMALS_ZERO_MASK 0x0040 -#define _MM_DENORMALS_ZERO_ON 0x0040 -#define _MM_DENORMALS_ZERO_OFF 0x0000 - -#define _MM_SET_DENORMALS_ZERO_MODE(mode) \ - _mm_setcsr ((_mm_getcsr () & ~_MM_DENORMALS_ZERO_MASK) | (mode)) -#define _MM_GET_DENORMALS_ZERO_MODE() \ - (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK) - -static __inline __m128 -_mm_addsub_ps (__m128 __X, __m128 __Y) -{ - return (__m128) __builtin_ia32_addsubps ((__v4sf)__X, (__v4sf)__Y); -} - -static __inline __m128 -_mm_hadd_ps (__m128 __X, __m128 __Y) -{ - return (__m128) __builtin_ia32_haddps ((__v4sf)__X, (__v4sf)__Y); -} - -static __inline __m128 -_mm_hsub_ps (__m128 __X, __m128 __Y) -{ - return (__m128) __builtin_ia32_hsubps ((__v4sf)__X, (__v4sf)__Y); -} - -static __inline __m128 -_mm_movehdup_ps (__m128 __X) -{ - return (__m128) __builtin_ia32_movshdup ((__v4sf)__X); -} - -static __inline __m128 -_mm_moveldup_ps (__m128 __X) -{ - return (__m128) __builtin_ia32_movsldup ((__v4sf)__X); -} - -static __inline __m128d -_mm_addsub_pd (__m128d __X, __m128d __Y) -{ - return (__m128d) __builtin_ia32_addsubpd ((__v2df)__X, (__v2df)__Y); -} - -static __inline __m128d -_mm_hadd_pd (__m128d __X, __m128d __Y) -{ - return (__m128d) __builtin_ia32_haddpd ((__v2df)__X, (__v2df)__Y); -} - -static __inline __m128d -_mm_hsub_pd (__m128d __X, __m128d __Y) -{ - return (__m128d) __builtin_ia32_hsubpd ((__v2df)__X, (__v2df)__Y); -} - -static __inline __m128d -_mm_loaddup_pd (double const *__P) -{ - return (__m128d) __builtin_ia32_loadddup (__P); -} - -static __inline __m128d -_mm_movedup_pd (__m128d __X) -{ - return (__m128d) __builtin_ia32_movddup ((__v2df)__X); -} - -static __inline __m128i -_mm_lddqu_si128 (__m128i const *__P) -{ - return (__m128i) __builtin_ia32_lddqu ((char const *)__P); -} - -#if 0 -static __inline void -_mm_monitor (void const * __P, unsigned int __E, unsigned int __H) -{ - __builtin_ia32_monitor (__P, __E, __H); -} - -static __inline void -_mm_mwait (unsigned int __E, unsigned int __H) -{ - __builtin_ia32_mwait (__E, __H); -} -#else -#define _mm_monitor(P, E, H) __builtin_ia32_monitor ((P), (E), (H)) -#define _mm_mwait(E, H) __builtin_ia32_mwait ((E), (H)) -#endif - -#endif /* __SSE3__ */ - -#endif /* _PMMINTRIN_H_INCLUDED */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/stdarg.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/stdarg.h deleted file mode 100644 index 965c2aa7e2c..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/stdarg.h +++ /dev/null @@ -1,135 +0,0 @@ -/* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* - * ISO C Standard: 7.15 Variable arguments <stdarg.h> - */ - -#ifndef _STDARG_H -#ifndef _ANSI_STDARG_H_ -#ifndef RC_INVOKED -#ifndef __need___va_list -#define _STDARG_H -#define _ANSI_STDARG_H_ -#endif /* not __need___va_list */ -#undef __need___va_list - -/* Define __gnuc_va_list. */ - -#ifndef __GNUC_VA_LIST -#define __GNUC_VA_LIST -typedef __builtin_va_list __gnuc_va_list; -#endif - -/* Define the standard macros for the user, - if this invocation was from the user program. */ -#ifdef _STDARG_H - -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L -#define va_copy(d,s) __builtin_va_copy(d,s) -#endif -#define __va_copy(d,s) __builtin_va_copy(d,s) - -/* Define va_list, if desired, from __gnuc_va_list. */ -/* We deliberately do not define va_list when called from - stdio.h, because ANSI C says that stdio.h is not supposed to define - va_list. stdio.h needs to have access to that data type, - but must not use that name. It should use the name __gnuc_va_list, - which is safe because it is reserved for the implementation. */ - -#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */ -#undef _VA_LIST -#endif - -#ifdef _BSD_VA_LIST -#undef _BSD_VA_LIST -#endif - -#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST)) -/* SVR4.2 uses _VA_LIST for an internal alias for va_list, - so we must avoid testing it and setting it here. - SVR4 uses _VA_LIST as a flag in stdarg.h, but we should - have no conflict with that. */ -#ifndef _VA_LIST_ -#define _VA_LIST_ -#ifdef __i860__ -#ifndef _VA_LIST -#define _VA_LIST va_list -#endif -#endif /* __i860__ */ -typedef __gnuc_va_list va_list; -#ifdef _SCO_DS -#define __VA_LIST -#endif -#endif /* _VA_LIST_ */ -#else /* not __svr4__ || _SCO_DS */ - -/* The macro _VA_LIST_ is the same thing used by this file in Ultrix. - But on BSD NET2 we must not test or define or undef it. - (Note that the comments in NET 2's ansi.h - are incorrect for _VA_LIST_--see stdio.h!) */ -#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) -/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ -#ifndef _VA_LIST_DEFINED -/* The macro _VA_LIST is used in SCO Unix 3.2. */ -#ifndef _VA_LIST -/* The macro _VA_LIST_T_H is used in the Bull dpx2 */ -#ifndef _VA_LIST_T_H -/* The macro __va_list__ is used by BeOS. */ -#ifndef __va_list__ -typedef __gnuc_va_list va_list; -#endif /* not __va_list__ */ -#endif /* not _VA_LIST_T_H */ -#endif /* not _VA_LIST */ -#endif /* not _VA_LIST_DEFINED */ -#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) -#define _VA_LIST_ -#endif -#ifndef _VA_LIST -#define _VA_LIST -#endif -#ifndef _VA_LIST_DEFINED -#define _VA_LIST_DEFINED -#endif -#ifndef _VA_LIST_T_H -#define _VA_LIST_T_H -#endif -#ifndef __va_list__ -#define __va_list__ -#endif - -#endif /* not _VA_LIST_, except on certain systems */ - -#endif /* not __svr4__ */ - -#endif /* _STDARG_H */ - -#endif /* not RC_INVOKED */ -#endif /* not _ANSI_STDARG_H_ */ -#endif /* not _STDARG_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/stdbool.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/stdbool.h deleted file mode 100644 index 93003e2b346..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/stdbool.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* - * ISO C Standard: 7.16 Boolean type and values <stdbool.h> - */ - -#ifndef _STDBOOL_H -#define _STDBOOL_H - -#ifndef __cplusplus - -#define bool _Bool -#define true 1 -#define false 0 - -#else /* __cplusplus */ - -/* Supporting <stdbool.h> in C++ is a GCC extension. */ -#define _Bool bool -#define bool bool -#define false false -#define true true - -#endif /* __cplusplus */ - -/* Signal that all the definitions are present. */ -#define __bool_true_false_are_defined 1 - -#endif /* stdbool.h */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/stddef.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/stddef.h deleted file mode 100644 index 03bfbf986e2..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/stddef.h +++ /dev/null @@ -1,426 +0,0 @@ -/* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* - * ISO C Standard: 7.17 Common definitions <stddef.h> - */ -#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \ - && !defined(__STDDEF_H__)) \ - || defined(__need_wchar_t) || defined(__need_size_t) \ - || defined(__need_ptrdiff_t) || defined(__need_NULL) \ - || defined(__need_wint_t) - -/* Any one of these symbols __need_* means that GNU libc - wants us just to define one data type. So don't define - the symbols that indicate this file's entire job has been done. */ -#if (!defined(__need_wchar_t) && !defined(__need_size_t) \ - && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \ - && !defined(__need_wint_t)) -#define _STDDEF_H -#define _STDDEF_H_ -/* snaroff@next.com says the NeXT needs this. */ -#define _ANSI_STDDEF_H -/* Irix 5.1 needs this. */ -#define __STDDEF_H__ -#endif - -#ifndef __sys_stdtypes_h -/* This avoids lossage on SunOS but only if stdtypes.h comes first. - There's no way to win with the other order! Sun lossage. */ - -/* On 4.3bsd-net2, make sure ansi.h is included, so we have - one less case to deal with in the following. */ -#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) -#include <machine/ansi.h> -#endif -/* On FreeBSD 5, machine/ansi.h does not exist anymore... */ -#if defined (__FreeBSD__) && (__FreeBSD__ >= 5) -#include <sys/_types.h> -#endif - -/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are - defined if the corresponding type is *not* defined. - FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */ -#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) -#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_) -#define _SIZE_T -#endif -#if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_) -#define _PTRDIFF_T -#endif -/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ - instead of _WCHAR_T_. */ -#if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_) -#ifndef _BSD_WCHAR_T_ -#define _WCHAR_T -#endif -#endif -/* Undef _FOO_T_ if we are supposed to define foo_t. */ -#if defined (__need_ptrdiff_t) || defined (_STDDEF_H_) -#undef _PTRDIFF_T_ -#undef _BSD_PTRDIFF_T_ -#endif -#if defined (__need_size_t) || defined (_STDDEF_H_) -#undef _SIZE_T_ -#undef _BSD_SIZE_T_ -#endif -#if defined (__need_wchar_t) || defined (_STDDEF_H_) -#undef _WCHAR_T_ -#undef _BSD_WCHAR_T_ -#endif -#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */ - -/* Sequent's header files use _PTRDIFF_T_ in some conflicting way. - Just ignore it. */ -#if defined (__sequent__) && defined (_PTRDIFF_T_) -#undef _PTRDIFF_T_ -#endif - -/* On VxWorks, <type/vxTypesBase.h> may have defined macros like - _TYPE_size_t which will typedef size_t. fixincludes patched the - vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is - not defined, and so that defining this macro defines _GCC_SIZE_T. - If we find that the macros are still defined at this point, we must - invoke them so that the type is defined as expected. */ -#if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_)) -_TYPE_ptrdiff_t; -#undef _TYPE_ptrdiff_t -#endif -#if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_)) -_TYPE_size_t; -#undef _TYPE_size_t -#endif -#if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_)) -_TYPE_wchar_t; -#undef _TYPE_wchar_t -#endif - -/* In case nobody has defined these types, but we aren't running under - GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and - __WCHAR_TYPE__ have reasonable values. This can happen if the - parts of GCC is compiled by an older compiler, that actually - include gstddef.h, such as collect2. */ - -/* Signed type of difference of two pointers. */ - -/* Define this type if we are doing the whole job, - or if we want this type in particular. */ -#if defined (_STDDEF_H) || defined (__need_ptrdiff_t) -#ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */ -#ifndef _T_PTRDIFF_ -#ifndef _T_PTRDIFF -#ifndef __PTRDIFF_T -#ifndef _PTRDIFF_T_ -#ifndef _BSD_PTRDIFF_T_ -#ifndef ___int_ptrdiff_t_h -#ifndef _GCC_PTRDIFF_T -#define _PTRDIFF_T -#define _T_PTRDIFF_ -#define _T_PTRDIFF -#define __PTRDIFF_T -#define _PTRDIFF_T_ -#define _BSD_PTRDIFF_T_ -#define ___int_ptrdiff_t_h -#define _GCC_PTRDIFF_T -#ifndef __PTRDIFF_TYPE__ -#define __PTRDIFF_TYPE__ long int -#endif -typedef __PTRDIFF_TYPE__ ptrdiff_t; -#endif /* _GCC_PTRDIFF_T */ -#endif /* ___int_ptrdiff_t_h */ -#endif /* _BSD_PTRDIFF_T_ */ -#endif /* _PTRDIFF_T_ */ -#endif /* __PTRDIFF_T */ -#endif /* _T_PTRDIFF */ -#endif /* _T_PTRDIFF_ */ -#endif /* _PTRDIFF_T */ - -/* If this symbol has done its job, get rid of it. */ -#undef __need_ptrdiff_t - -#endif /* _STDDEF_H or __need_ptrdiff_t. */ - -/* Unsigned type of `sizeof' something. */ - -/* Define this type if we are doing the whole job, - or if we want this type in particular. */ -#if defined (_STDDEF_H) || defined (__need_size_t) -#ifndef __size_t__ /* BeOS */ -#ifndef __SIZE_T__ /* Cray Unicos/Mk */ -#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */ -#ifndef _SYS_SIZE_T_H -#ifndef _T_SIZE_ -#ifndef _T_SIZE -#ifndef __SIZE_T -#ifndef _SIZE_T_ -#ifndef _BSD_SIZE_T_ -#ifndef _SIZE_T_DEFINED_ -#ifndef _SIZE_T_DEFINED -#ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */ -#ifndef _SIZE_T_DECLARED /* FreeBSD 5 */ -#ifndef ___int_size_t_h -#ifndef _GCC_SIZE_T -#ifndef _SIZET_ -#ifndef __size_t -#define __size_t__ /* BeOS */ -#define __SIZE_T__ /* Cray Unicos/Mk */ -#define _SIZE_T -#define _SYS_SIZE_T_H -#define _T_SIZE_ -#define _T_SIZE -#define __SIZE_T -#define _SIZE_T_ -#define _BSD_SIZE_T_ -#define _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED -#define _BSD_SIZE_T_DEFINED_ /* Darwin */ -#define _SIZE_T_DECLARED /* FreeBSD 5 */ -#define ___int_size_t_h -#define _GCC_SIZE_T -#define _SIZET_ -#if defined (__FreeBSD__) && (__FreeBSD__ >= 5) -/* __size_t is a typedef on FreeBSD 5!, must not trash it. */ -#else -#define __size_t -#endif -#ifndef __SIZE_TYPE__ -#define __SIZE_TYPE__ long unsigned int -#endif -#if !(defined (__GNUG__) && defined (size_t)) -typedef __SIZE_TYPE__ size_t; -#ifdef __BEOS__ -typedef long ssize_t; -#endif /* __BEOS__ */ -#endif /* !(defined (__GNUG__) && defined (size_t)) */ -#endif /* __size_t */ -#endif /* _SIZET_ */ -#endif /* _GCC_SIZE_T */ -#endif /* ___int_size_t_h */ -#endif /* _SIZE_T_DECLARED */ -#endif /* _BSD_SIZE_T_DEFINED_ */ -#endif /* _SIZE_T_DEFINED */ -#endif /* _SIZE_T_DEFINED_ */ -#endif /* _BSD_SIZE_T_ */ -#endif /* _SIZE_T_ */ -#endif /* __SIZE_T */ -#endif /* _T_SIZE */ -#endif /* _T_SIZE_ */ -#endif /* _SYS_SIZE_T_H */ -#endif /* _SIZE_T */ -#endif /* __SIZE_T__ */ -#endif /* __size_t__ */ -#undef __need_size_t -#endif /* _STDDEF_H or __need_size_t. */ - - -/* Wide character type. - Locale-writers should change this as necessary to - be big enough to hold unique values not between 0 and 127, - and not (wchar_t) -1, for each defined multibyte character. */ - -/* Define this type if we are doing the whole job, - or if we want this type in particular. */ -#if defined (_STDDEF_H) || defined (__need_wchar_t) -#ifndef __wchar_t__ /* BeOS */ -#ifndef __WCHAR_T__ /* Cray Unicos/Mk */ -#ifndef _WCHAR_T -#ifndef _T_WCHAR_ -#ifndef _T_WCHAR -#ifndef __WCHAR_T -#ifndef _WCHAR_T_ -#ifndef _BSD_WCHAR_T_ -#ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */ -#ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */ -#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */ -#ifndef _WCHAR_T_DEFINED_ -#ifndef _WCHAR_T_DEFINED -#ifndef _WCHAR_T_H -#ifndef ___int_wchar_t_h -#ifndef __INT_WCHAR_T_H -#ifndef _GCC_WCHAR_T -#define __wchar_t__ /* BeOS */ -#define __WCHAR_T__ /* Cray Unicos/Mk */ -#define _WCHAR_T -#define _T_WCHAR_ -#define _T_WCHAR -#define __WCHAR_T -#define _WCHAR_T_ -#define _BSD_WCHAR_T_ -#define _WCHAR_T_DEFINED_ -#define _WCHAR_T_DEFINED -#define _WCHAR_T_H -#define ___int_wchar_t_h -#define __INT_WCHAR_T_H -#define _GCC_WCHAR_T -#define _WCHAR_T_DECLARED - -/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ - instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other - symbols in the _FOO_T_ family, stays defined even after its - corresponding type is defined). If we define wchar_t, then we - must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if - we undef _WCHAR_T_, then we must also define rune_t, since - headers like runetype.h assume that if machine/ansi.h is included, - and _BSD_WCHAR_T_ is not defined, then rune_t is available. - machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of - the same type." */ -#ifdef _BSD_WCHAR_T_ -#undef _BSD_WCHAR_T_ -#ifdef _BSD_RUNE_T_ -#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) -typedef _BSD_RUNE_T_ rune_t; -#define _BSD_WCHAR_T_DEFINED_ -#define _BSD_RUNE_T_DEFINED_ /* Darwin */ -#if defined (__FreeBSD__) && (__FreeBSD__ < 5) -/* Why is this file so hard to maintain properly? In constrast to - the comment above regarding BSD/386 1.1, on FreeBSD for as long - as the symbol has existed, _BSD_RUNE_T_ must not stay defined or - redundant typedefs will occur when stdlib.h is included after this file. */ -#undef _BSD_RUNE_T_ -#endif -#endif -#endif -#endif -/* FreeBSD 5 can't be handled well using "traditional" logic above - since it no longer defines _BSD_RUNE_T_ yet still desires to export - rune_t in some cases... */ -#if defined (__FreeBSD__) && (__FreeBSD__ >= 5) -#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) -#if __BSD_VISIBLE -#ifndef _RUNE_T_DECLARED -typedef __rune_t rune_t; -#define _RUNE_T_DECLARED -#endif -#endif -#endif -#endif - -#ifndef __WCHAR_TYPE__ -#define __WCHAR_TYPE__ int -#endif -#ifndef __cplusplus -typedef __WCHAR_TYPE__ wchar_t; -#endif -#endif -#endif -#endif -#endif -#endif -#endif -#endif /* _WCHAR_T_DECLARED */ -#endif /* _BSD_RUNE_T_DEFINED_ */ -#endif -#endif -#endif -#endif -#endif -#endif -#endif -#endif /* __WCHAR_T__ */ -#endif /* __wchar_t__ */ -#undef __need_wchar_t -#endif /* _STDDEF_H or __need_wchar_t. */ - -#if defined (__need_wint_t) -#ifndef _WINT_T -#define _WINT_T - -#ifndef __WINT_TYPE__ -#define __WINT_TYPE__ unsigned int -#endif -typedef __WINT_TYPE__ wint_t; -#endif -#undef __need_wint_t -#endif - -/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. - are already defined. */ -/* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */ -#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) -/* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_ - are probably typos and should be removed before 2.8 is released. */ -#ifdef _GCC_PTRDIFF_T_ -#undef _PTRDIFF_T_ -#undef _BSD_PTRDIFF_T_ -#endif -#ifdef _GCC_SIZE_T_ -#undef _SIZE_T_ -#undef _BSD_SIZE_T_ -#endif -#ifdef _GCC_WCHAR_T_ -#undef _WCHAR_T_ -#undef _BSD_WCHAR_T_ -#endif -/* The following ones are the real ones. */ -#ifdef _GCC_PTRDIFF_T -#undef _PTRDIFF_T_ -#undef _BSD_PTRDIFF_T_ -#endif -#ifdef _GCC_SIZE_T -#undef _SIZE_T_ -#undef _BSD_SIZE_T_ -#endif -#ifdef _GCC_WCHAR_T -#undef _WCHAR_T_ -#undef _BSD_WCHAR_T_ -#endif -#endif /* _ANSI_H_ || _MACHINE_ANSI_H_ */ - -#endif /* __sys_stdtypes_h */ - -/* A null pointer constant. */ - -#if defined (_STDDEF_H) || defined (__need_NULL) -#undef NULL /* in case <stdio.h> has defined it. */ -#ifdef __GNUG__ -#define NULL __null -#else /* G++ */ -#ifndef __cplusplus -#define NULL ((void *)0) -#else /* C++ */ -#define NULL 0 -#endif /* C++ */ -#endif /* G++ */ -#endif /* NULL not defined and <stddef.h> or need NULL. */ -#undef __need_NULL - -#ifdef _STDDEF_H - -/* Offset of member MEMBER in a struct of type TYPE. */ -#ifndef __cplusplus -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#else -/* The cast to "char &" below avoids problems with user-defined - "operator &", which can appear in a POD type. */ -#define offsetof(TYPE, MEMBER) \ - (__offsetof__ (reinterpret_cast <size_t> \ - (&reinterpret_cast <const volatile char &> \ - (static_cast<TYPE *> (0)->MEMBER)))) -#endif /* C++ */ -#endif /* _STDDEF_H was defined this time */ - -#endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__ - || __need_XXX was not defined before */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/syslimits.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/syslimits.h deleted file mode 100644 index a3628025e8a..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/syslimits.h +++ /dev/null @@ -1,8 +0,0 @@ -/* syslimits.h stands for the system's own limits.h file. - If we can use it ok unmodified, then we install this text. - If fixincludes fixes it, then the fixed version is installed - instead of this text. */ - -#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */ -#include_next <limits.h> -#undef _GCC_NEXT_LIMITS_H diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/unwind.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/unwind.h deleted file mode 100644 index 21f3feb86bc..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/unwind.h +++ /dev/null @@ -1,232 +0,0 @@ -/* Exception handling and frame unwind runtime interface routines. - Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* This is derived from the C++ ABI for IA-64. Where we diverge - for cross-architecture compatibility are noted with "@@@". */ - -#ifndef _UNWIND_H -#define _UNWIND_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Level 1: Base ABI */ - -/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is - inefficient for 32-bit and smaller machines. */ -typedef unsigned _Unwind_Word __attribute__((__mode__(__word__))); -typedef signed _Unwind_Sword __attribute__((__mode__(__word__))); -#if defined(__ia64__) && defined(__hpux__) -typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__))); -#else -typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); -#endif -typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__))); - -/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and - consumer of an exception. We'll go along with this for now even on - 32-bit machines. We'll need to provide some other option for - 16-bit machines and for machines with > 8 bits per byte. */ -typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); - -/* The unwind interface uses reason codes in several contexts to - identify the reasons for failures or other actions. */ -typedef enum -{ - _URC_NO_REASON = 0, - _URC_FOREIGN_EXCEPTION_CAUGHT = 1, - _URC_FATAL_PHASE2_ERROR = 2, - _URC_FATAL_PHASE1_ERROR = 3, - _URC_NORMAL_STOP = 4, - _URC_END_OF_STACK = 5, - _URC_HANDLER_FOUND = 6, - _URC_INSTALL_CONTEXT = 7, - _URC_CONTINUE_UNWIND = 8 -} _Unwind_Reason_Code; - - -/* The unwind interface uses a pointer to an exception header object - as its representation of an exception being thrown. In general, the - full representation of an exception object is language- and - implementation-specific, but it will be prefixed by a header - understood by the unwind interface. */ - -struct _Unwind_Exception; - -typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, - struct _Unwind_Exception *); - -struct _Unwind_Exception -{ - _Unwind_Exception_Class exception_class; - _Unwind_Exception_Cleanup_Fn exception_cleanup; - _Unwind_Word private_1; - _Unwind_Word private_2; - - /* @@@ The IA-64 ABI says that this structure must be double-word aligned. - Taking that literally does not make much sense generically. Instead we - provide the maximum alignment required by any type for the machine. */ -} __attribute__((__aligned__)); - - -/* The ACTIONS argument to the personality routine is a bitwise OR of one - or more of the following constants. */ -typedef int _Unwind_Action; - -#define _UA_SEARCH_PHASE 1 -#define _UA_CLEANUP_PHASE 2 -#define _UA_HANDLER_FRAME 4 -#define _UA_FORCE_UNWIND 8 -#define _UA_END_OF_STACK 16 - -/* This is an opaque type used to refer to a system-specific data - structure used by the system unwinder. This context is created and - destroyed by the system, and passed to the personality routine - during unwinding. */ -struct _Unwind_Context; - -/* Raise an exception, passing along the given exception object. */ -extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *); - -/* Raise an exception for forced unwinding. */ - -typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) - (int, _Unwind_Action, _Unwind_Exception_Class, - struct _Unwind_Exception *, struct _Unwind_Context *, void *); - -extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *, - _Unwind_Stop_Fn, - void *); - -/* Helper to invoke the exception_cleanup routine. */ -extern void _Unwind_DeleteException (struct _Unwind_Exception *); - -/* Resume propagation of an existing exception. This is used after - e.g. executing cleanup code, and not to implement rethrowing. */ -extern void _Unwind_Resume (struct _Unwind_Exception *); - -/* @@@ Resume propagation of an FORCE_UNWIND exception, or to rethrow - a normal exception that was handled. */ -extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *); - -/* @@@ Use unwind data to perform a stack backtrace. The trace callback - is called for every stack frame in the call chain, but no cleanup - actions are performed. */ -typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) - (struct _Unwind_Context *, void *); - -extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); - -/* These functions are used for communicating information about the unwind - context (i.e. the unwind descriptors and the user register state) between - the unwind library and the personality routine and landing pad. Only - selected registers maybe manipulated. */ - -extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int); -extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word); - -extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *); -extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr); - -/* @@@ Retrieve the CFA of the given context. */ -extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *); - -extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *); - -extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *); - - -/* The personality routine is the function in the C++ (or other language) - runtime library which serves as an interface between the system unwind - library and language-specific exception handling semantics. It is - specific to the code fragment described by an unwind info block, and - it is always referenced via the pointer in the unwind info block, and - hence it has no ABI-specified name. - - Note that this implies that two different C++ implementations can - use different names, and have different contents in the language - specific data area. Moreover, that the language specific data - area contains no version info because name of the function invoked - provides more effective versioning by detecting at link time the - lack of code to handle the different data format. */ - -typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn) - (int, _Unwind_Action, _Unwind_Exception_Class, - struct _Unwind_Exception *, struct _Unwind_Context *); - -/* @@@ The following alternate entry points are for setjmp/longjmp - based unwinding. */ - -struct SjLj_Function_Context; -extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *); -extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *); - -extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException - (struct _Unwind_Exception *); -extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind - (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); -extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *); -extern _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *); - -/* @@@ The following provide access to the base addresses for text - and data-relative addressing in the LDSA. In order to stay link - compatible with the standard ABI for IA-64, we inline these. */ - -#ifdef __ia64__ -#include <stdlib.h> - -static inline _Unwind_Ptr -_Unwind_GetDataRelBase (struct _Unwind_Context *_C) -{ - /* The GP is stored in R1. */ - return _Unwind_GetGR (_C, 1); -} - -static inline _Unwind_Ptr -_Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__))) -{ - abort (); - return 0; -} - -/* @@@ Retrieve the Backing Store Pointer of the given context. */ -extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *); -#else -extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *); -extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *); -#endif - -/* @@@ Given an address, return the entry point of the function that - contains it. */ -extern void * _Unwind_FindEnclosingFunction (void *pc); - -#ifdef __cplusplus -} -#endif - -#endif /* unwind.h */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/varargs.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/varargs.h deleted file mode 100644 index 4b9803e71ac..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/varargs.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _VARARGS_H -#define _VARARGS_H - -#error "GCC no longer implements <varargs.h>." -#error "Revise your code to use <stdarg.h>." - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/xmmintrin.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/xmmintrin.h deleted file mode 100644 index aaf202792c7..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/xmmintrin.h +++ /dev/null @@ -1,1222 +0,0 @@ -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ - -#ifndef _XMMINTRIN_H_INCLUDED -#define _XMMINTRIN_H_INCLUDED - -#ifndef __SSE__ -# error "SSE instruction set not enabled" -#else - -/* We need type definitions from the MMX header file. */ -#include <mmintrin.h> - -/* Get _mm_malloc () and _mm_free (). */ -#include <mm_malloc.h> - -/* The data type intended for user use. */ -typedef float __m128 __attribute__ ((__mode__(__V4SF__))); - -/* Internal data types for implementing the intrinsics. */ -typedef float __v4sf __attribute__ ((__mode__(__V4SF__))); - -/* Create a selector for use with the SHUFPS instruction. */ -#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ - (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) - -/* Constants for use with _mm_prefetch. */ -enum _mm_hint -{ - _MM_HINT_T0 = 3, - _MM_HINT_T1 = 2, - _MM_HINT_T2 = 1, - _MM_HINT_NTA = 0 -}; - -/* Bits in the MXCSR. */ -#define _MM_EXCEPT_MASK 0x003f -#define _MM_EXCEPT_INVALID 0x0001 -#define _MM_EXCEPT_DENORM 0x0002 -#define _MM_EXCEPT_DIV_ZERO 0x0004 -#define _MM_EXCEPT_OVERFLOW 0x0008 -#define _MM_EXCEPT_UNDERFLOW 0x0010 -#define _MM_EXCEPT_INEXACT 0x0020 - -#define _MM_MASK_MASK 0x1f80 -#define _MM_MASK_INVALID 0x0080 -#define _MM_MASK_DENORM 0x0100 -#define _MM_MASK_DIV_ZERO 0x0200 -#define _MM_MASK_OVERFLOW 0x0400 -#define _MM_MASK_UNDERFLOW 0x0800 -#define _MM_MASK_INEXACT 0x1000 - -#define _MM_ROUND_MASK 0x6000 -#define _MM_ROUND_NEAREST 0x0000 -#define _MM_ROUND_DOWN 0x2000 -#define _MM_ROUND_UP 0x4000 -#define _MM_ROUND_TOWARD_ZERO 0x6000 - -#define _MM_FLUSH_ZERO_MASK 0x8000 -#define _MM_FLUSH_ZERO_ON 0x8000 -#define _MM_FLUSH_ZERO_OFF 0x0000 - -/* Perform the respective operation on the lower SPFP (single-precision - floating-point) values of A and B; the upper three SPFP values are - passed through from A. */ - -static __inline __m128 -_mm_add_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_sub_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_subss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_mul_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_div_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_divss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_sqrt_ss (__m128 __A) -{ - return (__m128) __builtin_ia32_sqrtss ((__v4sf)__A); -} - -static __inline __m128 -_mm_rcp_ss (__m128 __A) -{ - return (__m128) __builtin_ia32_rcpss ((__v4sf)__A); -} - -static __inline __m128 -_mm_rsqrt_ss (__m128 __A) -{ - return (__m128) __builtin_ia32_rsqrtss ((__v4sf)__A); -} - -static __inline __m128 -_mm_min_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_minss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_max_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_maxss ((__v4sf)__A, (__v4sf)__B); -} - -/* Perform the respective operation on the four SPFP values in A and B. */ - -static __inline __m128 -_mm_add_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_addps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_sub_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_subps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_mul_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_mulps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_div_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_divps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_sqrt_ps (__m128 __A) -{ - return (__m128) __builtin_ia32_sqrtps ((__v4sf)__A); -} - -static __inline __m128 -_mm_rcp_ps (__m128 __A) -{ - return (__m128) __builtin_ia32_rcpps ((__v4sf)__A); -} - -static __inline __m128 -_mm_rsqrt_ps (__m128 __A) -{ - return (__m128) __builtin_ia32_rsqrtps ((__v4sf)__A); -} - -static __inline __m128 -_mm_min_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_minps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_max_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_maxps ((__v4sf)__A, (__v4sf)__B); -} - -/* Perform logical bit-wise operations on 128-bit values. */ - -static __inline __m128 -_mm_and_ps (__m128 __A, __m128 __B) -{ - return __builtin_ia32_andps (__A, __B); -} - -static __inline __m128 -_mm_andnot_ps (__m128 __A, __m128 __B) -{ - return __builtin_ia32_andnps (__A, __B); -} - -static __inline __m128 -_mm_or_ps (__m128 __A, __m128 __B) -{ - return __builtin_ia32_orps (__A, __B); -} - -static __inline __m128 -_mm_xor_ps (__m128 __A, __m128 __B) -{ - return __builtin_ia32_xorps (__A, __B); -} - -/* Perform a comparison on the lower SPFP values of A and B. If the - comparison is true, place a mask of all ones in the result, otherwise a - mask of zeros. The upper three SPFP values are passed through from A. */ - -static __inline __m128 -_mm_cmpeq_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpeqss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmplt_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpltss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmple_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpless ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpgt_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movss ((__v4sf) __A, - (__v4sf) - __builtin_ia32_cmpltss ((__v4sf) __B, - (__v4sf) - __A)); -} - -static __inline __m128 -_mm_cmpge_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movss ((__v4sf) __A, - (__v4sf) - __builtin_ia32_cmpless ((__v4sf) __B, - (__v4sf) - __A)); -} - -static __inline __m128 -_mm_cmpneq_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpneqss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpnlt_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpnltss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpnle_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpnless ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpngt_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movss ((__v4sf) __A, - (__v4sf) - __builtin_ia32_cmpnltss ((__v4sf) __B, - (__v4sf) - __A)); -} - -static __inline __m128 -_mm_cmpnge_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movss ((__v4sf) __A, - (__v4sf) - __builtin_ia32_cmpnless ((__v4sf) __B, - (__v4sf) - __A)); -} - -static __inline __m128 -_mm_cmpord_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpordss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpunord_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpunordss ((__v4sf)__A, (__v4sf)__B); -} - -/* Perform a comparison on the four SPFP values of A and B. For each - element, if the comparison is true, place a mask of all ones in the - result, otherwise a mask of zeros. */ - -static __inline __m128 -_mm_cmpeq_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpeqps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmplt_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpltps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmple_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpleps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpgt_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpgtps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpge_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpgeps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpneq_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpneqps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpnlt_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpnltps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpnle_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpnleps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpngt_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpngtps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpnge_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpngeps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpord_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpordps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpunord_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpunordps ((__v4sf)__A, (__v4sf)__B); -} - -/* Compare the lower SPFP values of A and B and return 1 if true - and 0 if false. */ - -static __inline int -_mm_comieq_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comieq ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_comilt_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comilt ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_comile_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comile ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_comigt_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comigt ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_comige_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comige ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_comineq_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comineq ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomieq_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomieq ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomilt_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomilt ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomile_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomile ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomigt_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomigt ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomige_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomige ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomineq_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomineq ((__v4sf)__A, (__v4sf)__B); -} - -/* Convert the lower SPFP value to a 32-bit integer according to the current - rounding mode. */ -static __inline int -_mm_cvtss_si32 (__m128 __A) -{ - return __builtin_ia32_cvtss2si ((__v4sf) __A); -} - -static __inline int -_mm_cvt_ss2si (__m128 __A) -{ - return _mm_cvtss_si32 (__A); -} - -#ifdef __x86_64__ -/* Convert the lower SPFP value to a 32-bit integer according to the current - rounding mode. */ -static __inline long long -_mm_cvtss_si64x (__m128 __A) -{ - return __builtin_ia32_cvtss2si64 ((__v4sf) __A); -} -#endif - -/* Convert the two lower SPFP values to 32-bit integers according to the - current rounding mode. Return the integers in packed form. */ -static __inline __m64 -_mm_cvtps_pi32 (__m128 __A) -{ - return (__m64) __builtin_ia32_cvtps2pi ((__v4sf) __A); -} - -static __inline __m64 -_mm_cvt_ps2pi (__m128 __A) -{ - return _mm_cvtps_pi32 (__A); -} - -/* Truncate the lower SPFP value to a 32-bit integer. */ -static __inline int -_mm_cvttss_si32 (__m128 __A) -{ - return __builtin_ia32_cvttss2si ((__v4sf) __A); -} - -static __inline int -_mm_cvtt_ss2si (__m128 __A) -{ - return _mm_cvttss_si32 (__A); -} - -#ifdef __x86_64__ -/* Truncate the lower SPFP value to a 32-bit integer. */ -static __inline long long -_mm_cvttss_si64x (__m128 __A) -{ - return __builtin_ia32_cvttss2si64 ((__v4sf) __A); -} -#endif - -/* Truncate the two lower SPFP values to 32-bit integers. Return the - integers in packed form. */ -static __inline __m64 -_mm_cvttps_pi32 (__m128 __A) -{ - return (__m64) __builtin_ia32_cvttps2pi ((__v4sf) __A); -} - -static __inline __m64 -_mm_cvtt_ps2pi (__m128 __A) -{ - return _mm_cvttps_pi32 (__A); -} - -/* Convert B to a SPFP value and insert it as element zero in A. */ -static __inline __m128 -_mm_cvtsi32_ss (__m128 __A, int __B) -{ - return (__m128) __builtin_ia32_cvtsi2ss ((__v4sf) __A, __B); -} - -static __inline __m128 -_mm_cvt_si2ss (__m128 __A, int __B) -{ - return _mm_cvtsi32_ss (__A, __B); -} - -#ifdef __x86_64__ -/* Convert B to a SPFP value and insert it as element zero in A. */ -static __inline __m128 -_mm_cvtsi64x_ss (__m128 __A, long long __B) -{ - return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B); -} -#endif - -/* Convert the two 32-bit values in B to SPFP form and insert them - as the two lower elements in A. */ -static __inline __m128 -_mm_cvtpi32_ps (__m128 __A, __m64 __B) -{ - return (__m128) __builtin_ia32_cvtpi2ps ((__v4sf) __A, (__v2si)__B); -} - -static __inline __m128 -_mm_cvt_pi2ps (__m128 __A, __m64 __B) -{ - return _mm_cvtpi32_ps (__A, __B); -} - -/* Convert the four signed 16-bit values in A to SPFP form. */ -static __inline __m128 -_mm_cvtpi16_ps (__m64 __A) -{ - __v4hi __sign; - __v2si __hisi, __losi; - __v4sf __r; - - /* This comparison against zero gives us a mask that can be used to - fill in the missing sign bits in the unpack operations below, so - that we get signed values after unpacking. */ - __sign = (__v4hi) __builtin_ia32_mmx_zero (); - __sign = __builtin_ia32_pcmpgtw (__sign, (__v4hi)__A); - - /* Convert the four words to doublewords. */ - __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign); - __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign); - - /* Convert the doublewords to floating point two at a time. */ - __r = (__v4sf) __builtin_ia32_setzerops (); - __r = __builtin_ia32_cvtpi2ps (__r, __hisi); - __r = __builtin_ia32_movlhps (__r, __r); - __r = __builtin_ia32_cvtpi2ps (__r, __losi); - - return (__m128) __r; -} - -/* Convert the four unsigned 16-bit values in A to SPFP form. */ -static __inline __m128 -_mm_cvtpu16_ps (__m64 __A) -{ - __v4hi __zero = (__v4hi) __builtin_ia32_mmx_zero (); - __v2si __hisi, __losi; - __v4sf __r; - - /* Convert the four words to doublewords. */ - __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __zero); - __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __zero); - - /* Convert the doublewords to floating point two at a time. */ - __r = (__v4sf) __builtin_ia32_setzerops (); - __r = __builtin_ia32_cvtpi2ps (__r, __hisi); - __r = __builtin_ia32_movlhps (__r, __r); - __r = __builtin_ia32_cvtpi2ps (__r, __losi); - - return (__m128) __r; -} - -/* Convert the low four signed 8-bit values in A to SPFP form. */ -static __inline __m128 -_mm_cvtpi8_ps (__m64 __A) -{ - __v8qi __sign; - - /* This comparison against zero gives us a mask that can be used to - fill in the missing sign bits in the unpack operations below, so - that we get signed values after unpacking. */ - __sign = (__v8qi) __builtin_ia32_mmx_zero (); - __sign = __builtin_ia32_pcmpgtb (__sign, (__v8qi)__A); - - /* Convert the four low bytes to words. */ - __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, __sign); - - return _mm_cvtpi16_ps(__A); -} - -/* Convert the low four unsigned 8-bit values in A to SPFP form. */ -static __inline __m128 -_mm_cvtpu8_ps(__m64 __A) -{ - __v8qi __zero = (__v8qi) __builtin_ia32_mmx_zero (); - __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, __zero); - return _mm_cvtpu16_ps(__A); -} - -/* Convert the four signed 32-bit values in A and B to SPFP form. */ -static __inline __m128 -_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) -{ - __v4sf __zero = (__v4sf) __builtin_ia32_setzerops (); - __v4sf __sfa = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__A); - __v4sf __sfb = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__B); - return (__m128) __builtin_ia32_movlhps (__sfa, __sfb); -} - -/* Convert the four SPFP values in A to four signed 16-bit integers. */ -static __inline __m64 -_mm_cvtps_pi16(__m128 __A) -{ - __v4sf __hisf = (__v4sf)__A; - __v4sf __losf = __builtin_ia32_movhlps (__hisf, __hisf); - __v2si __hisi = __builtin_ia32_cvtps2pi (__hisf); - __v2si __losi = __builtin_ia32_cvtps2pi (__losf); - return (__m64) __builtin_ia32_packssdw (__hisi, __losi); -} - -/* Convert the four SPFP values in A to four signed 8-bit integers. */ -static __inline __m64 -_mm_cvtps_pi8(__m128 __A) -{ - __v4hi __tmp = (__v4hi) _mm_cvtps_pi16 (__A); - __v4hi __zero = (__v4hi) __builtin_ia32_mmx_zero (); - return (__m64) __builtin_ia32_packsswb (__tmp, __zero); -} - -/* Selects four specific SPFP values from A and B based on MASK. */ -#if 0 -static __inline __m128 -_mm_shuffle_ps (__m128 __A, __m128 __B, int __mask) -{ - return (__m128) __builtin_ia32_shufps ((__v4sf)__A, (__v4sf)__B, __mask); -} -#else -#define _mm_shuffle_ps(A, B, MASK) \ - ((__m128) __builtin_ia32_shufps ((__v4sf)(A), (__v4sf)(B), (MASK))) -#endif - - -/* Selects and interleaves the upper two SPFP values from A and B. */ -static __inline __m128 -_mm_unpackhi_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_unpckhps ((__v4sf)__A, (__v4sf)__B); -} - -/* Selects and interleaves the lower two SPFP values from A and B. */ -static __inline __m128 -_mm_unpacklo_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_unpcklps ((__v4sf)__A, (__v4sf)__B); -} - -/* Sets the upper two SPFP values with 64-bits of data loaded from P; - the lower two values are passed through from A. */ -static __inline __m128 -_mm_loadh_pi (__m128 __A, __m64 const *__P) -{ - return (__m128) __builtin_ia32_loadhps ((__v4sf)__A, (__v2si *)__P); -} - -/* Stores the upper two SPFP values of A into P. */ -static __inline void -_mm_storeh_pi (__m64 *__P, __m128 __A) -{ - __builtin_ia32_storehps ((__v2si *)__P, (__v4sf)__A); -} - -/* Moves the upper two values of B into the lower two values of A. */ -static __inline __m128 -_mm_movehl_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movhlps ((__v4sf)__A, (__v4sf)__B); -} - -/* Moves the lower two values of B into the upper two values of A. */ -static __inline __m128 -_mm_movelh_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movlhps ((__v4sf)__A, (__v4sf)__B); -} - -/* Sets the lower two SPFP values with 64-bits of data loaded from P; - the upper two values are passed through from A. */ -static __inline __m128 -_mm_loadl_pi (__m128 __A, __m64 const *__P) -{ - return (__m128) __builtin_ia32_loadlps ((__v4sf)__A, (__v2si *)__P); -} - -/* Stores the lower two SPFP values of A into P. */ -static __inline void -_mm_storel_pi (__m64 *__P, __m128 __A) -{ - __builtin_ia32_storelps ((__v2si *)__P, (__v4sf)__A); -} - -/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ -static __inline int -_mm_movemask_ps (__m128 __A) -{ - return __builtin_ia32_movmskps ((__v4sf)__A); -} - -/* Return the contents of the control register. */ -static __inline unsigned int -_mm_getcsr (void) -{ - return __builtin_ia32_stmxcsr (); -} - -/* Read exception bits from the control register. */ -static __inline unsigned int -_MM_GET_EXCEPTION_STATE (void) -{ - return _mm_getcsr() & _MM_EXCEPT_MASK; -} - -static __inline unsigned int -_MM_GET_EXCEPTION_MASK (void) -{ - return _mm_getcsr() & _MM_MASK_MASK; -} - -static __inline unsigned int -_MM_GET_ROUNDING_MODE (void) -{ - return _mm_getcsr() & _MM_ROUND_MASK; -} - -static __inline unsigned int -_MM_GET_FLUSH_ZERO_MODE (void) -{ - return _mm_getcsr() & _MM_FLUSH_ZERO_MASK; -} - -/* Set the control register to I. */ -static __inline void -_mm_setcsr (unsigned int __I) -{ - __builtin_ia32_ldmxcsr (__I); -} - -/* Set exception bits in the control register. */ -static __inline void -_MM_SET_EXCEPTION_STATE(unsigned int __mask) -{ - _mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | __mask); -} - -static __inline void -_MM_SET_EXCEPTION_MASK (unsigned int __mask) -{ - _mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | __mask); -} - -static __inline void -_MM_SET_ROUNDING_MODE (unsigned int __mode) -{ - _mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | __mode); -} - -static __inline void -_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) -{ - _mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | __mode); -} - -/* Create a vector with element 0 as *P and the rest zero. */ -static __inline __m128 -_mm_load_ss (float const *__P) -{ - return (__m128) __builtin_ia32_loadss (__P); -} - -/* Create a vector with all four elements equal to *P. */ -static __inline __m128 -_mm_load1_ps (float const *__P) -{ - __v4sf __tmp = __builtin_ia32_loadss (__P); - return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,0,0,0)); -} - -static __inline __m128 -_mm_load_ps1 (float const *__P) -{ - return _mm_load1_ps (__P); -} - -/* Load four SPFP values from P. The address must be 16-byte aligned. */ -static __inline __m128 -_mm_load_ps (float const *__P) -{ - return (__m128) __builtin_ia32_loadaps (__P); -} - -/* Load four SPFP values from P. The address need not be 16-byte aligned. */ -static __inline __m128 -_mm_loadu_ps (float const *__P) -{ - return (__m128) __builtin_ia32_loadups (__P); -} - -/* Load four SPFP values in reverse order. The address must be aligned. */ -static __inline __m128 -_mm_loadr_ps (float const *__P) -{ - __v4sf __tmp = __builtin_ia32_loadaps (__P); - return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,1,2,3)); -} - -/* Create a vector with element 0 as F and the rest zero. */ -static __inline __m128 -_mm_set_ss (float __F) -{ - return (__m128) __builtin_ia32_loadss (&__F); -} - -/* Create a vector with all four elements equal to F. */ -static __inline __m128 -_mm_set1_ps (float __F) -{ - __v4sf __tmp = __builtin_ia32_loadss (&__F); - return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,0,0,0)); -} - -static __inline __m128 -_mm_set_ps1 (float __F) -{ - return _mm_set1_ps (__F); -} - -/* Create the vector [Z Y X W]. */ -static __inline __m128 -_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) -{ - return (__v4sf) {__W, __X, __Y, __Z}; -} - -/* Create the vector [W X Y Z]. */ -static __inline __m128 -_mm_setr_ps (float __Z, float __Y, float __X, float __W) -{ - return _mm_set_ps (__W, __X, __Y, __Z); -} - -/* Create a vector of zeros. */ -static __inline __m128 -_mm_setzero_ps (void) -{ - return (__m128) __builtin_ia32_setzerops (); -} - -/* Stores the lower SPFP value. */ -static __inline void -_mm_store_ss (float *__P, __m128 __A) -{ - __builtin_ia32_storess (__P, (__v4sf)__A); -} - -/* Store the lower SPFP value across four words. */ -static __inline void -_mm_store1_ps (float *__P, __m128 __A) -{ - __v4sf __va = (__v4sf)__A; - __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,0,0,0)); - __builtin_ia32_storeaps (__P, __tmp); -} - -static __inline void -_mm_store_ps1 (float *__P, __m128 __A) -{ - _mm_store1_ps (__P, __A); -} - -/* Store four SPFP values. The address must be 16-byte aligned. */ -static __inline void -_mm_store_ps (float *__P, __m128 __A) -{ - __builtin_ia32_storeaps (__P, (__v4sf)__A); -} - -/* Store four SPFP values. The address need not be 16-byte aligned. */ -static __inline void -_mm_storeu_ps (float *__P, __m128 __A) -{ - __builtin_ia32_storeups (__P, (__v4sf)__A); -} - -/* Store four SPFP values in reverse order. The address must be aligned. */ -static __inline void -_mm_storer_ps (float *__P, __m128 __A) -{ - __v4sf __va = (__v4sf)__A; - __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,1,2,3)); - __builtin_ia32_storeaps (__P, __tmp); -} - -/* Sets the low SPFP value of A from the low value of B. */ -static __inline __m128 -_mm_move_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movss ((__v4sf)__A, (__v4sf)__B); -} - -/* Extracts one of the four words of A. The selector N must be immediate. */ -#if 0 -static __inline int -_mm_extract_pi16 (__m64 __A, int __N) -{ - return __builtin_ia32_pextrw ((__v4hi)__A, __N); -} - -static __inline int -_m_pextrw (__m64 __A, int __N) -{ - return _mm_extract_pi16 (__A, __N); -} -#else -#define _mm_extract_pi16(A, N) \ - __builtin_ia32_pextrw ((__v4hi)(A), (N)) -#define _m_pextrw(A, N) _mm_extract_pi16((A), (N)) -#endif - -/* Inserts word D into one of four words of A. The selector N must be - immediate. */ -#if 0 -static __inline __m64 -_mm_insert_pi16 (__m64 __A, int __D, int __N) -{ - return (__m64)__builtin_ia32_pinsrw ((__v4hi)__A, __D, __N); -} - -static __inline __m64 -_m_pinsrw (__m64 __A, int __D, int __N) -{ - return _mm_insert_pi16 (__A, __D, __N); -} -#else -#define _mm_insert_pi16(A, D, N) \ - ((__m64) __builtin_ia32_pinsrw ((__v4hi)(A), (D), (N))) -#define _m_pinsrw(A, D, N) _mm_insert_pi16((A), (D), (N)) -#endif - -/* Compute the element-wise maximum of signed 16-bit values. */ -static __inline __m64 -_mm_max_pi16 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pmaxsw ((__v4hi)__A, (__v4hi)__B); -} - -static __inline __m64 -_m_pmaxsw (__m64 __A, __m64 __B) -{ - return _mm_max_pi16 (__A, __B); -} - -/* Compute the element-wise maximum of unsigned 8-bit values. */ -static __inline __m64 -_mm_max_pu8 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pmaxub ((__v8qi)__A, (__v8qi)__B); -} - -static __inline __m64 -_m_pmaxub (__m64 __A, __m64 __B) -{ - return _mm_max_pu8 (__A, __B); -} - -/* Compute the element-wise minimum of signed 16-bit values. */ -static __inline __m64 -_mm_min_pi16 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pminsw ((__v4hi)__A, (__v4hi)__B); -} - -static __inline __m64 -_m_pminsw (__m64 __A, __m64 __B) -{ - return _mm_min_pi16 (__A, __B); -} - -/* Compute the element-wise minimum of unsigned 8-bit values. */ -static __inline __m64 -_mm_min_pu8 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pminub ((__v8qi)__A, (__v8qi)__B); -} - -static __inline __m64 -_m_pminub (__m64 __A, __m64 __B) -{ - return _mm_min_pu8 (__A, __B); -} - -/* Create an 8-bit mask of the signs of 8-bit values. */ -static __inline int -_mm_movemask_pi8 (__m64 __A) -{ - return __builtin_ia32_pmovmskb ((__v8qi)__A); -} - -static __inline int -_m_pmovmskb (__m64 __A) -{ - return _mm_movemask_pi8 (__A); -} - -/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values - in B and produce the high 16 bits of the 32-bit results. */ -static __inline __m64 -_mm_mulhi_pu16 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pmulhuw ((__v4hi)__A, (__v4hi)__B); -} - -static __inline __m64 -_m_pmulhuw (__m64 __A, __m64 __B) -{ - return _mm_mulhi_pu16 (__A, __B); -} - -/* Return a combination of the four 16-bit values in A. The selector - must be an immediate. */ -#if 0 -static __inline __m64 -_mm_shuffle_pi16 (__m64 __A, int __N) -{ - return (__m64) __builtin_ia32_pshufw ((__v4hi)__A, __N); -} - -static __inline __m64 -_m_pshufw (__m64 __A, int __N) -{ - return _mm_shuffle_pi16 (__A, __N); -} -#else -#define _mm_shuffle_pi16(A, N) \ - ((__m64) __builtin_ia32_pshufw ((__v4hi)(A), (N))) -#define _m_pshufw(A, N) _mm_shuffle_pi16 ((A), (N)) -#endif - -/* Conditionally store byte elements of A into P. The high bit of each - byte in the selector N determines whether the corresponding byte from - A is stored. */ -static __inline void -_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) -{ - __builtin_ia32_maskmovq ((__v8qi)__A, (__v8qi)__N, __P); -} - -static __inline void -_m_maskmovq (__m64 __A, __m64 __N, char *__P) -{ - _mm_maskmove_si64 (__A, __N, __P); -} - -/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ -static __inline __m64 -_mm_avg_pu8 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pavgb ((__v8qi)__A, (__v8qi)__B); -} - -static __inline __m64 -_m_pavgb (__m64 __A, __m64 __B) -{ - return _mm_avg_pu8 (__A, __B); -} - -/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ -static __inline __m64 -_mm_avg_pu16 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pavgw ((__v4hi)__A, (__v4hi)__B); -} - -static __inline __m64 -_m_pavgw (__m64 __A, __m64 __B) -{ - return _mm_avg_pu16 (__A, __B); -} - -/* Compute the sum of the absolute differences of the unsigned 8-bit - values in A and B. Return the value in the lower 16-bit word; the - upper words are cleared. */ -static __inline __m64 -_mm_sad_pu8 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_psadbw ((__v8qi)__A, (__v8qi)__B); -} - -static __inline __m64 -_m_psadbw (__m64 __A, __m64 __B) -{ - return _mm_sad_pu8 (__A, __B); -} - -/* Loads one cache line from address P to a location "closer" to the - processor. The selector I specifies the type of prefetch operation. */ -#if 0 -static __inline void -_mm_prefetch (void *__P, enum _mm_hint __I) -{ - __builtin_prefetch (__P, 0, __I); -} -#else -#define _mm_prefetch(P, I) \ - __builtin_prefetch ((P), 0, (I)) -#endif - -/* Stores the data in A to the address P without polluting the caches. */ -static __inline void -_mm_stream_pi (__m64 *__P, __m64 __A) -{ - __builtin_ia32_movntq ((unsigned long long *)__P, (unsigned long long)__A); -} - -/* Likewise. The address must be 16-byte aligned. */ -static __inline void -_mm_stream_ps (float *__P, __m128 __A) -{ - __builtin_ia32_movntps (__P, (__v4sf)__A); -} - -/* Guarantees that every preceding store is globally visible before - any subsequent store. */ -static __inline void -_mm_sfence (void) -{ - __builtin_ia32_sfence (); -} - -/* The execution of the next instruction is delayed by an implementation - specific amount of time. The instruction does not modify the - architectural state. */ -static __inline void -_mm_pause (void) -{ - __asm__ __volatile__ ("rep; nop" : : ); -} - -/* Transpose the 4x4 matrix composed of row[0-3]. */ -#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ -do { \ - __v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \ - __v4sf __t0 = __builtin_ia32_shufps (__r0, __r1, 0x44); \ - __v4sf __t2 = __builtin_ia32_shufps (__r0, __r1, 0xEE); \ - __v4sf __t1 = __builtin_ia32_shufps (__r2, __r3, 0x44); \ - __v4sf __t3 = __builtin_ia32_shufps (__r2, __r3, 0xEE); \ - (row0) = __builtin_ia32_shufps (__t0, __t1, 0x88); \ - (row1) = __builtin_ia32_shufps (__t0, __t1, 0xDD); \ - (row2) = __builtin_ia32_shufps (__t2, __t3, 0x88); \ - (row3) = __builtin_ia32_shufps (__t2, __t3, 0xDD); \ -} while (0) - -/* For backward source compatibility. */ -#include <emmintrin.h> - -#endif /* __SSE__ */ -#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/fixinc.sh b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/fixinc.sh deleted file mode 100755 index 20f87efe15d..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/fixinc.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -exit 0 diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/gsyslimits.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/gsyslimits.h deleted file mode 100644 index a3628025e8a..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/gsyslimits.h +++ /dev/null @@ -1,8 +0,0 @@ -/* syslimits.h stands for the system's own limits.h file. - If we can use it ok unmodified, then we install this text. - If fixincludes fixes it, then the fixed version is installed - instead of this text. */ - -#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */ -#include_next <limits.h> -#undef _GCC_NEXT_LIMITS_H diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/README b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/README deleted file mode 100644 index 7086a7782d4..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/README +++ /dev/null @@ -1,14 +0,0 @@ -This README file is copied into the directory for GCC-only header files -when fixincludes is run by the makefile for GCC. - -Many of the files in this directory were automatically edited from the -standard system header files by the fixincludes process. They are -system-specific, and will not work on any other kind of system. They -are also not part of GCC. The reason we have to do this is because -GCC requires ANSI C headers and many vendors supply ANSI-incompatible -headers. - -Because this is an automated process, sometimes headers get "fixed" -that do not, strictly speaking, need a fix. As long as nothing is broken -by the process, it is just an unfortunate collateral inconvenience. -We would like to rectify it, if it is not "too inconvenient". diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/emmintrin.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/emmintrin.h deleted file mode 100644 index 286906324a5..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/emmintrin.h +++ /dev/null @@ -1,1491 +0,0 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ - -#ifndef _EMMINTRIN_H_INCLUDED -#define _EMMINTRIN_H_INCLUDED - -#ifdef __SSE2__ -#include <xmmintrin.h> - -/* SSE2 */ -typedef double __v2df __attribute__ ((mode (V2DF))); -typedef int __v2di __attribute__ ((mode (V2DI))); -typedef int __v4si __attribute__ ((mode (V4SI))); -typedef int __v8hi __attribute__ ((mode (V8HI))); -typedef int __v16qi __attribute__ ((mode (V16QI))); - -/* Create a selector for use with the SHUFPD instruction. */ -#define _MM_SHUFFLE2(fp1,fp0) \ - (((fp1) << 1) | (fp0)) - -#define __m128i __v2di -#define __m128d __v2df - -/* Create a vector with element 0 as *P and the rest zero. */ -static __inline __m128d -_mm_load_sd (double const *__P) -{ - return (__m128d) __builtin_ia32_loadsd (__P); -} - -/* Create a vector with all two elements equal to *P. */ -static __inline __m128d -_mm_load1_pd (double const *__P) -{ - __v2df __tmp = __builtin_ia32_loadsd (__P); - return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,0)); -} - -static __inline __m128d -_mm_load_pd1 (double const *__P) -{ - return _mm_load1_pd (__P); -} - -/* Load two DPFP values from P. The address must be 16-byte aligned. */ -static __inline __m128d -_mm_load_pd (double const *__P) -{ - return (__m128d) __builtin_ia32_loadapd (__P); -} - -/* Load two DPFP values from P. The address need not be 16-byte aligned. */ -static __inline __m128d -_mm_loadu_pd (double const *__P) -{ - return (__m128d) __builtin_ia32_loadupd (__P); -} - -/* Load two DPFP values in reverse order. The address must be aligned. */ -static __inline __m128d -_mm_loadr_pd (double const *__P) -{ - __v2df __tmp = __builtin_ia32_loadapd (__P); - return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,1)); -} - -/* Create a vector with element 0 as F and the rest zero. */ -static __inline __m128d -_mm_set_sd (double __F) -{ - return (__m128d) __builtin_ia32_loadsd (&__F); -} - -/* Create a vector with all two elements equal to F. */ -static __inline __m128d -_mm_set1_pd (double __F) -{ - __v2df __tmp = __builtin_ia32_loadsd (&__F); - return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,0)); -} - -static __inline __m128d -_mm_set_pd1 (double __F) -{ - return _mm_set1_pd (__F); -} - -/* Create the vector [Z Y]. */ -static __inline __m128d -_mm_set_pd (double __Z, double __Y) -{ - return (__v2df) {__Y, __Z}; -} - -/* Create the vector [Y Z]. */ -static __inline __m128d -_mm_setr_pd (double __Z, double __Y) -{ - return _mm_set_pd (__Y, __Z); -} - -/* Create a vector of zeros. */ -static __inline __m128d -_mm_setzero_pd (void) -{ - return (__m128d) __builtin_ia32_setzeropd (); -} - -/* Stores the lower DPFP value. */ -static __inline void -_mm_store_sd (double *__P, __m128d __A) -{ - __builtin_ia32_storesd (__P, (__v2df)__A); -} - -/* Store the lower DPFP value across two words. */ -static __inline void -_mm_store1_pd (double *__P, __m128d __A) -{ - __v2df __va = (__v2df)__A; - __v2df __tmp = __builtin_ia32_shufpd (__va, __va, _MM_SHUFFLE2 (0,0)); - __builtin_ia32_storeapd (__P, __tmp); -} - -static __inline void -_mm_store_pd1 (double *__P, __m128d __A) -{ - _mm_store1_pd (__P, __A); -} - -/* Store two DPFP values. The address must be 16-byte aligned. */ -static __inline void -_mm_store_pd (double *__P, __m128d __A) -{ - __builtin_ia32_storeapd (__P, (__v2df)__A); -} - -/* Store two DPFP values. The address need not be 16-byte aligned. */ -static __inline void -_mm_storeu_pd (double *__P, __m128d __A) -{ - __builtin_ia32_storeupd (__P, (__v2df)__A); -} - -/* Store two DPFP values in reverse order. The address must be aligned. */ -static __inline void -_mm_storer_pd (double *__P, __m128d __A) -{ - __v2df __va = (__v2df)__A; - __v2df __tmp = __builtin_ia32_shufpd (__va, __va, _MM_SHUFFLE2 (0,1)); - __builtin_ia32_storeapd (__P, __tmp); -} - -/* Sets the low DPFP value of A from the low value of B. */ -static __inline __m128d -_mm_move_sd (__m128d __A, __m128d __B) -{ - return (__m128d) __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B); -} - - -static __inline __m128d -_mm_add_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_addpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_add_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_addsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_sub_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_subpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_sub_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_subsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_mul_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_mulpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_mul_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_mulsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_div_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_divpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_div_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_divsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_sqrt_pd (__m128d __A) -{ - return (__m128d)__builtin_ia32_sqrtpd ((__v2df)__A); -} - -/* Return pair {sqrt (A[0), B[1]}. */ -static __inline __m128d -_mm_sqrt_sd (__m128d __A, __m128d __B) -{ - __v2df __tmp = __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B); - return (__m128d)__builtin_ia32_sqrtsd ((__v2df)__tmp); -} - -static __inline __m128d -_mm_min_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_minpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_min_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_minsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_max_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_maxpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_max_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_maxsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_and_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_andpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_andnot_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_andnpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_or_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_orpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_xor_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_xorpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpeq_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpeqpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmplt_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpltpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmple_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmplepd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpgt_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpgtpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpge_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpgepd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpneq_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpneqpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpnlt_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpnltpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpnle_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpnlepd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpngt_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpngtpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpnge_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpngepd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpord_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpordpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpunord_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpunordpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpeq_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpeqsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmplt_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpltsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmple_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmplesd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpgt_sd (__m128d __A, __m128d __B) -{ - return (__m128d) __builtin_ia32_movsd ((__v2df) __A, - (__v2df) - __builtin_ia32_cmpltsd ((__v2df) __B, - (__v2df) - __A)); -} - -static __inline __m128d -_mm_cmpge_sd (__m128d __A, __m128d __B) -{ - return (__m128d) __builtin_ia32_movsd ((__v2df) __A, - (__v2df) - __builtin_ia32_cmplesd ((__v2df) __B, - (__v2df) - __A)); -} - -static __inline __m128d -_mm_cmpneq_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpneqsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpnlt_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpnltsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpnle_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpnlesd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpngt_sd (__m128d __A, __m128d __B) -{ - return (__m128d) __builtin_ia32_movsd ((__v2df) __A, - (__v2df) - __builtin_ia32_cmpnltsd ((__v2df) __B, - (__v2df) - __A)); -} - -static __inline __m128d -_mm_cmpnge_sd (__m128d __A, __m128d __B) -{ - return (__m128d) __builtin_ia32_movsd ((__v2df) __A, - (__v2df) - __builtin_ia32_cmpnlesd ((__v2df) __B, - (__v2df) - __A)); -} - -static __inline __m128d -_mm_cmpord_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpordsd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_cmpunord_sd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_cmpunordsd ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comieq_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdeq ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comilt_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdlt ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comile_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdle ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comigt_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdgt ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comige_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdge ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_comineq_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_comisdneq ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomieq_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdeq ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomilt_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdlt ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomile_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdle ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomigt_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdgt ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomige_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdge ((__v2df)__A, (__v2df)__B); -} - -static __inline int -_mm_ucomineq_sd (__m128d __A, __m128d __B) -{ - return __builtin_ia32_ucomisdneq ((__v2df)__A, (__v2df)__B); -} - -/* Create a vector with element 0 as *P and the rest zero. */ - -static __inline __m128i -_mm_load_si128 (__m128i const *__P) -{ - return (__m128i) __builtin_ia32_loaddqa ((char const *)__P); -} - -static __inline __m128i -_mm_loadu_si128 (__m128i const *__P) -{ - return (__m128i) __builtin_ia32_loaddqu ((char const *)__P); -} - -static __inline __m128i -_mm_loadl_epi64 (__m128i const *__P) -{ - return (__m128i) __builtin_ia32_movq2dq (*(unsigned long long *)__P); -} - -static __inline void -_mm_store_si128 (__m128i *__P, __m128i __B) -{ - __builtin_ia32_storedqa ((char *)__P, (__v16qi)__B); -} - -static __inline void -_mm_storeu_si128 (__m128i *__P, __m128i __B) -{ - __builtin_ia32_storedqu ((char *)__P, (__v16qi)__B); -} - -static __inline void -_mm_storel_epi64 (__m128i *__P, __m128i __B) -{ - *(long long *)__P = __builtin_ia32_movdq2q ((__v2di)__B); -} - -static __inline __m64 -_mm_movepi64_pi64 (__m128i __B) -{ - return (__m64) __builtin_ia32_movdq2q ((__v2di)__B); -} - -static __inline __m128i -_mm_move_epi64 (__m128i __A) -{ - return (__m128i) __builtin_ia32_movq ((__v2di)__A); -} - -/* Create a vector of zeros. */ -static __inline __m128i -_mm_setzero_si128 (void) -{ - return (__m128i) __builtin_ia32_setzero128 (); -} - -static __inline __m128i -_mm_set_epi64 (__m64 __A, __m64 __B) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - __v2di __tmp2 = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__B); - return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp2, __tmp); -} - -/* Create the vector [Z Y X W]. */ -static __inline __m128i -_mm_set_epi32 (int __Z, int __Y, int __X, int __W) -{ - union { - int __a[4]; - __m128i __v; - } __u; - - __u.__a[0] = __W; - __u.__a[1] = __X; - __u.__a[2] = __Y; - __u.__a[3] = __Z; - - return __u.__v; -} - -#ifdef __x86_64__ -/* Create the vector [Z Y]. */ -static __inline __m128i -_mm_set_epi64x (long long __Z, long long __Y) -{ - union { - long __a[2]; - __m128i __v; - } __u; - - __u.__a[0] = __Y; - __u.__a[1] = __Z; - - return __u.__v; -} -#endif - -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_set_epi16 (short __Z, short __Y, short __X, short __W, - short __V, short __U, short __T, short __S) -{ - union { - short __a[8]; - __m128i __v; - } __u; - - __u.__a[0] = __S; - __u.__a[1] = __T; - __u.__a[2] = __U; - __u.__a[3] = __V; - __u.__a[4] = __W; - __u.__a[5] = __X; - __u.__a[6] = __Y; - __u.__a[7] = __Z; - - return __u.__v; -} - -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_set_epi8 (char __Z, char __Y, char __X, char __W, - char __V, char __U, char __T, char __S, - char __Z1, char __Y1, char __X1, char __W1, - char __V1, char __U1, char __T1, char __S1) -{ - union { - char __a[16]; - __m128i __v; - } __u; - - __u.__a[0] = __S1; - __u.__a[1] = __T1; - __u.__a[2] = __U1; - __u.__a[3] = __V1; - __u.__a[4] = __W1; - __u.__a[5] = __X1; - __u.__a[6] = __Y1; - __u.__a[7] = __Z1; - __u.__a[8] = __S; - __u.__a[9] = __T; - __u.__a[10] = __U; - __u.__a[11] = __V; - __u.__a[12] = __W; - __u.__a[13] = __X; - __u.__a[14] = __Y; - __u.__a[15] = __Z; - - return __u.__v; -} - -static __inline __m128i -_mm_set1_epi64 (__m64 __A) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp, __tmp); -} - -static __inline __m128i -_mm_set1_epi32 (int __A) -{ - __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__A); - return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0)); -} - -#ifdef __x86_64__ -static __inline __m128i -_mm_set1_epi64x (long long __A) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - return (__m128i) __builtin_ia32_shufpd ((__v2df)__tmp, (__v2df)__tmp, _MM_SHUFFLE2 (0,0)); -} -#endif - -static __inline __m128i -_mm_set1_epi16 (short __A) -{ - int __Acopy = (unsigned short)__A; - __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__Acopy); - __tmp = (__v4si)__builtin_ia32_punpcklwd128 ((__v8hi)__tmp, (__v8hi)__tmp); - return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0)); -} - -static __inline __m128i -_mm_set1_epi8 (char __A) -{ - int __Acopy = (unsigned char)__A; - __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__Acopy); - __tmp = (__v4si)__builtin_ia32_punpcklbw128 ((__v16qi)__tmp, (__v16qi)__tmp); - __tmp = (__v4si)__builtin_ia32_punpcklbw128 ((__v16qi)__tmp, (__v16qi)__tmp); - return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0)); -} - -static __inline __m128i -_mm_setr_epi64 (__m64 __A, __m64 __B) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - __v2di __tmp2 = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__B); - return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp, __tmp2); -} - -/* Create the vector [Z Y X W]. */ -static __inline __m128i -_mm_setr_epi32 (int __W, int __X, int __Y, int __Z) -{ - union { - int __a[4]; - __m128i __v; - } __u; - - __u.__a[0] = __W; - __u.__a[1] = __X; - __u.__a[2] = __Y; - __u.__a[3] = __Z; - - return __u.__v; -} -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_setr_epi16 (short __S, short __T, short __U, short __V, - short __W, short __X, short __Y, short __Z) -{ - union { - short __a[8]; - __m128i __v; - } __u; - - __u.__a[0] = __S; - __u.__a[1] = __T; - __u.__a[2] = __U; - __u.__a[3] = __V; - __u.__a[4] = __W; - __u.__a[5] = __X; - __u.__a[6] = __Y; - __u.__a[7] = __Z; - - return __u.__v; -} - -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_setr_epi8 (char __S1, char __T1, char __U1, char __V1, - char __W1, char __X1, char __Y1, char __Z1, - char __S, char __T, char __U, char __V, - char __W, char __X, char __Y, char __Z) -{ - union { - char __a[16]; - __m128i __v; - } __u; - - __u.__a[0] = __S1; - __u.__a[1] = __T1; - __u.__a[2] = __U1; - __u.__a[3] = __V1; - __u.__a[4] = __W1; - __u.__a[5] = __X1; - __u.__a[6] = __Y1; - __u.__a[7] = __Z1; - __u.__a[8] = __S; - __u.__a[9] = __T; - __u.__a[10] = __U; - __u.__a[11] = __V; - __u.__a[12] = __W; - __u.__a[13] = __X; - __u.__a[14] = __Y; - __u.__a[15] = __Z; - - return __u.__v; -} - -static __inline __m128d -_mm_cvtepi32_pd (__m128i __A) -{ - return (__m128d)__builtin_ia32_cvtdq2pd ((__v4si) __A); -} - -static __inline __m128 -_mm_cvtepi32_ps (__m128i __A) -{ - return (__m128)__builtin_ia32_cvtdq2ps ((__v4si) __A); -} - -static __inline __m128i -_mm_cvtpd_epi32 (__m128d __A) -{ - return (__m128i)__builtin_ia32_cvtpd2dq ((__v2df) __A); -} - -static __inline __m64 -_mm_cvtpd_pi32 (__m128d __A) -{ - return (__m64)__builtin_ia32_cvtpd2pi ((__v2df) __A); -} - -static __inline __m128 -_mm_cvtpd_ps (__m128d __A) -{ - return (__m128)__builtin_ia32_cvtpd2ps ((__v2df) __A); -} - -static __inline __m128i -_mm_cvttpd_epi32 (__m128d __A) -{ - return (__m128i)__builtin_ia32_cvttpd2dq ((__v2df) __A); -} - -static __inline __m64 -_mm_cvttpd_pi32 (__m128d __A) -{ - return (__m64)__builtin_ia32_cvttpd2pi ((__v2df) __A); -} - -static __inline __m128d -_mm_cvtpi32_pd (__m64 __A) -{ - return (__m128d)__builtin_ia32_cvtpi2pd ((__v2si) __A); -} - -static __inline __m128i -_mm_cvtps_epi32 (__m128 __A) -{ - return (__m128i)__builtin_ia32_cvtps2dq ((__v4sf) __A); -} - -static __inline __m128i -_mm_cvttps_epi32 (__m128 __A) -{ - return (__m128i)__builtin_ia32_cvttps2dq ((__v4sf) __A); -} - -static __inline __m128d -_mm_cvtps_pd (__m128 __A) -{ - return (__m128d)__builtin_ia32_cvtps2pd ((__v4sf) __A); -} - -static __inline int -_mm_cvtsd_si32 (__m128d __A) -{ - return __builtin_ia32_cvtsd2si ((__v2df) __A); -} - -#ifdef __x86_64__ -static __inline long long -_mm_cvtsd_si64x (__m128d __A) -{ - return __builtin_ia32_cvtsd2si64 ((__v2df) __A); -} -#endif - -static __inline int -_mm_cvttsd_si32 (__m128d __A) -{ - return __builtin_ia32_cvttsd2si ((__v2df) __A); -} - -#ifdef __x86_64__ -static __inline long long -_mm_cvttsd_si64x (__m128d __A) -{ - return __builtin_ia32_cvttsd2si64 ((__v2df) __A); -} -#endif - -static __inline __m128 -_mm_cvtsd_ss (__m128 __A, __m128d __B) -{ - return (__m128)__builtin_ia32_cvtsd2ss ((__v4sf) __A, (__v2df) __B); -} - -static __inline __m128d -_mm_cvtsi32_sd (__m128d __A, int __B) -{ - return (__m128d)__builtin_ia32_cvtsi2sd ((__v2df) __A, __B); -} - -#ifdef __x86_64__ -static __inline __m128d -_mm_cvtsi64x_sd (__m128d __A, long long __B) -{ - return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B); -} -#endif - -static __inline __m128d -_mm_cvtss_sd (__m128d __A, __m128 __B) -{ - return (__m128d)__builtin_ia32_cvtss2sd ((__v2df) __A, (__v4sf)__B); -} - -#define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, (__C))) - -static __inline __m128d -_mm_unpackhi_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_unpckhpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_unpacklo_pd (__m128d __A, __m128d __B) -{ - return (__m128d)__builtin_ia32_unpcklpd ((__v2df)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_loadh_pd (__m128d __A, double const *__B) -{ - return (__m128d)__builtin_ia32_loadhpd ((__v2df)__A, (__v2si *)__B); -} - -static __inline void -_mm_storeh_pd (double *__A, __m128d __B) -{ - __builtin_ia32_storehpd ((__v2si *)__A, (__v2df)__B); -} - -static __inline __m128d -_mm_loadl_pd (__m128d __A, double const *__B) -{ - return (__m128d)__builtin_ia32_loadlpd ((__v2df)__A, (__v2si *)__B); -} - -static __inline void -_mm_storel_pd (double *__A, __m128d __B) -{ - __builtin_ia32_storelpd ((__v2si *)__A, (__v2df)__B); -} - -static __inline int -_mm_movemask_pd (__m128d __A) -{ - return __builtin_ia32_movmskpd ((__v2df)__A); -} - -static __inline __m128i -_mm_packs_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_packsswb128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_packs_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_packssdw128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_packus_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_packuswb128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_unpackhi_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpckhbw128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_unpackhi_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpckhwd128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_unpackhi_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpckhdq128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_unpackhi_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_unpacklo_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpcklbw128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_unpacklo_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpcklwd128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_unpacklo_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpckldq128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_unpacklo_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_punpcklqdq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_add_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_add_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_add_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddd128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_add_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_adds_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddsb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_adds_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddsw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_adds_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddusb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_adds_epu16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_paddusw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_sub_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_sub_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_sub_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubd128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_sub_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_subs_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubsb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_subs_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubsw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_subs_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubusb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_subs_epu16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psubusw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_madd_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmaddwd128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_mulhi_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmulhw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_mullo_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmullw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m64 -_mm_mul_su32 (__m64 __A, __m64 __B) -{ - return (__m64)__builtin_ia32_pmuludq ((__v2si)__A, (__v2si)__B); -} - -static __inline __m128i -_mm_mul_epu32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmuludq128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_sll_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psllw128 ((__v8hi)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sll_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pslld128 ((__v4si)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sll_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psllq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sra_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psraw128 ((__v8hi)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sra_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrad128 ((__v4si)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_srl_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrlw128 ((__v8hi)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_srl_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrld128 ((__v4si)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_srl_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrlq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_slli_epi16 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psllwi128 ((__v8hi)__A, __B); -} - -static __inline __m128i -_mm_slli_epi32 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_pslldi128 ((__v4si)__A, __B); -} - -static __inline __m128i -_mm_slli_epi64 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psllqi128 ((__v2di)__A, __B); -} - -static __inline __m128i -_mm_srai_epi16 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psrawi128 ((__v8hi)__A, __B); -} - -static __inline __m128i -_mm_srai_epi32 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psradi128 ((__v4si)__A, __B); -} - -#if 0 -static __m128i __attribute__((__always_inline__)) -_mm_srli_si128 (__m128i __A, const int __B) -{ - return ((__m128i)__builtin_ia32_psrldqi128 (__A, __B)) -} - -static __m128i __attribute__((__always_inline__)) -_mm_srli_si128 (__m128i __A, const int __B) -{ - return ((__m128i)__builtin_ia32_pslldqi128 (__A, __B)) -} -#endif -#define _mm_srli_si128(__A, __B) ((__m128i)__builtin_ia32_psrldqi128 (__A, __B)) -#define _mm_slli_si128(__A, __B) ((__m128i)__builtin_ia32_pslldqi128 (__A, __B)) - -static __inline __m128i -_mm_srli_epi16 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psrlwi128 ((__v8hi)__A, __B); -} - -static __inline __m128i -_mm_srli_epi32 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psrldi128 ((__v4si)__A, __B); -} - -static __inline __m128i -_mm_srli_epi64 (__m128i __A, int __B) -{ - return (__m128i)__builtin_ia32_psrlqi128 ((__v2di)__A, __B); -} - -static __inline __m128i -_mm_and_si128 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pand128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_andnot_si128 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pandn128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_or_si128 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_por128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_xor_si128 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pxor128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_cmpeq_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpeqb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_cmpeq_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpeqw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_cmpeq_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpeqd128 ((__v4si)__A, (__v4si)__B); -} - -static __inline __m128i -_mm_cmplt_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__B, (__v16qi)__A); -} - -static __inline __m128i -_mm_cmplt_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__B, (__v8hi)__A); -} - -static __inline __m128i -_mm_cmplt_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__B, (__v4si)__A); -} - -static __inline __m128i -_mm_cmpgt_epi8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_cmpgt_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_cmpgt_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__A, (__v4si)__B); -} - -#define _mm_extract_epi16(__A, __B) __builtin_ia32_pextrw128 ((__v8hi)__A, __B) - -#define _mm_insert_epi16(__A, __B, __C) ((__m128i)__builtin_ia32_pinsrw128 ((__v8hi)__A, __B, __C)) - -static __inline __m128i -_mm_max_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmaxsw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_max_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmaxub128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_min_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pminsw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_min_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pminub128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline int -_mm_movemask_epi8 (__m128i __A) -{ - return __builtin_ia32_pmovmskb128 ((__v16qi)__A); -} - -static __inline __m128i -_mm_mulhi_epu16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pmulhuw128 ((__v8hi)__A, (__v8hi)__B); -} - -#define _mm_shufflehi_epi16(__A, __B) ((__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __B)) -#define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __B)) -#define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)__A, __B)) - -static __inline void -_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) -{ - __builtin_ia32_maskmovdqu ((__v16qi)__A, (__v16qi)__B, __C); -} - -static __inline __m128i -_mm_avg_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pavgb128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline __m128i -_mm_avg_epu16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pavgw128 ((__v8hi)__A, (__v8hi)__B); -} - -static __inline __m128i -_mm_sad_epu8 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psadbw128 ((__v16qi)__A, (__v16qi)__B); -} - -static __inline void -_mm_stream_si32 (int *__A, int __B) -{ - __builtin_ia32_movnti (__A, __B); -} - -static __inline void -_mm_stream_si128 (__m128i *__A, __m128i __B) -{ - __builtin_ia32_movntdq ((__v2di *)__A, (__v2di)__B); -} - -static __inline void -_mm_stream_pd (double *__A, __m128d __B) -{ - __builtin_ia32_movntpd (__A, (__v2df)__B); -} - -static __inline __m128i -_mm_movpi64_epi64 (__m64 __A) -{ - return (__m128i)__builtin_ia32_movq2dq ((unsigned long long)__A); -} - -static __inline void -_mm_clflush (void const *__A) -{ - return __builtin_ia32_clflush (__A); -} - -static __inline void -_mm_lfence (void) -{ - __builtin_ia32_lfence (); -} - -static __inline void -_mm_mfence (void) -{ - __builtin_ia32_mfence (); -} - -static __inline __m128i -_mm_cvtsi32_si128 (int __A) -{ - return (__m128i) __builtin_ia32_loadd (&__A); -} - -#ifdef __x86_64__ -static __inline __m128i -_mm_cvtsi64x_si128 (long long __A) -{ - return (__m128i) __builtin_ia32_movq2dq (__A); -} -#endif - -static __inline int -_mm_cvtsi128_si32 (__m128i __A) -{ - int __tmp; - __builtin_ia32_stored (&__tmp, (__v4si)__A); - return __tmp; -} - -#ifdef __x86_64__ -static __inline long long -_mm_cvtsi128_si64x (__m128i __A) -{ - return __builtin_ia32_movdq2q ((__v2di)__A); -} -#endif - -#endif /* __SSE2__ */ - -#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/float.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/float.h deleted file mode 100644 index 75fcd5422d9..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/float.h +++ /dev/null @@ -1,162 +0,0 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* - * ISO C Standard: 5.2.4.2.2 Characteristics of floating types <float.h> - */ - -#ifndef _FLOAT_H___ -#define _FLOAT_H___ - -/* Radix of exponent representation, b. */ -#undef FLT_RADIX -#define FLT_RADIX __FLT_RADIX__ - -/* Number of base-FLT_RADIX digits in the significand, p. */ -#undef FLT_MANT_DIG -#undef DBL_MANT_DIG -#undef LDBL_MANT_DIG -#define FLT_MANT_DIG __FLT_MANT_DIG__ -#define DBL_MANT_DIG __DBL_MANT_DIG__ -#define LDBL_MANT_DIG __LDBL_MANT_DIG__ - -/* Number of decimal digits, q, such that any floating-point number with q - decimal digits can be rounded into a floating-point number with p radix b - digits and back again without change to the q decimal digits, - - p * log10(b) if b is a power of 10 - floor((p - 1) * log10(b)) otherwise -*/ -#undef FLT_DIG -#undef DBL_DIG -#undef LDBL_DIG -#define FLT_DIG __FLT_DIG__ -#define DBL_DIG __DBL_DIG__ -#define LDBL_DIG __LDBL_DIG__ - -/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */ -#undef FLT_MIN_EXP -#undef DBL_MIN_EXP -#undef LDBL_MIN_EXP -#define FLT_MIN_EXP __FLT_MIN_EXP__ -#define DBL_MIN_EXP __DBL_MIN_EXP__ -#define LDBL_MIN_EXP __LDBL_MIN_EXP__ - -/* Minimum negative integer such that 10 raised to that power is in the - range of normalized floating-point numbers, - - ceil(log10(b) * (emin - 1)) -*/ -#undef FLT_MIN_10_EXP -#undef DBL_MIN_10_EXP -#undef LDBL_MIN_10_EXP -#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ -#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ -#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ - -/* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */ -#undef FLT_MAX_EXP -#undef DBL_MAX_EXP -#undef LDBL_MAX_EXP -#define FLT_MAX_EXP __FLT_MAX_EXP__ -#define DBL_MAX_EXP __DBL_MAX_EXP__ -#define LDBL_MAX_EXP __LDBL_MAX_EXP__ - -/* Maximum integer such that 10 raised to that power is in the range of - representable finite floating-point numbers, - - floor(log10((1 - b**-p) * b**emax)) -*/ -#undef FLT_MAX_10_EXP -#undef DBL_MAX_10_EXP -#undef LDBL_MAX_10_EXP -#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ -#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ -#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ - -/* Maximum representable finite floating-point number, - - (1 - b**-p) * b**emax -*/ -#undef FLT_MAX -#undef DBL_MAX -#undef LDBL_MAX -#define FLT_MAX __FLT_MAX__ -#define DBL_MAX __DBL_MAX__ -#define LDBL_MAX __LDBL_MAX__ - -/* The difference between 1 and the least value greater than 1 that is - representable in the given floating point type, b**1-p. */ -#undef FLT_EPSILON -#undef DBL_EPSILON -#undef LDBL_EPSILON -#define FLT_EPSILON __FLT_EPSILON__ -#define DBL_EPSILON __DBL_EPSILON__ -#define LDBL_EPSILON __LDBL_EPSILON__ - -/* Minimum normalized positive floating-point number, b**(emin - 1). */ -#undef FLT_MIN -#undef DBL_MIN -#undef LDBL_MIN -#define FLT_MIN __FLT_MIN__ -#define DBL_MIN __DBL_MIN__ -#define LDBL_MIN __LDBL_MIN__ - -/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */ -/* ??? This is supposed to change with calls to fesetround in <fenv.h>. */ -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -/* The floating-point expression evaluation method. - -1 indeterminate - 0 evaluate all operations and constants just to the range and - precision of the type - 1 evaluate operations and constants of type float and double - to the range and precision of the double type, evaluate - long double operations and constants to the range and - precision of the long double type - 2 evaluate all operations and constants to the range and - precision of the long double type - - ??? This ought to change with the setting of the fp control word; - the value provided by the compiler assumes the widest setting. */ -#undef FLT_EVAL_METHOD -#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ - -/* Number of decimal digits, n, such that any floating-point number in the - widest supported floating type with pmax radix b digits can be rounded - to a floating-point number with n decimal digits and back again without - change to the value, - - pmax * log10(b) if b is a power of 10 - ceil(1 + pmax * log10(b)) otherwise -*/ -#undef DECIMAL_DIG -#define DECIMAL_DIG __DECIMAL_DIG__ - -#endif /* C99 */ -#endif /* _FLOAT_H___ */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/iso646.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/iso646.h deleted file mode 100644 index f09672a9787..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/iso646.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* - * ISO C Standard: 7.9 Alternative spellings <iso646.h> - */ - -#ifndef _ISO646_H -#define _ISO646_H - -#ifndef __cplusplus -#define and && -#define and_eq &= -#define bitand & -#define bitor | -#define compl ~ -#define not ! -#define not_eq != -#define or || -#define or_eq |= -#define xor ^ -#define xor_eq ^= -#endif - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/limits.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/limits.h deleted file mode 100644 index 30e08a716a9..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/limits.h +++ /dev/null @@ -1,125 +0,0 @@ -/* This administrivia gets added to the beginning of limits.h - if the system has its own version of limits.h. */ - -/* We use _GCC_LIMITS_H_ because we want this not to match - any macros that the system's limits.h uses for its own purposes. */ -#ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */ -#define _GCC_LIMITS_H_ - -#ifndef _LIBC_LIMITS_H_ -/* Use "..." so that we find syslimits.h only in this same directory. */ -#include "syslimits.h" -#endif -#ifndef _LIMITS_H___ -#define _LIMITS_H___ - -/* Number of bits in a `char'. */ -#undef CHAR_BIT -#define CHAR_BIT __CHAR_BIT__ - -/* Maximum length of a multibyte character. */ -#ifndef MB_LEN_MAX -#define MB_LEN_MAX 1 -#endif - -/* Minimum and maximum values a `signed char' can hold. */ -#undef SCHAR_MIN -#define SCHAR_MIN (-SCHAR_MAX - 1) -#undef SCHAR_MAX -#define SCHAR_MAX __SCHAR_MAX__ - -/* Maximum value an `unsigned char' can hold. (Minimum is 0). */ -#undef UCHAR_MAX -#if __SCHAR_MAX__ == __INT_MAX__ -# define UCHAR_MAX (SCHAR_MAX * 2U + 1U) -#else -# define UCHAR_MAX (SCHAR_MAX * 2 + 1) -#endif - -/* Minimum and maximum values a `char' can hold. */ -#ifdef __CHAR_UNSIGNED__ -# undef CHAR_MIN -# if __SCHAR_MAX__ == __INT_MAX__ -# define CHAR_MIN 0U -# else -# define CHAR_MIN 0 -# endif -# undef CHAR_MAX -# define CHAR_MAX UCHAR_MAX -#else -# undef CHAR_MIN -# define CHAR_MIN SCHAR_MIN -# undef CHAR_MAX -# define CHAR_MAX SCHAR_MAX -#endif - -/* Minimum and maximum values a `signed short int' can hold. */ -#undef SHRT_MIN -#define SHRT_MIN (-SHRT_MAX - 1) -#undef SHRT_MAX -#define SHRT_MAX __SHRT_MAX__ - -/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */ -#undef USHRT_MAX -#if __SHRT_MAX__ == __INT_MAX__ -# define USHRT_MAX (SHRT_MAX * 2U + 1U) -#else -# define USHRT_MAX (SHRT_MAX * 2 + 1) -#endif - -/* Minimum and maximum values a `signed int' can hold. */ -#undef INT_MIN -#define INT_MIN (-INT_MAX - 1) -#undef INT_MAX -#define INT_MAX __INT_MAX__ - -/* Maximum value an `unsigned int' can hold. (Minimum is 0). */ -#undef UINT_MAX -#define UINT_MAX (INT_MAX * 2U + 1U) - -/* Minimum and maximum values a `signed long int' can hold. - (Same as `int'). */ -#undef LONG_MIN -#define LONG_MIN (-LONG_MAX - 1L) -#undef LONG_MAX -#define LONG_MAX __LONG_MAX__ - -/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */ -#undef ULONG_MAX -#define ULONG_MAX (LONG_MAX * 2UL + 1UL) - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -/* Minimum and maximum values a `signed long long int' can hold. */ -# undef LLONG_MIN -# define LLONG_MIN (-LLONG_MAX - 1LL) -# undef LLONG_MAX -# define LLONG_MAX __LONG_LONG_MAX__ - -/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ -# undef ULLONG_MAX -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) -#endif - -#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__) -/* Minimum and maximum values a `signed long long int' can hold. */ -# undef LONG_LONG_MIN -# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL) -# undef LONG_LONG_MAX -# define LONG_LONG_MAX __LONG_LONG_MAX__ - -/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ -# undef ULONG_LONG_MAX -# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL) -#endif - -#endif /* _LIMITS_H___ */ -/* This administrivia gets added to the end of limits.h - if the system has its own version of limits.h. */ - -#else /* not _GCC_LIMITS_H_ */ - -#ifdef _GCC_NEXT_LIMITS_H -#include_next <limits.h> /* recurse down to the real one */ -#endif - -#endif /* not _GCC_LIMITS_H_ */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/mm_malloc.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/mm_malloc.h deleted file mode 100644 index 5e626640ae4..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/mm_malloc.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (C) 2004 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -#ifndef _MM_MALLOC_H_INCLUDED -#define _MM_MALLOC_H_INCLUDED - -#include <stdlib.h> -#include <errno.h> - -static __inline__ void* -_mm_malloc (size_t size, size_t align) -{ - void * malloc_ptr; - void * aligned_ptr; - - /* Error if align is not a power of two. */ - if (align & (align - 1)) - { - errno = EINVAL; - return ((void*) 0); - } - - if (size == 0) - return ((void *) 0); - - /* Assume malloc'd pointer is aligned at least to sizeof (void*). - If necessary, add another sizeof (void*) to store the value - returned by malloc. Effectively this enforces a minimum alignment - of sizeof double. */ - if (align < 2 * sizeof (void *)) - align = 2 * sizeof (void *); - - malloc_ptr = malloc (size + align); - if (!malloc_ptr) - return ((void *) 0); - - /* Align We have at least sizeof (void *) space below malloc'd ptr. */ - aligned_ptr = (void *) (((size_t) malloc_ptr + align) - & ~((size_t) (align) - 1)); - - /* Store the original pointer just before p. */ - ((void **) aligned_ptr) [-1] = malloc_ptr; - - return aligned_ptr; -} - -static __inline__ void -_mm_free (void * aligned_ptr) -{ - if (aligned_ptr) - free (((void **) aligned_ptr) [-1]); -} - -#endif /* _MM_MALLOC_H_INCLUDED */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/mmintrin.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/mmintrin.h deleted file mode 100644 index bd775e8e3a6..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/mmintrin.h +++ /dev/null @@ -1,917 +0,0 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ - -#ifndef _MMINTRIN_H_INCLUDED -#define _MMINTRIN_H_INCLUDED - -#ifndef __MMX__ -# error "MMX instruction set not enabled" -#else -/* The data type intended for user use. */ -typedef int __m64 __attribute__ ((__mode__ (__V2SI__))); - -/* Internal data types for implementing the intrinsics. */ -typedef int __v2si __attribute__ ((__mode__ (__V2SI__))); -typedef int __v4hi __attribute__ ((__mode__ (__V4HI__))); -typedef int __v8qi __attribute__ ((__mode__ (__V8QI__))); - -/* Empty the multimedia state. */ -static __inline void -_mm_empty (void) -{ - __builtin_ia32_emms (); -} - -static __inline void -_m_empty (void) -{ - _mm_empty (); -} - -/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ -static __inline __m64 -_mm_cvtsi32_si64 (int __i) -{ - long long __tmp = (unsigned int)__i; - return (__m64) __tmp; -} - -static __inline __m64 -_m_from_int (int __i) -{ - return _mm_cvtsi32_si64 (__i); -} - -#ifdef __x86_64__ -/* Convert I to a __m64 object. */ -static __inline __m64 -_mm_cvtsi64x_si64 (long long __i) -{ - return (__m64) __i; -} - -/* Convert I to a __m64 object. */ -static __inline __m64 -_mm_set_pi64x (long long __i) -{ - return (__m64) __i; -} -#endif - -/* Convert the lower 32 bits of the __m64 object into an integer. */ -static __inline int -_mm_cvtsi64_si32 (__m64 __i) -{ - long long __tmp = (long long)__i; - return __tmp; -} - -static __inline int -_m_to_int (__m64 __i) -{ - return _mm_cvtsi64_si32 (__i); -} - -#ifdef __x86_64__ -/* Convert the lower 32 bits of the __m64 object into an integer. */ -static __inline long long -_mm_cvtsi64_si64x (__m64 __i) -{ - return (long long)__i; -} -#endif - -/* Pack the four 16-bit values from M1 into the lower four 8-bit values of - the result, and the four 16-bit values from M2 into the upper four 8-bit - values of the result, all with signed saturation. */ -static __inline __m64 -_mm_packs_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_packsswb ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_packsswb (__m64 __m1, __m64 __m2) -{ - return _mm_packs_pi16 (__m1, __m2); -} - -/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of - the result, and the two 32-bit values from M2 into the upper two 16-bit - values of the result, all with signed saturation. */ -static __inline __m64 -_mm_packs_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_packssdw ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_packssdw (__m64 __m1, __m64 __m2) -{ - return _mm_packs_pi32 (__m1, __m2); -} - -/* Pack the four 16-bit values from M1 into the lower four 8-bit values of - the result, and the four 16-bit values from M2 into the upper four 8-bit - values of the result, all with unsigned saturation. */ -static __inline __m64 -_mm_packs_pu16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_packuswb ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_packuswb (__m64 __m1, __m64 __m2) -{ - return _mm_packs_pu16 (__m1, __m2); -} - -/* Interleave the four 8-bit values from the high half of M1 with the four - 8-bit values from the high half of M2. */ -static __inline __m64 -_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpckhbw ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_punpckhbw (__m64 __m1, __m64 __m2) -{ - return _mm_unpackhi_pi8 (__m1, __m2); -} - -/* Interleave the two 16-bit values from the high half of M1 with the two - 16-bit values from the high half of M2. */ -static __inline __m64 -_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpckhwd ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_punpckhwd (__m64 __m1, __m64 __m2) -{ - return _mm_unpackhi_pi16 (__m1, __m2); -} - -/* Interleave the 32-bit value from the high half of M1 with the 32-bit - value from the high half of M2. */ -static __inline __m64 -_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpckhdq ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_punpckhdq (__m64 __m1, __m64 __m2) -{ - return _mm_unpackhi_pi32 (__m1, __m2); -} - -/* Interleave the four 8-bit values from the low half of M1 with the four - 8-bit values from the low half of M2. */ -static __inline __m64 -_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpcklbw ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_punpcklbw (__m64 __m1, __m64 __m2) -{ - return _mm_unpacklo_pi8 (__m1, __m2); -} - -/* Interleave the two 16-bit values from the low half of M1 with the two - 16-bit values from the low half of M2. */ -static __inline __m64 -_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpcklwd ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_punpcklwd (__m64 __m1, __m64 __m2) -{ - return _mm_unpacklo_pi16 (__m1, __m2); -} - -/* Interleave the 32-bit value from the low half of M1 with the 32-bit - value from the low half of M2. */ -static __inline __m64 -_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_punpckldq ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_punpckldq (__m64 __m1, __m64 __m2) -{ - return _mm_unpacklo_pi32 (__m1, __m2); -} - -/* Add the 8-bit values in M1 to the 8-bit values in M2. */ -static __inline __m64 -_mm_add_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_paddb (__m64 __m1, __m64 __m2) -{ - return _mm_add_pi8 (__m1, __m2); -} - -/* Add the 16-bit values in M1 to the 16-bit values in M2. */ -static __inline __m64 -_mm_add_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_paddw (__m64 __m1, __m64 __m2) -{ - return _mm_add_pi16 (__m1, __m2); -} - -/* Add the 32-bit values in M1 to the 32-bit values in M2. */ -static __inline __m64 -_mm_add_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddd ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_paddd (__m64 __m1, __m64 __m2) -{ - return _mm_add_pi32 (__m1, __m2); -} - -/* Add the 64-bit values in M1 to the 64-bit values in M2. */ -static __inline __m64 -_mm_add_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2); -} - -/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed - saturated arithmetic. */ -static __inline __m64 -_mm_adds_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddsb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_paddsb (__m64 __m1, __m64 __m2) -{ - return _mm_adds_pi8 (__m1, __m2); -} - -/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed - saturated arithmetic. */ -static __inline __m64 -_mm_adds_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddsw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_paddsw (__m64 __m1, __m64 __m2) -{ - return _mm_adds_pi16 (__m1, __m2); -} - -/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned - saturated arithmetic. */ -static __inline __m64 -_mm_adds_pu8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddusb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_paddusb (__m64 __m1, __m64 __m2) -{ - return _mm_adds_pu8 (__m1, __m2); -} - -/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned - saturated arithmetic. */ -static __inline __m64 -_mm_adds_pu16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_paddusw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_paddusw (__m64 __m1, __m64 __m2) -{ - return _mm_adds_pu16 (__m1, __m2); -} - -/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ -static __inline __m64 -_mm_sub_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_psubb (__m64 __m1, __m64 __m2) -{ - return _mm_sub_pi8 (__m1, __m2); -} - -/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ -static __inline __m64 -_mm_sub_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_psubw (__m64 __m1, __m64 __m2) -{ - return _mm_sub_pi16 (__m1, __m2); -} - -/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ -static __inline __m64 -_mm_sub_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubd ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_psubd (__m64 __m1, __m64 __m2) -{ - return _mm_sub_pi32 (__m1, __m2); -} - -/* Add the 64-bit values in M1 to the 64-bit values in M2. */ -static __inline __m64 -_mm_sub_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubq ((long long)__m1, (long long)__m2); -} - -/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed - saturating arithmetic. */ -static __inline __m64 -_mm_subs_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubsb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_psubsb (__m64 __m1, __m64 __m2) -{ - return _mm_subs_pi8 (__m1, __m2); -} - -/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using - signed saturating arithmetic. */ -static __inline __m64 -_mm_subs_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubsw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_psubsw (__m64 __m1, __m64 __m2) -{ - return _mm_subs_pi16 (__m1, __m2); -} - -/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using - unsigned saturating arithmetic. */ -static __inline __m64 -_mm_subs_pu8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubusb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_psubusb (__m64 __m1, __m64 __m2) -{ - return _mm_subs_pu8 (__m1, __m2); -} - -/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using - unsigned saturating arithmetic. */ -static __inline __m64 -_mm_subs_pu16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_psubusw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_psubusw (__m64 __m1, __m64 __m2) -{ - return _mm_subs_pu16 (__m1, __m2); -} - -/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing - four 32-bit intermediate results, which are then summed by pairs to - produce two 32-bit results. */ -static __inline __m64 -_mm_madd_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pmaddwd ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_pmaddwd (__m64 __m1, __m64 __m2) -{ - return _mm_madd_pi16 (__m1, __m2); -} - -/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in - M2 and produce the high 16 bits of the 32-bit results. */ -static __inline __m64 -_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pmulhw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_pmulhw (__m64 __m1, __m64 __m2) -{ - return _mm_mulhi_pi16 (__m1, __m2); -} - -/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce - the low 16 bits of the results. */ -static __inline __m64 -_mm_mullo_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pmullw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_pmullw (__m64 __m1, __m64 __m2) -{ - return _mm_mullo_pi16 (__m1, __m2); -} - -/* Shift four 16-bit values in M left by COUNT. */ -static __inline __m64 -_mm_sll_pi16 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (long long)__count); -} - -static __inline __m64 -_m_psllw (__m64 __m, __m64 __count) -{ - return _mm_sll_pi16 (__m, __count); -} - -static __inline __m64 -_mm_slli_pi16 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psllw ((__v4hi)__m, __count); -} - -static __inline __m64 -_m_psllwi (__m64 __m, int __count) -{ - return _mm_slli_pi16 (__m, __count); -} - -/* Shift two 32-bit values in M left by COUNT. */ -static __inline __m64 -_mm_sll_pi32 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_pslld ((__v2si)__m, (long long)__count); -} - -static __inline __m64 -_m_pslld (__m64 __m, __m64 __count) -{ - return _mm_sll_pi32 (__m, __count); -} - -static __inline __m64 -_mm_slli_pi32 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_pslld ((__v2si)__m, __count); -} - -static __inline __m64 -_m_pslldi (__m64 __m, int __count) -{ - return _mm_slli_pi32 (__m, __count); -} - -/* Shift the 64-bit value in M left by COUNT. */ -static __inline __m64 -_mm_sll_si64 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count); -} - -static __inline __m64 -_m_psllq (__m64 __m, __m64 __count) -{ - return _mm_sll_si64 (__m, __count); -} - -static __inline __m64 -_mm_slli_si64 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count); -} - -static __inline __m64 -_m_psllqi (__m64 __m, int __count) -{ - return _mm_slli_si64 (__m, __count); -} - -/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ -static __inline __m64 -_mm_sra_pi16 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (long long)__count); -} - -static __inline __m64 -_m_psraw (__m64 __m, __m64 __count) -{ - return _mm_sra_pi16 (__m, __count); -} - -static __inline __m64 -_mm_srai_pi16 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psraw ((__v4hi)__m, __count); -} - -static __inline __m64 -_m_psrawi (__m64 __m, int __count) -{ - return _mm_srai_pi16 (__m, __count); -} - -/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ -static __inline __m64 -_mm_sra_pi32 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psrad ((__v2si)__m, (long long)__count); -} - -static __inline __m64 -_m_psrad (__m64 __m, __m64 __count) -{ - return _mm_sra_pi32 (__m, __count); -} - -static __inline __m64 -_mm_srai_pi32 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psrad ((__v2si)__m, __count); -} - -static __inline __m64 -_m_psradi (__m64 __m, int __count) -{ - return _mm_srai_pi32 (__m, __count); -} - -/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ -static __inline __m64 -_mm_srl_pi16 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (long long)__count); -} - -static __inline __m64 -_m_psrlw (__m64 __m, __m64 __count) -{ - return _mm_srl_pi16 (__m, __count); -} - -static __inline __m64 -_mm_srli_pi16 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, __count); -} - -static __inline __m64 -_m_psrlwi (__m64 __m, int __count) -{ - return _mm_srli_pi16 (__m, __count); -} - -/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ -static __inline __m64 -_mm_srl_pi32 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psrld ((__v2si)__m, (long long)__count); -} - -static __inline __m64 -_m_psrld (__m64 __m, __m64 __count) -{ - return _mm_srl_pi32 (__m, __count); -} - -static __inline __m64 -_mm_srli_pi32 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psrld ((__v2si)__m, __count); -} - -static __inline __m64 -_m_psrldi (__m64 __m, int __count) -{ - return _mm_srli_pi32 (__m, __count); -} - -/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ -static __inline __m64 -_mm_srl_si64 (__m64 __m, __m64 __count) -{ - return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count); -} - -static __inline __m64 -_m_psrlq (__m64 __m, __m64 __count) -{ - return _mm_srl_si64 (__m, __count); -} - -static __inline __m64 -_mm_srli_si64 (__m64 __m, int __count) -{ - return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count); -} - -static __inline __m64 -_m_psrlqi (__m64 __m, int __count) -{ - return _mm_srli_si64 (__m, __count); -} - -/* Bit-wise AND the 64-bit values in M1 and M2. */ -static __inline __m64 -_mm_and_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pand ((long long)__m1, (long long)__m2); -} - -static __inline __m64 -_m_pand (__m64 __m1, __m64 __m2) -{ - return _mm_and_si64 (__m1, __m2); -} - -/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the - 64-bit value in M2. */ -static __inline __m64 -_mm_andnot_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pandn ((long long)__m1, (long long)__m2); -} - -static __inline __m64 -_m_pandn (__m64 __m1, __m64 __m2) -{ - return _mm_andnot_si64 (__m1, __m2); -} - -/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ -static __inline __m64 -_mm_or_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64)__builtin_ia32_por ((long long)__m1, (long long)__m2); -} - -static __inline __m64 -_m_por (__m64 __m1, __m64 __m2) -{ - return _mm_or_si64 (__m1, __m2); -} - -/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ -static __inline __m64 -_mm_xor_si64 (__m64 __m1, __m64 __m2) -{ - return (__m64)__builtin_ia32_pxor ((long long)__m1, (long long)__m2); -} - -static __inline __m64 -_m_pxor (__m64 __m1, __m64 __m2) -{ - return _mm_xor_si64 (__m1, __m2); -} - -/* Compare eight 8-bit values. The result of the comparison is 0xFF if the - test is true and zero if false. */ -static __inline __m64 -_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_pcmpeqb (__m64 __m1, __m64 __m2) -{ - return _mm_cmpeq_pi8 (__m1, __m2); -} - -static __inline __m64 -_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpgtb ((__v8qi)__m1, (__v8qi)__m2); -} - -static __inline __m64 -_m_pcmpgtb (__m64 __m1, __m64 __m2) -{ - return _mm_cmpgt_pi8 (__m1, __m2); -} - -/* Compare four 16-bit values. The result of the comparison is 0xFFFF if - the test is true and zero if false. */ -static __inline __m64 -_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpeqw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_pcmpeqw (__m64 __m1, __m64 __m2) -{ - return _mm_cmpeq_pi16 (__m1, __m2); -} - -static __inline __m64 -_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpgtw ((__v4hi)__m1, (__v4hi)__m2); -} - -static __inline __m64 -_m_pcmpgtw (__m64 __m1, __m64 __m2) -{ - return _mm_cmpgt_pi16 (__m1, __m2); -} - -/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if - the test is true and zero if false. */ -static __inline __m64 -_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpeqd ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_pcmpeqd (__m64 __m1, __m64 __m2) -{ - return _mm_cmpeq_pi32 (__m1, __m2); -} - -static __inline __m64 -_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) -{ - return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2); -} - -static __inline __m64 -_m_pcmpgtd (__m64 __m1, __m64 __m2) -{ - return _mm_cmpgt_pi32 (__m1, __m2); -} - -/* Creates a 64-bit zero. */ -static __inline __m64 -_mm_setzero_si64 (void) -{ - return (__m64)__builtin_ia32_mmx_zero (); -} - -/* Creates a vector of two 32-bit values; I0 is least significant. */ -static __inline __m64 -_mm_set_pi32 (int __i1, int __i0) -{ - union { - __m64 __q; - struct { - unsigned int __i0; - unsigned int __i1; - } __s; - } __u; - - __u.__s.__i0 = __i0; - __u.__s.__i1 = __i1; - - return __u.__q; -} - -/* Creates a vector of four 16-bit values; W0 is least significant. */ -static __inline __m64 -_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) -{ - unsigned int __i1 = (unsigned short)__w3 << 16 | (unsigned short)__w2; - unsigned int __i0 = (unsigned short)__w1 << 16 | (unsigned short)__w0; - return _mm_set_pi32 (__i1, __i0); - -} - -/* Creates a vector of eight 8-bit values; B0 is least significant. */ -static __inline __m64 -_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, - char __b3, char __b2, char __b1, char __b0) -{ - unsigned int __i1, __i0; - - __i1 = (unsigned char)__b7; - __i1 = __i1 << 8 | (unsigned char)__b6; - __i1 = __i1 << 8 | (unsigned char)__b5; - __i1 = __i1 << 8 | (unsigned char)__b4; - - __i0 = (unsigned char)__b3; - __i0 = __i0 << 8 | (unsigned char)__b2; - __i0 = __i0 << 8 | (unsigned char)__b1; - __i0 = __i0 << 8 | (unsigned char)__b0; - - return _mm_set_pi32 (__i1, __i0); -} - -/* Similar, but with the arguments in reverse order. */ -static __inline __m64 -_mm_setr_pi32 (int __i0, int __i1) -{ - return _mm_set_pi32 (__i1, __i0); -} - -static __inline __m64 -_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) -{ - return _mm_set_pi16 (__w3, __w2, __w1, __w0); -} - -static __inline __m64 -_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, - char __b4, char __b5, char __b6, char __b7) -{ - return _mm_set_pi8 (__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0); -} - -/* Creates a vector of two 32-bit values, both elements containing I. */ -static __inline __m64 -_mm_set1_pi32 (int __i) -{ - return _mm_set_pi32 (__i, __i); -} - -/* Creates a vector of four 16-bit values, all elements containing W. */ -static __inline __m64 -_mm_set1_pi16 (short __w) -{ - unsigned int __i = (unsigned short)__w << 16 | (unsigned short)__w; - return _mm_set1_pi32 (__i); -} - -/* Creates a vector of eight 8-bit values, all elements containing B. */ -static __inline __m64 -_mm_set1_pi8 (char __b) -{ - unsigned int __w = (unsigned char)__b << 8 | (unsigned char)__b; - unsigned int __i = __w << 16 | __w; - return _mm_set1_pi32 (__i); -} - -#endif /* __MMX__ */ -#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/pmmintrin.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/pmmintrin.h deleted file mode 100644 index 3b18e2a11bd..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/pmmintrin.h +++ /dev/null @@ -1,132 +0,0 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ - -#ifndef _PMMINTRIN_H_INCLUDED -#define _PMMINTRIN_H_INCLUDED - -#ifdef __SSE3__ -#include <xmmintrin.h> -#include <emmintrin.h> - -/* Additional bits in the MXCSR. */ -#define _MM_DENORMALS_ZERO_MASK 0x0040 -#define _MM_DENORMALS_ZERO_ON 0x0040 -#define _MM_DENORMALS_ZERO_OFF 0x0000 - -#define _MM_SET_DENORMALS_ZERO_MODE(mode) \ - _mm_setcsr ((_mm_getcsr () & ~_MM_DENORMALS_ZERO_MASK) | (mode)) -#define _MM_GET_DENORMALS_ZERO_MODE() \ - (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK) - -static __inline __m128 -_mm_addsub_ps (__m128 __X, __m128 __Y) -{ - return (__m128) __builtin_ia32_addsubps ((__v4sf)__X, (__v4sf)__Y); -} - -static __inline __m128 -_mm_hadd_ps (__m128 __X, __m128 __Y) -{ - return (__m128) __builtin_ia32_haddps ((__v4sf)__X, (__v4sf)__Y); -} - -static __inline __m128 -_mm_hsub_ps (__m128 __X, __m128 __Y) -{ - return (__m128) __builtin_ia32_hsubps ((__v4sf)__X, (__v4sf)__Y); -} - -static __inline __m128 -_mm_movehdup_ps (__m128 __X) -{ - return (__m128) __builtin_ia32_movshdup ((__v4sf)__X); -} - -static __inline __m128 -_mm_moveldup_ps (__m128 __X) -{ - return (__m128) __builtin_ia32_movsldup ((__v4sf)__X); -} - -static __inline __m128d -_mm_addsub_pd (__m128d __X, __m128d __Y) -{ - return (__m128d) __builtin_ia32_addsubpd ((__v2df)__X, (__v2df)__Y); -} - -static __inline __m128d -_mm_hadd_pd (__m128d __X, __m128d __Y) -{ - return (__m128d) __builtin_ia32_haddpd ((__v2df)__X, (__v2df)__Y); -} - -static __inline __m128d -_mm_hsub_pd (__m128d __X, __m128d __Y) -{ - return (__m128d) __builtin_ia32_hsubpd ((__v2df)__X, (__v2df)__Y); -} - -static __inline __m128d -_mm_loaddup_pd (double const *__P) -{ - return (__m128d) __builtin_ia32_loadddup (__P); -} - -static __inline __m128d -_mm_movedup_pd (__m128d __X) -{ - return (__m128d) __builtin_ia32_movddup ((__v2df)__X); -} - -static __inline __m128i -_mm_lddqu_si128 (__m128i const *__P) -{ - return (__m128i) __builtin_ia32_lddqu ((char const *)__P); -} - -#if 0 -static __inline void -_mm_monitor (void const * __P, unsigned int __E, unsigned int __H) -{ - __builtin_ia32_monitor (__P, __E, __H); -} - -static __inline void -_mm_mwait (unsigned int __E, unsigned int __H) -{ - __builtin_ia32_mwait (__E, __H); -} -#else -#define _mm_monitor(P, E, H) __builtin_ia32_monitor ((P), (E), (H)) -#define _mm_mwait(E, H) __builtin_ia32_mwait ((E), (H)) -#endif - -#endif /* __SSE3__ */ - -#endif /* _PMMINTRIN_H_INCLUDED */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/stdarg.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/stdarg.h deleted file mode 100644 index 965c2aa7e2c..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/stdarg.h +++ /dev/null @@ -1,135 +0,0 @@ -/* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* - * ISO C Standard: 7.15 Variable arguments <stdarg.h> - */ - -#ifndef _STDARG_H -#ifndef _ANSI_STDARG_H_ -#ifndef RC_INVOKED -#ifndef __need___va_list -#define _STDARG_H -#define _ANSI_STDARG_H_ -#endif /* not __need___va_list */ -#undef __need___va_list - -/* Define __gnuc_va_list. */ - -#ifndef __GNUC_VA_LIST -#define __GNUC_VA_LIST -typedef __builtin_va_list __gnuc_va_list; -#endif - -/* Define the standard macros for the user, - if this invocation was from the user program. */ -#ifdef _STDARG_H - -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L -#define va_copy(d,s) __builtin_va_copy(d,s) -#endif -#define __va_copy(d,s) __builtin_va_copy(d,s) - -/* Define va_list, if desired, from __gnuc_va_list. */ -/* We deliberately do not define va_list when called from - stdio.h, because ANSI C says that stdio.h is not supposed to define - va_list. stdio.h needs to have access to that data type, - but must not use that name. It should use the name __gnuc_va_list, - which is safe because it is reserved for the implementation. */ - -#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */ -#undef _VA_LIST -#endif - -#ifdef _BSD_VA_LIST -#undef _BSD_VA_LIST -#endif - -#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST)) -/* SVR4.2 uses _VA_LIST for an internal alias for va_list, - so we must avoid testing it and setting it here. - SVR4 uses _VA_LIST as a flag in stdarg.h, but we should - have no conflict with that. */ -#ifndef _VA_LIST_ -#define _VA_LIST_ -#ifdef __i860__ -#ifndef _VA_LIST -#define _VA_LIST va_list -#endif -#endif /* __i860__ */ -typedef __gnuc_va_list va_list; -#ifdef _SCO_DS -#define __VA_LIST -#endif -#endif /* _VA_LIST_ */ -#else /* not __svr4__ || _SCO_DS */ - -/* The macro _VA_LIST_ is the same thing used by this file in Ultrix. - But on BSD NET2 we must not test or define or undef it. - (Note that the comments in NET 2's ansi.h - are incorrect for _VA_LIST_--see stdio.h!) */ -#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) -/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ -#ifndef _VA_LIST_DEFINED -/* The macro _VA_LIST is used in SCO Unix 3.2. */ -#ifndef _VA_LIST -/* The macro _VA_LIST_T_H is used in the Bull dpx2 */ -#ifndef _VA_LIST_T_H -/* The macro __va_list__ is used by BeOS. */ -#ifndef __va_list__ -typedef __gnuc_va_list va_list; -#endif /* not __va_list__ */ -#endif /* not _VA_LIST_T_H */ -#endif /* not _VA_LIST */ -#endif /* not _VA_LIST_DEFINED */ -#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) -#define _VA_LIST_ -#endif -#ifndef _VA_LIST -#define _VA_LIST -#endif -#ifndef _VA_LIST_DEFINED -#define _VA_LIST_DEFINED -#endif -#ifndef _VA_LIST_T_H -#define _VA_LIST_T_H -#endif -#ifndef __va_list__ -#define __va_list__ -#endif - -#endif /* not _VA_LIST_, except on certain systems */ - -#endif /* not __svr4__ */ - -#endif /* _STDARG_H */ - -#endif /* not RC_INVOKED */ -#endif /* not _ANSI_STDARG_H_ */ -#endif /* not _STDARG_H */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/stdbool.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/stdbool.h deleted file mode 100644 index 93003e2b346..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/stdbool.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* - * ISO C Standard: 7.16 Boolean type and values <stdbool.h> - */ - -#ifndef _STDBOOL_H -#define _STDBOOL_H - -#ifndef __cplusplus - -#define bool _Bool -#define true 1 -#define false 0 - -#else /* __cplusplus */ - -/* Supporting <stdbool.h> in C++ is a GCC extension. */ -#define _Bool bool -#define bool bool -#define false false -#define true true - -#endif /* __cplusplus */ - -/* Signal that all the definitions are present. */ -#define __bool_true_false_are_defined 1 - -#endif /* stdbool.h */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/stddef.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/stddef.h deleted file mode 100644 index 03bfbf986e2..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/stddef.h +++ /dev/null @@ -1,426 +0,0 @@ -/* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* - * ISO C Standard: 7.17 Common definitions <stddef.h> - */ -#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \ - && !defined(__STDDEF_H__)) \ - || defined(__need_wchar_t) || defined(__need_size_t) \ - || defined(__need_ptrdiff_t) || defined(__need_NULL) \ - || defined(__need_wint_t) - -/* Any one of these symbols __need_* means that GNU libc - wants us just to define one data type. So don't define - the symbols that indicate this file's entire job has been done. */ -#if (!defined(__need_wchar_t) && !defined(__need_size_t) \ - && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \ - && !defined(__need_wint_t)) -#define _STDDEF_H -#define _STDDEF_H_ -/* snaroff@next.com says the NeXT needs this. */ -#define _ANSI_STDDEF_H -/* Irix 5.1 needs this. */ -#define __STDDEF_H__ -#endif - -#ifndef __sys_stdtypes_h -/* This avoids lossage on SunOS but only if stdtypes.h comes first. - There's no way to win with the other order! Sun lossage. */ - -/* On 4.3bsd-net2, make sure ansi.h is included, so we have - one less case to deal with in the following. */ -#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) -#include <machine/ansi.h> -#endif -/* On FreeBSD 5, machine/ansi.h does not exist anymore... */ -#if defined (__FreeBSD__) && (__FreeBSD__ >= 5) -#include <sys/_types.h> -#endif - -/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are - defined if the corresponding type is *not* defined. - FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */ -#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) -#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_) -#define _SIZE_T -#endif -#if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_) -#define _PTRDIFF_T -#endif -/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ - instead of _WCHAR_T_. */ -#if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_) -#ifndef _BSD_WCHAR_T_ -#define _WCHAR_T -#endif -#endif -/* Undef _FOO_T_ if we are supposed to define foo_t. */ -#if defined (__need_ptrdiff_t) || defined (_STDDEF_H_) -#undef _PTRDIFF_T_ -#undef _BSD_PTRDIFF_T_ -#endif -#if defined (__need_size_t) || defined (_STDDEF_H_) -#undef _SIZE_T_ -#undef _BSD_SIZE_T_ -#endif -#if defined (__need_wchar_t) || defined (_STDDEF_H_) -#undef _WCHAR_T_ -#undef _BSD_WCHAR_T_ -#endif -#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */ - -/* Sequent's header files use _PTRDIFF_T_ in some conflicting way. - Just ignore it. */ -#if defined (__sequent__) && defined (_PTRDIFF_T_) -#undef _PTRDIFF_T_ -#endif - -/* On VxWorks, <type/vxTypesBase.h> may have defined macros like - _TYPE_size_t which will typedef size_t. fixincludes patched the - vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is - not defined, and so that defining this macro defines _GCC_SIZE_T. - If we find that the macros are still defined at this point, we must - invoke them so that the type is defined as expected. */ -#if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_)) -_TYPE_ptrdiff_t; -#undef _TYPE_ptrdiff_t -#endif -#if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_)) -_TYPE_size_t; -#undef _TYPE_size_t -#endif -#if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_)) -_TYPE_wchar_t; -#undef _TYPE_wchar_t -#endif - -/* In case nobody has defined these types, but we aren't running under - GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and - __WCHAR_TYPE__ have reasonable values. This can happen if the - parts of GCC is compiled by an older compiler, that actually - include gstddef.h, such as collect2. */ - -/* Signed type of difference of two pointers. */ - -/* Define this type if we are doing the whole job, - or if we want this type in particular. */ -#if defined (_STDDEF_H) || defined (__need_ptrdiff_t) -#ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */ -#ifndef _T_PTRDIFF_ -#ifndef _T_PTRDIFF -#ifndef __PTRDIFF_T -#ifndef _PTRDIFF_T_ -#ifndef _BSD_PTRDIFF_T_ -#ifndef ___int_ptrdiff_t_h -#ifndef _GCC_PTRDIFF_T -#define _PTRDIFF_T -#define _T_PTRDIFF_ -#define _T_PTRDIFF -#define __PTRDIFF_T -#define _PTRDIFF_T_ -#define _BSD_PTRDIFF_T_ -#define ___int_ptrdiff_t_h -#define _GCC_PTRDIFF_T -#ifndef __PTRDIFF_TYPE__ -#define __PTRDIFF_TYPE__ long int -#endif -typedef __PTRDIFF_TYPE__ ptrdiff_t; -#endif /* _GCC_PTRDIFF_T */ -#endif /* ___int_ptrdiff_t_h */ -#endif /* _BSD_PTRDIFF_T_ */ -#endif /* _PTRDIFF_T_ */ -#endif /* __PTRDIFF_T */ -#endif /* _T_PTRDIFF */ -#endif /* _T_PTRDIFF_ */ -#endif /* _PTRDIFF_T */ - -/* If this symbol has done its job, get rid of it. */ -#undef __need_ptrdiff_t - -#endif /* _STDDEF_H or __need_ptrdiff_t. */ - -/* Unsigned type of `sizeof' something. */ - -/* Define this type if we are doing the whole job, - or if we want this type in particular. */ -#if defined (_STDDEF_H) || defined (__need_size_t) -#ifndef __size_t__ /* BeOS */ -#ifndef __SIZE_T__ /* Cray Unicos/Mk */ -#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */ -#ifndef _SYS_SIZE_T_H -#ifndef _T_SIZE_ -#ifndef _T_SIZE -#ifndef __SIZE_T -#ifndef _SIZE_T_ -#ifndef _BSD_SIZE_T_ -#ifndef _SIZE_T_DEFINED_ -#ifndef _SIZE_T_DEFINED -#ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */ -#ifndef _SIZE_T_DECLARED /* FreeBSD 5 */ -#ifndef ___int_size_t_h -#ifndef _GCC_SIZE_T -#ifndef _SIZET_ -#ifndef __size_t -#define __size_t__ /* BeOS */ -#define __SIZE_T__ /* Cray Unicos/Mk */ -#define _SIZE_T -#define _SYS_SIZE_T_H -#define _T_SIZE_ -#define _T_SIZE -#define __SIZE_T -#define _SIZE_T_ -#define _BSD_SIZE_T_ -#define _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED -#define _BSD_SIZE_T_DEFINED_ /* Darwin */ -#define _SIZE_T_DECLARED /* FreeBSD 5 */ -#define ___int_size_t_h -#define _GCC_SIZE_T -#define _SIZET_ -#if defined (__FreeBSD__) && (__FreeBSD__ >= 5) -/* __size_t is a typedef on FreeBSD 5!, must not trash it. */ -#else -#define __size_t -#endif -#ifndef __SIZE_TYPE__ -#define __SIZE_TYPE__ long unsigned int -#endif -#if !(defined (__GNUG__) && defined (size_t)) -typedef __SIZE_TYPE__ size_t; -#ifdef __BEOS__ -typedef long ssize_t; -#endif /* __BEOS__ */ -#endif /* !(defined (__GNUG__) && defined (size_t)) */ -#endif /* __size_t */ -#endif /* _SIZET_ */ -#endif /* _GCC_SIZE_T */ -#endif /* ___int_size_t_h */ -#endif /* _SIZE_T_DECLARED */ -#endif /* _BSD_SIZE_T_DEFINED_ */ -#endif /* _SIZE_T_DEFINED */ -#endif /* _SIZE_T_DEFINED_ */ -#endif /* _BSD_SIZE_T_ */ -#endif /* _SIZE_T_ */ -#endif /* __SIZE_T */ -#endif /* _T_SIZE */ -#endif /* _T_SIZE_ */ -#endif /* _SYS_SIZE_T_H */ -#endif /* _SIZE_T */ -#endif /* __SIZE_T__ */ -#endif /* __size_t__ */ -#undef __need_size_t -#endif /* _STDDEF_H or __need_size_t. */ - - -/* Wide character type. - Locale-writers should change this as necessary to - be big enough to hold unique values not between 0 and 127, - and not (wchar_t) -1, for each defined multibyte character. */ - -/* Define this type if we are doing the whole job, - or if we want this type in particular. */ -#if defined (_STDDEF_H) || defined (__need_wchar_t) -#ifndef __wchar_t__ /* BeOS */ -#ifndef __WCHAR_T__ /* Cray Unicos/Mk */ -#ifndef _WCHAR_T -#ifndef _T_WCHAR_ -#ifndef _T_WCHAR -#ifndef __WCHAR_T -#ifndef _WCHAR_T_ -#ifndef _BSD_WCHAR_T_ -#ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */ -#ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */ -#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */ -#ifndef _WCHAR_T_DEFINED_ -#ifndef _WCHAR_T_DEFINED -#ifndef _WCHAR_T_H -#ifndef ___int_wchar_t_h -#ifndef __INT_WCHAR_T_H -#ifndef _GCC_WCHAR_T -#define __wchar_t__ /* BeOS */ -#define __WCHAR_T__ /* Cray Unicos/Mk */ -#define _WCHAR_T -#define _T_WCHAR_ -#define _T_WCHAR -#define __WCHAR_T -#define _WCHAR_T_ -#define _BSD_WCHAR_T_ -#define _WCHAR_T_DEFINED_ -#define _WCHAR_T_DEFINED -#define _WCHAR_T_H -#define ___int_wchar_t_h -#define __INT_WCHAR_T_H -#define _GCC_WCHAR_T -#define _WCHAR_T_DECLARED - -/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ - instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other - symbols in the _FOO_T_ family, stays defined even after its - corresponding type is defined). If we define wchar_t, then we - must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if - we undef _WCHAR_T_, then we must also define rune_t, since - headers like runetype.h assume that if machine/ansi.h is included, - and _BSD_WCHAR_T_ is not defined, then rune_t is available. - machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of - the same type." */ -#ifdef _BSD_WCHAR_T_ -#undef _BSD_WCHAR_T_ -#ifdef _BSD_RUNE_T_ -#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) -typedef _BSD_RUNE_T_ rune_t; -#define _BSD_WCHAR_T_DEFINED_ -#define _BSD_RUNE_T_DEFINED_ /* Darwin */ -#if defined (__FreeBSD__) && (__FreeBSD__ < 5) -/* Why is this file so hard to maintain properly? In constrast to - the comment above regarding BSD/386 1.1, on FreeBSD for as long - as the symbol has existed, _BSD_RUNE_T_ must not stay defined or - redundant typedefs will occur when stdlib.h is included after this file. */ -#undef _BSD_RUNE_T_ -#endif -#endif -#endif -#endif -/* FreeBSD 5 can't be handled well using "traditional" logic above - since it no longer defines _BSD_RUNE_T_ yet still desires to export - rune_t in some cases... */ -#if defined (__FreeBSD__) && (__FreeBSD__ >= 5) -#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) -#if __BSD_VISIBLE -#ifndef _RUNE_T_DECLARED -typedef __rune_t rune_t; -#define _RUNE_T_DECLARED -#endif -#endif -#endif -#endif - -#ifndef __WCHAR_TYPE__ -#define __WCHAR_TYPE__ int -#endif -#ifndef __cplusplus -typedef __WCHAR_TYPE__ wchar_t; -#endif -#endif -#endif -#endif -#endif -#endif -#endif -#endif /* _WCHAR_T_DECLARED */ -#endif /* _BSD_RUNE_T_DEFINED_ */ -#endif -#endif -#endif -#endif -#endif -#endif -#endif -#endif /* __WCHAR_T__ */ -#endif /* __wchar_t__ */ -#undef __need_wchar_t -#endif /* _STDDEF_H or __need_wchar_t. */ - -#if defined (__need_wint_t) -#ifndef _WINT_T -#define _WINT_T - -#ifndef __WINT_TYPE__ -#define __WINT_TYPE__ unsigned int -#endif -typedef __WINT_TYPE__ wint_t; -#endif -#undef __need_wint_t -#endif - -/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. - are already defined. */ -/* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */ -#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) -/* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_ - are probably typos and should be removed before 2.8 is released. */ -#ifdef _GCC_PTRDIFF_T_ -#undef _PTRDIFF_T_ -#undef _BSD_PTRDIFF_T_ -#endif -#ifdef _GCC_SIZE_T_ -#undef _SIZE_T_ -#undef _BSD_SIZE_T_ -#endif -#ifdef _GCC_WCHAR_T_ -#undef _WCHAR_T_ -#undef _BSD_WCHAR_T_ -#endif -/* The following ones are the real ones. */ -#ifdef _GCC_PTRDIFF_T -#undef _PTRDIFF_T_ -#undef _BSD_PTRDIFF_T_ -#endif -#ifdef _GCC_SIZE_T -#undef _SIZE_T_ -#undef _BSD_SIZE_T_ -#endif -#ifdef _GCC_WCHAR_T -#undef _WCHAR_T_ -#undef _BSD_WCHAR_T_ -#endif -#endif /* _ANSI_H_ || _MACHINE_ANSI_H_ */ - -#endif /* __sys_stdtypes_h */ - -/* A null pointer constant. */ - -#if defined (_STDDEF_H) || defined (__need_NULL) -#undef NULL /* in case <stdio.h> has defined it. */ -#ifdef __GNUG__ -#define NULL __null -#else /* G++ */ -#ifndef __cplusplus -#define NULL ((void *)0) -#else /* C++ */ -#define NULL 0 -#endif /* C++ */ -#endif /* G++ */ -#endif /* NULL not defined and <stddef.h> or need NULL. */ -#undef __need_NULL - -#ifdef _STDDEF_H - -/* Offset of member MEMBER in a struct of type TYPE. */ -#ifndef __cplusplus -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#else -/* The cast to "char &" below avoids problems with user-defined - "operator &", which can appear in a POD type. */ -#define offsetof(TYPE, MEMBER) \ - (__offsetof__ (reinterpret_cast <size_t> \ - (&reinterpret_cast <const volatile char &> \ - (static_cast<TYPE *> (0)->MEMBER)))) -#endif /* C++ */ -#endif /* _STDDEF_H was defined this time */ - -#endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__ - || __need_XXX was not defined before */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/unwind.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/unwind.h deleted file mode 100644 index 21f3feb86bc..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/unwind.h +++ /dev/null @@ -1,232 +0,0 @@ -/* Exception handling and frame unwind runtime interface routines. - Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* This is derived from the C++ ABI for IA-64. Where we diverge - for cross-architecture compatibility are noted with "@@@". */ - -#ifndef _UNWIND_H -#define _UNWIND_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Level 1: Base ABI */ - -/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is - inefficient for 32-bit and smaller machines. */ -typedef unsigned _Unwind_Word __attribute__((__mode__(__word__))); -typedef signed _Unwind_Sword __attribute__((__mode__(__word__))); -#if defined(__ia64__) && defined(__hpux__) -typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__))); -#else -typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); -#endif -typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__))); - -/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and - consumer of an exception. We'll go along with this for now even on - 32-bit machines. We'll need to provide some other option for - 16-bit machines and for machines with > 8 bits per byte. */ -typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); - -/* The unwind interface uses reason codes in several contexts to - identify the reasons for failures or other actions. */ -typedef enum -{ - _URC_NO_REASON = 0, - _URC_FOREIGN_EXCEPTION_CAUGHT = 1, - _URC_FATAL_PHASE2_ERROR = 2, - _URC_FATAL_PHASE1_ERROR = 3, - _URC_NORMAL_STOP = 4, - _URC_END_OF_STACK = 5, - _URC_HANDLER_FOUND = 6, - _URC_INSTALL_CONTEXT = 7, - _URC_CONTINUE_UNWIND = 8 -} _Unwind_Reason_Code; - - -/* The unwind interface uses a pointer to an exception header object - as its representation of an exception being thrown. In general, the - full representation of an exception object is language- and - implementation-specific, but it will be prefixed by a header - understood by the unwind interface. */ - -struct _Unwind_Exception; - -typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, - struct _Unwind_Exception *); - -struct _Unwind_Exception -{ - _Unwind_Exception_Class exception_class; - _Unwind_Exception_Cleanup_Fn exception_cleanup; - _Unwind_Word private_1; - _Unwind_Word private_2; - - /* @@@ The IA-64 ABI says that this structure must be double-word aligned. - Taking that literally does not make much sense generically. Instead we - provide the maximum alignment required by any type for the machine. */ -} __attribute__((__aligned__)); - - -/* The ACTIONS argument to the personality routine is a bitwise OR of one - or more of the following constants. */ -typedef int _Unwind_Action; - -#define _UA_SEARCH_PHASE 1 -#define _UA_CLEANUP_PHASE 2 -#define _UA_HANDLER_FRAME 4 -#define _UA_FORCE_UNWIND 8 -#define _UA_END_OF_STACK 16 - -/* This is an opaque type used to refer to a system-specific data - structure used by the system unwinder. This context is created and - destroyed by the system, and passed to the personality routine - during unwinding. */ -struct _Unwind_Context; - -/* Raise an exception, passing along the given exception object. */ -extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *); - -/* Raise an exception for forced unwinding. */ - -typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) - (int, _Unwind_Action, _Unwind_Exception_Class, - struct _Unwind_Exception *, struct _Unwind_Context *, void *); - -extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *, - _Unwind_Stop_Fn, - void *); - -/* Helper to invoke the exception_cleanup routine. */ -extern void _Unwind_DeleteException (struct _Unwind_Exception *); - -/* Resume propagation of an existing exception. This is used after - e.g. executing cleanup code, and not to implement rethrowing. */ -extern void _Unwind_Resume (struct _Unwind_Exception *); - -/* @@@ Resume propagation of an FORCE_UNWIND exception, or to rethrow - a normal exception that was handled. */ -extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *); - -/* @@@ Use unwind data to perform a stack backtrace. The trace callback - is called for every stack frame in the call chain, but no cleanup - actions are performed. */ -typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) - (struct _Unwind_Context *, void *); - -extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); - -/* These functions are used for communicating information about the unwind - context (i.e. the unwind descriptors and the user register state) between - the unwind library and the personality routine and landing pad. Only - selected registers maybe manipulated. */ - -extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int); -extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word); - -extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *); -extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr); - -/* @@@ Retrieve the CFA of the given context. */ -extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *); - -extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *); - -extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *); - - -/* The personality routine is the function in the C++ (or other language) - runtime library which serves as an interface between the system unwind - library and language-specific exception handling semantics. It is - specific to the code fragment described by an unwind info block, and - it is always referenced via the pointer in the unwind info block, and - hence it has no ABI-specified name. - - Note that this implies that two different C++ implementations can - use different names, and have different contents in the language - specific data area. Moreover, that the language specific data - area contains no version info because name of the function invoked - provides more effective versioning by detecting at link time the - lack of code to handle the different data format. */ - -typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn) - (int, _Unwind_Action, _Unwind_Exception_Class, - struct _Unwind_Exception *, struct _Unwind_Context *); - -/* @@@ The following alternate entry points are for setjmp/longjmp - based unwinding. */ - -struct SjLj_Function_Context; -extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *); -extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *); - -extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException - (struct _Unwind_Exception *); -extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind - (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); -extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *); -extern _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *); - -/* @@@ The following provide access to the base addresses for text - and data-relative addressing in the LDSA. In order to stay link - compatible with the standard ABI for IA-64, we inline these. */ - -#ifdef __ia64__ -#include <stdlib.h> - -static inline _Unwind_Ptr -_Unwind_GetDataRelBase (struct _Unwind_Context *_C) -{ - /* The GP is stored in R1. */ - return _Unwind_GetGR (_C, 1); -} - -static inline _Unwind_Ptr -_Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__))) -{ - abort (); - return 0; -} - -/* @@@ Retrieve the Backing Store Pointer of the given context. */ -extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *); -#else -extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *); -extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *); -#endif - -/* @@@ Given an address, return the entry point of the function that - contains it. */ -extern void * _Unwind_FindEnclosingFunction (void *pc); - -#ifdef __cplusplus -} -#endif - -#endif /* unwind.h */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/varargs.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/varargs.h deleted file mode 100644 index 4b9803e71ac..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/varargs.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _VARARGS_H -#define _VARARGS_H - -#error "GCC no longer implements <varargs.h>." -#error "Revise your code to use <stdarg.h>." - -#endif diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/xmmintrin.h b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/xmmintrin.h deleted file mode 100644 index aaf202792c7..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/include/xmmintrin.h +++ /dev/null @@ -1,1222 +0,0 @@ -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ - -#ifndef _XMMINTRIN_H_INCLUDED -#define _XMMINTRIN_H_INCLUDED - -#ifndef __SSE__ -# error "SSE instruction set not enabled" -#else - -/* We need type definitions from the MMX header file. */ -#include <mmintrin.h> - -/* Get _mm_malloc () and _mm_free (). */ -#include <mm_malloc.h> - -/* The data type intended for user use. */ -typedef float __m128 __attribute__ ((__mode__(__V4SF__))); - -/* Internal data types for implementing the intrinsics. */ -typedef float __v4sf __attribute__ ((__mode__(__V4SF__))); - -/* Create a selector for use with the SHUFPS instruction. */ -#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ - (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) - -/* Constants for use with _mm_prefetch. */ -enum _mm_hint -{ - _MM_HINT_T0 = 3, - _MM_HINT_T1 = 2, - _MM_HINT_T2 = 1, - _MM_HINT_NTA = 0 -}; - -/* Bits in the MXCSR. */ -#define _MM_EXCEPT_MASK 0x003f -#define _MM_EXCEPT_INVALID 0x0001 -#define _MM_EXCEPT_DENORM 0x0002 -#define _MM_EXCEPT_DIV_ZERO 0x0004 -#define _MM_EXCEPT_OVERFLOW 0x0008 -#define _MM_EXCEPT_UNDERFLOW 0x0010 -#define _MM_EXCEPT_INEXACT 0x0020 - -#define _MM_MASK_MASK 0x1f80 -#define _MM_MASK_INVALID 0x0080 -#define _MM_MASK_DENORM 0x0100 -#define _MM_MASK_DIV_ZERO 0x0200 -#define _MM_MASK_OVERFLOW 0x0400 -#define _MM_MASK_UNDERFLOW 0x0800 -#define _MM_MASK_INEXACT 0x1000 - -#define _MM_ROUND_MASK 0x6000 -#define _MM_ROUND_NEAREST 0x0000 -#define _MM_ROUND_DOWN 0x2000 -#define _MM_ROUND_UP 0x4000 -#define _MM_ROUND_TOWARD_ZERO 0x6000 - -#define _MM_FLUSH_ZERO_MASK 0x8000 -#define _MM_FLUSH_ZERO_ON 0x8000 -#define _MM_FLUSH_ZERO_OFF 0x0000 - -/* Perform the respective operation on the lower SPFP (single-precision - floating-point) values of A and B; the upper three SPFP values are - passed through from A. */ - -static __inline __m128 -_mm_add_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_sub_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_subss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_mul_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_div_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_divss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_sqrt_ss (__m128 __A) -{ - return (__m128) __builtin_ia32_sqrtss ((__v4sf)__A); -} - -static __inline __m128 -_mm_rcp_ss (__m128 __A) -{ - return (__m128) __builtin_ia32_rcpss ((__v4sf)__A); -} - -static __inline __m128 -_mm_rsqrt_ss (__m128 __A) -{ - return (__m128) __builtin_ia32_rsqrtss ((__v4sf)__A); -} - -static __inline __m128 -_mm_min_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_minss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_max_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_maxss ((__v4sf)__A, (__v4sf)__B); -} - -/* Perform the respective operation on the four SPFP values in A and B. */ - -static __inline __m128 -_mm_add_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_addps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_sub_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_subps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_mul_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_mulps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_div_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_divps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_sqrt_ps (__m128 __A) -{ - return (__m128) __builtin_ia32_sqrtps ((__v4sf)__A); -} - -static __inline __m128 -_mm_rcp_ps (__m128 __A) -{ - return (__m128) __builtin_ia32_rcpps ((__v4sf)__A); -} - -static __inline __m128 -_mm_rsqrt_ps (__m128 __A) -{ - return (__m128) __builtin_ia32_rsqrtps ((__v4sf)__A); -} - -static __inline __m128 -_mm_min_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_minps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_max_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_maxps ((__v4sf)__A, (__v4sf)__B); -} - -/* Perform logical bit-wise operations on 128-bit values. */ - -static __inline __m128 -_mm_and_ps (__m128 __A, __m128 __B) -{ - return __builtin_ia32_andps (__A, __B); -} - -static __inline __m128 -_mm_andnot_ps (__m128 __A, __m128 __B) -{ - return __builtin_ia32_andnps (__A, __B); -} - -static __inline __m128 -_mm_or_ps (__m128 __A, __m128 __B) -{ - return __builtin_ia32_orps (__A, __B); -} - -static __inline __m128 -_mm_xor_ps (__m128 __A, __m128 __B) -{ - return __builtin_ia32_xorps (__A, __B); -} - -/* Perform a comparison on the lower SPFP values of A and B. If the - comparison is true, place a mask of all ones in the result, otherwise a - mask of zeros. The upper three SPFP values are passed through from A. */ - -static __inline __m128 -_mm_cmpeq_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpeqss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmplt_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpltss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmple_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpless ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpgt_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movss ((__v4sf) __A, - (__v4sf) - __builtin_ia32_cmpltss ((__v4sf) __B, - (__v4sf) - __A)); -} - -static __inline __m128 -_mm_cmpge_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movss ((__v4sf) __A, - (__v4sf) - __builtin_ia32_cmpless ((__v4sf) __B, - (__v4sf) - __A)); -} - -static __inline __m128 -_mm_cmpneq_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpneqss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpnlt_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpnltss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpnle_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpnless ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpngt_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movss ((__v4sf) __A, - (__v4sf) - __builtin_ia32_cmpnltss ((__v4sf) __B, - (__v4sf) - __A)); -} - -static __inline __m128 -_mm_cmpnge_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movss ((__v4sf) __A, - (__v4sf) - __builtin_ia32_cmpnless ((__v4sf) __B, - (__v4sf) - __A)); -} - -static __inline __m128 -_mm_cmpord_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpordss ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpunord_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpunordss ((__v4sf)__A, (__v4sf)__B); -} - -/* Perform a comparison on the four SPFP values of A and B. For each - element, if the comparison is true, place a mask of all ones in the - result, otherwise a mask of zeros. */ - -static __inline __m128 -_mm_cmpeq_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpeqps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmplt_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpltps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmple_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpleps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpgt_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpgtps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpge_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpgeps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpneq_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpneqps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpnlt_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpnltps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpnle_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpnleps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpngt_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpngtps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpnge_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpngeps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpord_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpordps ((__v4sf)__A, (__v4sf)__B); -} - -static __inline __m128 -_mm_cmpunord_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_cmpunordps ((__v4sf)__A, (__v4sf)__B); -} - -/* Compare the lower SPFP values of A and B and return 1 if true - and 0 if false. */ - -static __inline int -_mm_comieq_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comieq ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_comilt_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comilt ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_comile_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comile ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_comigt_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comigt ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_comige_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comige ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_comineq_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_comineq ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomieq_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomieq ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomilt_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomilt ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomile_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomile ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomigt_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomigt ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomige_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomige ((__v4sf)__A, (__v4sf)__B); -} - -static __inline int -_mm_ucomineq_ss (__m128 __A, __m128 __B) -{ - return __builtin_ia32_ucomineq ((__v4sf)__A, (__v4sf)__B); -} - -/* Convert the lower SPFP value to a 32-bit integer according to the current - rounding mode. */ -static __inline int -_mm_cvtss_si32 (__m128 __A) -{ - return __builtin_ia32_cvtss2si ((__v4sf) __A); -} - -static __inline int -_mm_cvt_ss2si (__m128 __A) -{ - return _mm_cvtss_si32 (__A); -} - -#ifdef __x86_64__ -/* Convert the lower SPFP value to a 32-bit integer according to the current - rounding mode. */ -static __inline long long -_mm_cvtss_si64x (__m128 __A) -{ - return __builtin_ia32_cvtss2si64 ((__v4sf) __A); -} -#endif - -/* Convert the two lower SPFP values to 32-bit integers according to the - current rounding mode. Return the integers in packed form. */ -static __inline __m64 -_mm_cvtps_pi32 (__m128 __A) -{ - return (__m64) __builtin_ia32_cvtps2pi ((__v4sf) __A); -} - -static __inline __m64 -_mm_cvt_ps2pi (__m128 __A) -{ - return _mm_cvtps_pi32 (__A); -} - -/* Truncate the lower SPFP value to a 32-bit integer. */ -static __inline int -_mm_cvttss_si32 (__m128 __A) -{ - return __builtin_ia32_cvttss2si ((__v4sf) __A); -} - -static __inline int -_mm_cvtt_ss2si (__m128 __A) -{ - return _mm_cvttss_si32 (__A); -} - -#ifdef __x86_64__ -/* Truncate the lower SPFP value to a 32-bit integer. */ -static __inline long long -_mm_cvttss_si64x (__m128 __A) -{ - return __builtin_ia32_cvttss2si64 ((__v4sf) __A); -} -#endif - -/* Truncate the two lower SPFP values to 32-bit integers. Return the - integers in packed form. */ -static __inline __m64 -_mm_cvttps_pi32 (__m128 __A) -{ - return (__m64) __builtin_ia32_cvttps2pi ((__v4sf) __A); -} - -static __inline __m64 -_mm_cvtt_ps2pi (__m128 __A) -{ - return _mm_cvttps_pi32 (__A); -} - -/* Convert B to a SPFP value and insert it as element zero in A. */ -static __inline __m128 -_mm_cvtsi32_ss (__m128 __A, int __B) -{ - return (__m128) __builtin_ia32_cvtsi2ss ((__v4sf) __A, __B); -} - -static __inline __m128 -_mm_cvt_si2ss (__m128 __A, int __B) -{ - return _mm_cvtsi32_ss (__A, __B); -} - -#ifdef __x86_64__ -/* Convert B to a SPFP value and insert it as element zero in A. */ -static __inline __m128 -_mm_cvtsi64x_ss (__m128 __A, long long __B) -{ - return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B); -} -#endif - -/* Convert the two 32-bit values in B to SPFP form and insert them - as the two lower elements in A. */ -static __inline __m128 -_mm_cvtpi32_ps (__m128 __A, __m64 __B) -{ - return (__m128) __builtin_ia32_cvtpi2ps ((__v4sf) __A, (__v2si)__B); -} - -static __inline __m128 -_mm_cvt_pi2ps (__m128 __A, __m64 __B) -{ - return _mm_cvtpi32_ps (__A, __B); -} - -/* Convert the four signed 16-bit values in A to SPFP form. */ -static __inline __m128 -_mm_cvtpi16_ps (__m64 __A) -{ - __v4hi __sign; - __v2si __hisi, __losi; - __v4sf __r; - - /* This comparison against zero gives us a mask that can be used to - fill in the missing sign bits in the unpack operations below, so - that we get signed values after unpacking. */ - __sign = (__v4hi) __builtin_ia32_mmx_zero (); - __sign = __builtin_ia32_pcmpgtw (__sign, (__v4hi)__A); - - /* Convert the four words to doublewords. */ - __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign); - __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign); - - /* Convert the doublewords to floating point two at a time. */ - __r = (__v4sf) __builtin_ia32_setzerops (); - __r = __builtin_ia32_cvtpi2ps (__r, __hisi); - __r = __builtin_ia32_movlhps (__r, __r); - __r = __builtin_ia32_cvtpi2ps (__r, __losi); - - return (__m128) __r; -} - -/* Convert the four unsigned 16-bit values in A to SPFP form. */ -static __inline __m128 -_mm_cvtpu16_ps (__m64 __A) -{ - __v4hi __zero = (__v4hi) __builtin_ia32_mmx_zero (); - __v2si __hisi, __losi; - __v4sf __r; - - /* Convert the four words to doublewords. */ - __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __zero); - __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __zero); - - /* Convert the doublewords to floating point two at a time. */ - __r = (__v4sf) __builtin_ia32_setzerops (); - __r = __builtin_ia32_cvtpi2ps (__r, __hisi); - __r = __builtin_ia32_movlhps (__r, __r); - __r = __builtin_ia32_cvtpi2ps (__r, __losi); - - return (__m128) __r; -} - -/* Convert the low four signed 8-bit values in A to SPFP form. */ -static __inline __m128 -_mm_cvtpi8_ps (__m64 __A) -{ - __v8qi __sign; - - /* This comparison against zero gives us a mask that can be used to - fill in the missing sign bits in the unpack operations below, so - that we get signed values after unpacking. */ - __sign = (__v8qi) __builtin_ia32_mmx_zero (); - __sign = __builtin_ia32_pcmpgtb (__sign, (__v8qi)__A); - - /* Convert the four low bytes to words. */ - __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, __sign); - - return _mm_cvtpi16_ps(__A); -} - -/* Convert the low four unsigned 8-bit values in A to SPFP form. */ -static __inline __m128 -_mm_cvtpu8_ps(__m64 __A) -{ - __v8qi __zero = (__v8qi) __builtin_ia32_mmx_zero (); - __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, __zero); - return _mm_cvtpu16_ps(__A); -} - -/* Convert the four signed 32-bit values in A and B to SPFP form. */ -static __inline __m128 -_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) -{ - __v4sf __zero = (__v4sf) __builtin_ia32_setzerops (); - __v4sf __sfa = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__A); - __v4sf __sfb = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__B); - return (__m128) __builtin_ia32_movlhps (__sfa, __sfb); -} - -/* Convert the four SPFP values in A to four signed 16-bit integers. */ -static __inline __m64 -_mm_cvtps_pi16(__m128 __A) -{ - __v4sf __hisf = (__v4sf)__A; - __v4sf __losf = __builtin_ia32_movhlps (__hisf, __hisf); - __v2si __hisi = __builtin_ia32_cvtps2pi (__hisf); - __v2si __losi = __builtin_ia32_cvtps2pi (__losf); - return (__m64) __builtin_ia32_packssdw (__hisi, __losi); -} - -/* Convert the four SPFP values in A to four signed 8-bit integers. */ -static __inline __m64 -_mm_cvtps_pi8(__m128 __A) -{ - __v4hi __tmp = (__v4hi) _mm_cvtps_pi16 (__A); - __v4hi __zero = (__v4hi) __builtin_ia32_mmx_zero (); - return (__m64) __builtin_ia32_packsswb (__tmp, __zero); -} - -/* Selects four specific SPFP values from A and B based on MASK. */ -#if 0 -static __inline __m128 -_mm_shuffle_ps (__m128 __A, __m128 __B, int __mask) -{ - return (__m128) __builtin_ia32_shufps ((__v4sf)__A, (__v4sf)__B, __mask); -} -#else -#define _mm_shuffle_ps(A, B, MASK) \ - ((__m128) __builtin_ia32_shufps ((__v4sf)(A), (__v4sf)(B), (MASK))) -#endif - - -/* Selects and interleaves the upper two SPFP values from A and B. */ -static __inline __m128 -_mm_unpackhi_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_unpckhps ((__v4sf)__A, (__v4sf)__B); -} - -/* Selects and interleaves the lower two SPFP values from A and B. */ -static __inline __m128 -_mm_unpacklo_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_unpcklps ((__v4sf)__A, (__v4sf)__B); -} - -/* Sets the upper two SPFP values with 64-bits of data loaded from P; - the lower two values are passed through from A. */ -static __inline __m128 -_mm_loadh_pi (__m128 __A, __m64 const *__P) -{ - return (__m128) __builtin_ia32_loadhps ((__v4sf)__A, (__v2si *)__P); -} - -/* Stores the upper two SPFP values of A into P. */ -static __inline void -_mm_storeh_pi (__m64 *__P, __m128 __A) -{ - __builtin_ia32_storehps ((__v2si *)__P, (__v4sf)__A); -} - -/* Moves the upper two values of B into the lower two values of A. */ -static __inline __m128 -_mm_movehl_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movhlps ((__v4sf)__A, (__v4sf)__B); -} - -/* Moves the lower two values of B into the upper two values of A. */ -static __inline __m128 -_mm_movelh_ps (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movlhps ((__v4sf)__A, (__v4sf)__B); -} - -/* Sets the lower two SPFP values with 64-bits of data loaded from P; - the upper two values are passed through from A. */ -static __inline __m128 -_mm_loadl_pi (__m128 __A, __m64 const *__P) -{ - return (__m128) __builtin_ia32_loadlps ((__v4sf)__A, (__v2si *)__P); -} - -/* Stores the lower two SPFP values of A into P. */ -static __inline void -_mm_storel_pi (__m64 *__P, __m128 __A) -{ - __builtin_ia32_storelps ((__v2si *)__P, (__v4sf)__A); -} - -/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ -static __inline int -_mm_movemask_ps (__m128 __A) -{ - return __builtin_ia32_movmskps ((__v4sf)__A); -} - -/* Return the contents of the control register. */ -static __inline unsigned int -_mm_getcsr (void) -{ - return __builtin_ia32_stmxcsr (); -} - -/* Read exception bits from the control register. */ -static __inline unsigned int -_MM_GET_EXCEPTION_STATE (void) -{ - return _mm_getcsr() & _MM_EXCEPT_MASK; -} - -static __inline unsigned int -_MM_GET_EXCEPTION_MASK (void) -{ - return _mm_getcsr() & _MM_MASK_MASK; -} - -static __inline unsigned int -_MM_GET_ROUNDING_MODE (void) -{ - return _mm_getcsr() & _MM_ROUND_MASK; -} - -static __inline unsigned int -_MM_GET_FLUSH_ZERO_MODE (void) -{ - return _mm_getcsr() & _MM_FLUSH_ZERO_MASK; -} - -/* Set the control register to I. */ -static __inline void -_mm_setcsr (unsigned int __I) -{ - __builtin_ia32_ldmxcsr (__I); -} - -/* Set exception bits in the control register. */ -static __inline void -_MM_SET_EXCEPTION_STATE(unsigned int __mask) -{ - _mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | __mask); -} - -static __inline void -_MM_SET_EXCEPTION_MASK (unsigned int __mask) -{ - _mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | __mask); -} - -static __inline void -_MM_SET_ROUNDING_MODE (unsigned int __mode) -{ - _mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | __mode); -} - -static __inline void -_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) -{ - _mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | __mode); -} - -/* Create a vector with element 0 as *P and the rest zero. */ -static __inline __m128 -_mm_load_ss (float const *__P) -{ - return (__m128) __builtin_ia32_loadss (__P); -} - -/* Create a vector with all four elements equal to *P. */ -static __inline __m128 -_mm_load1_ps (float const *__P) -{ - __v4sf __tmp = __builtin_ia32_loadss (__P); - return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,0,0,0)); -} - -static __inline __m128 -_mm_load_ps1 (float const *__P) -{ - return _mm_load1_ps (__P); -} - -/* Load four SPFP values from P. The address must be 16-byte aligned. */ -static __inline __m128 -_mm_load_ps (float const *__P) -{ - return (__m128) __builtin_ia32_loadaps (__P); -} - -/* Load four SPFP values from P. The address need not be 16-byte aligned. */ -static __inline __m128 -_mm_loadu_ps (float const *__P) -{ - return (__m128) __builtin_ia32_loadups (__P); -} - -/* Load four SPFP values in reverse order. The address must be aligned. */ -static __inline __m128 -_mm_loadr_ps (float const *__P) -{ - __v4sf __tmp = __builtin_ia32_loadaps (__P); - return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,1,2,3)); -} - -/* Create a vector with element 0 as F and the rest zero. */ -static __inline __m128 -_mm_set_ss (float __F) -{ - return (__m128) __builtin_ia32_loadss (&__F); -} - -/* Create a vector with all four elements equal to F. */ -static __inline __m128 -_mm_set1_ps (float __F) -{ - __v4sf __tmp = __builtin_ia32_loadss (&__F); - return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,0,0,0)); -} - -static __inline __m128 -_mm_set_ps1 (float __F) -{ - return _mm_set1_ps (__F); -} - -/* Create the vector [Z Y X W]. */ -static __inline __m128 -_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) -{ - return (__v4sf) {__W, __X, __Y, __Z}; -} - -/* Create the vector [W X Y Z]. */ -static __inline __m128 -_mm_setr_ps (float __Z, float __Y, float __X, float __W) -{ - return _mm_set_ps (__W, __X, __Y, __Z); -} - -/* Create a vector of zeros. */ -static __inline __m128 -_mm_setzero_ps (void) -{ - return (__m128) __builtin_ia32_setzerops (); -} - -/* Stores the lower SPFP value. */ -static __inline void -_mm_store_ss (float *__P, __m128 __A) -{ - __builtin_ia32_storess (__P, (__v4sf)__A); -} - -/* Store the lower SPFP value across four words. */ -static __inline void -_mm_store1_ps (float *__P, __m128 __A) -{ - __v4sf __va = (__v4sf)__A; - __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,0,0,0)); - __builtin_ia32_storeaps (__P, __tmp); -} - -static __inline void -_mm_store_ps1 (float *__P, __m128 __A) -{ - _mm_store1_ps (__P, __A); -} - -/* Store four SPFP values. The address must be 16-byte aligned. */ -static __inline void -_mm_store_ps (float *__P, __m128 __A) -{ - __builtin_ia32_storeaps (__P, (__v4sf)__A); -} - -/* Store four SPFP values. The address need not be 16-byte aligned. */ -static __inline void -_mm_storeu_ps (float *__P, __m128 __A) -{ - __builtin_ia32_storeups (__P, (__v4sf)__A); -} - -/* Store four SPFP values in reverse order. The address must be aligned. */ -static __inline void -_mm_storer_ps (float *__P, __m128 __A) -{ - __v4sf __va = (__v4sf)__A; - __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,1,2,3)); - __builtin_ia32_storeaps (__P, __tmp); -} - -/* Sets the low SPFP value of A from the low value of B. */ -static __inline __m128 -_mm_move_ss (__m128 __A, __m128 __B) -{ - return (__m128) __builtin_ia32_movss ((__v4sf)__A, (__v4sf)__B); -} - -/* Extracts one of the four words of A. The selector N must be immediate. */ -#if 0 -static __inline int -_mm_extract_pi16 (__m64 __A, int __N) -{ - return __builtin_ia32_pextrw ((__v4hi)__A, __N); -} - -static __inline int -_m_pextrw (__m64 __A, int __N) -{ - return _mm_extract_pi16 (__A, __N); -} -#else -#define _mm_extract_pi16(A, N) \ - __builtin_ia32_pextrw ((__v4hi)(A), (N)) -#define _m_pextrw(A, N) _mm_extract_pi16((A), (N)) -#endif - -/* Inserts word D into one of four words of A. The selector N must be - immediate. */ -#if 0 -static __inline __m64 -_mm_insert_pi16 (__m64 __A, int __D, int __N) -{ - return (__m64)__builtin_ia32_pinsrw ((__v4hi)__A, __D, __N); -} - -static __inline __m64 -_m_pinsrw (__m64 __A, int __D, int __N) -{ - return _mm_insert_pi16 (__A, __D, __N); -} -#else -#define _mm_insert_pi16(A, D, N) \ - ((__m64) __builtin_ia32_pinsrw ((__v4hi)(A), (D), (N))) -#define _m_pinsrw(A, D, N) _mm_insert_pi16((A), (D), (N)) -#endif - -/* Compute the element-wise maximum of signed 16-bit values. */ -static __inline __m64 -_mm_max_pi16 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pmaxsw ((__v4hi)__A, (__v4hi)__B); -} - -static __inline __m64 -_m_pmaxsw (__m64 __A, __m64 __B) -{ - return _mm_max_pi16 (__A, __B); -} - -/* Compute the element-wise maximum of unsigned 8-bit values. */ -static __inline __m64 -_mm_max_pu8 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pmaxub ((__v8qi)__A, (__v8qi)__B); -} - -static __inline __m64 -_m_pmaxub (__m64 __A, __m64 __B) -{ - return _mm_max_pu8 (__A, __B); -} - -/* Compute the element-wise minimum of signed 16-bit values. */ -static __inline __m64 -_mm_min_pi16 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pminsw ((__v4hi)__A, (__v4hi)__B); -} - -static __inline __m64 -_m_pminsw (__m64 __A, __m64 __B) -{ - return _mm_min_pi16 (__A, __B); -} - -/* Compute the element-wise minimum of unsigned 8-bit values. */ -static __inline __m64 -_mm_min_pu8 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pminub ((__v8qi)__A, (__v8qi)__B); -} - -static __inline __m64 -_m_pminub (__m64 __A, __m64 __B) -{ - return _mm_min_pu8 (__A, __B); -} - -/* Create an 8-bit mask of the signs of 8-bit values. */ -static __inline int -_mm_movemask_pi8 (__m64 __A) -{ - return __builtin_ia32_pmovmskb ((__v8qi)__A); -} - -static __inline int -_m_pmovmskb (__m64 __A) -{ - return _mm_movemask_pi8 (__A); -} - -/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values - in B and produce the high 16 bits of the 32-bit results. */ -static __inline __m64 -_mm_mulhi_pu16 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pmulhuw ((__v4hi)__A, (__v4hi)__B); -} - -static __inline __m64 -_m_pmulhuw (__m64 __A, __m64 __B) -{ - return _mm_mulhi_pu16 (__A, __B); -} - -/* Return a combination of the four 16-bit values in A. The selector - must be an immediate. */ -#if 0 -static __inline __m64 -_mm_shuffle_pi16 (__m64 __A, int __N) -{ - return (__m64) __builtin_ia32_pshufw ((__v4hi)__A, __N); -} - -static __inline __m64 -_m_pshufw (__m64 __A, int __N) -{ - return _mm_shuffle_pi16 (__A, __N); -} -#else -#define _mm_shuffle_pi16(A, N) \ - ((__m64) __builtin_ia32_pshufw ((__v4hi)(A), (N))) -#define _m_pshufw(A, N) _mm_shuffle_pi16 ((A), (N)) -#endif - -/* Conditionally store byte elements of A into P. The high bit of each - byte in the selector N determines whether the corresponding byte from - A is stored. */ -static __inline void -_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) -{ - __builtin_ia32_maskmovq ((__v8qi)__A, (__v8qi)__N, __P); -} - -static __inline void -_m_maskmovq (__m64 __A, __m64 __N, char *__P) -{ - _mm_maskmove_si64 (__A, __N, __P); -} - -/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ -static __inline __m64 -_mm_avg_pu8 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pavgb ((__v8qi)__A, (__v8qi)__B); -} - -static __inline __m64 -_m_pavgb (__m64 __A, __m64 __B) -{ - return _mm_avg_pu8 (__A, __B); -} - -/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ -static __inline __m64 -_mm_avg_pu16 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_pavgw ((__v4hi)__A, (__v4hi)__B); -} - -static __inline __m64 -_m_pavgw (__m64 __A, __m64 __B) -{ - return _mm_avg_pu16 (__A, __B); -} - -/* Compute the sum of the absolute differences of the unsigned 8-bit - values in A and B. Return the value in the lower 16-bit word; the - upper words are cleared. */ -static __inline __m64 -_mm_sad_pu8 (__m64 __A, __m64 __B) -{ - return (__m64) __builtin_ia32_psadbw ((__v8qi)__A, (__v8qi)__B); -} - -static __inline __m64 -_m_psadbw (__m64 __A, __m64 __B) -{ - return _mm_sad_pu8 (__A, __B); -} - -/* Loads one cache line from address P to a location "closer" to the - processor. The selector I specifies the type of prefetch operation. */ -#if 0 -static __inline void -_mm_prefetch (void *__P, enum _mm_hint __I) -{ - __builtin_prefetch (__P, 0, __I); -} -#else -#define _mm_prefetch(P, I) \ - __builtin_prefetch ((P), 0, (I)) -#endif - -/* Stores the data in A to the address P without polluting the caches. */ -static __inline void -_mm_stream_pi (__m64 *__P, __m64 __A) -{ - __builtin_ia32_movntq ((unsigned long long *)__P, (unsigned long long)__A); -} - -/* Likewise. The address must be 16-byte aligned. */ -static __inline void -_mm_stream_ps (float *__P, __m128 __A) -{ - __builtin_ia32_movntps (__P, (__v4sf)__A); -} - -/* Guarantees that every preceding store is globally visible before - any subsequent store. */ -static __inline void -_mm_sfence (void) -{ - __builtin_ia32_sfence (); -} - -/* The execution of the next instruction is delayed by an implementation - specific amount of time. The instruction does not modify the - architectural state. */ -static __inline void -_mm_pause (void) -{ - __asm__ __volatile__ ("rep; nop" : : ); -} - -/* Transpose the 4x4 matrix composed of row[0-3]. */ -#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ -do { \ - __v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \ - __v4sf __t0 = __builtin_ia32_shufps (__r0, __r1, 0x44); \ - __v4sf __t2 = __builtin_ia32_shufps (__r0, __r1, 0xEE); \ - __v4sf __t1 = __builtin_ia32_shufps (__r2, __r3, 0x44); \ - __v4sf __t3 = __builtin_ia32_shufps (__r2, __r3, 0xEE); \ - (row0) = __builtin_ia32_shufps (__t0, __t1, 0x88); \ - (row1) = __builtin_ia32_shufps (__t0, __t1, 0xDD); \ - (row2) = __builtin_ia32_shufps (__t2, __t3, 0x88); \ - (row3) = __builtin_ia32_shufps (__t2, __t3, 0xDD); \ -} while (0) - -/* For backward source compatibility. */ -#include <emmintrin.h> - -#endif /* __SSE__ */ -#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/mkheaders b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/mkheaders deleted file mode 100644 index 30e2ea00f6b..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/mkheaders +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2002 Free Software Foundation, Inc. - -#This file is part of GCC. - -#GCC is free software; you can redistribute it and/or modify it under -#the terms of the GNU General Public License as published by the Free -#Software Foundation; either version 2, or (at your option) any later -#version. - -#GCC is distributed in the hope that it will be useful, but WITHOUT -#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -#FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -#for more details. - -#You should have received a copy of the GNU General Public License -#along with GCC; see the file COPYING. If not, write to the Free -#Software Foundation, 59 Temple Place - Suite 330, Boston, MA -#02111-1307, USA. - -# Basic information -target=i686-pc-cygwin -target_noncanonical=i686-pc-cygwin -version=3.4.4 - -VERBOSE=0 -while [ x$1 = x-v ] ; do - shift - VERBOSE=`expr $VERBOSE + 1` -done -export VERBOSE - -if [ x$1 = x--help ] ; then - echo "Usage: mkheaders [options] [prefix]" - echo "Options:" - echo " -v Print more output (may be repeated for even more output)" - echo " --help This help" - echo " --version Print version information" - exit 0 -fi - -if [ x$1 = x--version ] ; then - echo "mkheaders (GCC) version $version" - echo "Copyright 2002 Free Software Foundation, Inc." - echo "This program is free software; you may redistribute it under the" - echo "terms of the GNU General Public License. This program has" - echo "absolutely no warranty." - exit 0 -fi - -# Common prefix for installation directories. -if [ x$1 != x ] ; then - prefix=$1 -else - prefix=/usr -fi -# Directory in which to put localized header files. On the systems with -# gcc as the native cc, `local_prefix' may not be `prefix' which is -# `/usr'. -# NOTE: local_prefix *should not* default from prefix. -local_prefix=/usr/local -# Directory in which to put host dependent programs and libraries -exec_prefix=/usr -# Directory in which to put the directories used by the compiler. -libdir=/usr/lib -libexecdir=/usr/lib -# Directory in which the compiler finds libraries, etc. -libsubdir=${libdir}/gcc/${target_noncanonical}/${version} -# Directory in which the compiler finds executables -libexecsubdir=${libexecdir}/gcc/${target_noncanonical}/${version} -# Since gcc_tooldir does not exist at build-time, use -B${build_tooldir}/bin/ -build_tooldir=${exec_prefix}/${target_noncanonical} -# Directory to search for site-specific includes. -local_includedir=${local_prefix}/include -includedir=${prefix}/include - -itoolsdir=${libexecsubdir}/install-tools -itoolsdatadir=${libsubdir}/install-tools -incdir=${libsubdir}/include - -. ${itoolsdatadir}/mkheaders.conf - -cd ${itoolsdir} -rm -rf ${incdir}/* - -if [ x${STMP_FIXINC} != x ] ; then - TARGET_MACHINE="${target}" target_canonical="${target}" \ - ${SHELL} ./fixinc.sh ${incdir} \ - ${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS} - rm -f ${incdir}/syslimits.h - if [ -f ${incdir}/limits.h ]; then - mv ${incdir}/limits.h ${incdir}/syslimits.h - else - cp ${itoolsdatadir}/gsyslimits.h ${incdir}/syslimits.h - fi -fi - -cp ${itoolsdatadir}/include/* ${incdir} - -if [ x${STMP_FIXPROTO} != x ] ; then - mkinstalldirs="${SHELL} ${itoolsdir}/mkinstalldirs" - export FIXPROTO_DEFINES mkinstalldirs - ${SHELL} fixproto ${incdir} ${incdir} ${SYSTEM_HEADER_DIR} || exit 1 -fi diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/mkheaders.conf b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/mkheaders.conf deleted file mode 100644 index 0a829046a38..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/install-tools/mkheaders.conf +++ /dev/null @@ -1,5 +0,0 @@ -SYSTEM_HEADER_DIR="/usr/include" -OTHER_FIXINCLUDES_DIRS="" -FIXPROTO_DEFINES="" -STMP_FIXPROTO="" -STMP_FIXINC="stmp-fixinc" diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libgcc.a b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libgcc.a Binary files differdeleted file mode 100644 index bfb3426e0bd..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libgcc.a +++ /dev/null diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libgcov.a b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libgcov.a Binary files differdeleted file mode 100644 index 7996fa39b5f..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libgcov.a +++ /dev/null diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libstdc++.a b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libstdc++.a Binary files differdeleted file mode 100644 index 7111cf5481c..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libstdc++.a +++ /dev/null diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libsupc++.a b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libsupc++.a Binary files differdeleted file mode 100644 index 8fa3eadc5ce..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/libsupc++.a +++ /dev/null diff --git a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/specs b/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/specs deleted file mode 100644 index 14bf932835c..00000000000 --- a/chromium/third_party/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/specs +++ /dev/null @@ -1,127 +0,0 @@ -*asm: - - -*asm_debug: -%{gdwarf-2*:--gdwarf2}%{!gdwarf-2*:%{g*:--gstabs}} - -*asm_final: - - -*asm_options: -%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O} - -*invoke_as: -%{!S:-o %|.s | - as %(asm_options) %m.s %A } - -*cpp: -%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{!ansi:%{mthreads:-D_MT}}} %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ %{!ansi:-Dunix} -D__unix__ -D__unix } %{mwin32|mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}} %{!nostdinc:%{!mno-win32|mno-cygwin:-idirafter ../include/w32api%s -idirafter ../../include/w32api%s}} - -*cpp_options: -%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} - -*cpp_debug_options: -%{d*} - -*cpp_unique_options: -%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}} - -*trad_capable_cpp: -cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp} - -*cc1: -%(cc1_cpu) - -*cc1_options: -%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} - -*cc1plus: - - -*link_gcc_c_sequence: -%G %L %G - -*endfile: - - -*link: - %{mwindows:--subsystem windows} %{mconsole:--subsystem console} %{shared: %{mdll: %eshared and mdll are not compatible}} %{shared: --shared} %{mdll:--dll} %{static:-Bstatic} %{!static:-Bdynamic} %{shared|mdll: -e %{mno-cygwin:_DllMainCRTStartup@12} %{!mno-cygwin:__cygwin_dll_entry@12}} %{!mno-cygwin:--dll-search-prefix=cyg} - -*lib: - %{pg:-lgmon} %{!mno-cygwin:-lcygwin} %{mno-cygwin:%{mthreads:-lmingwthrd} -lmingw32} %{mwindows:-lgdi32 -lcomdlg32} -luser32 -lkernel32 -ladvapi32 -lshell32 - -*libgcc: -%{mno-cygwin: %{mthreads:-lmingwthrd} -lmingw32} -lgcc %{mno-cygwin:-lmoldname -lmingwex -lmsvcrt} - -*startfile: - %{shared|mdll: %{mno-cygwin:dllcrt2%O%s}} %{!shared: %{!mdll: %{!mno-cygwin:crt0%O%s} %{mno-cygwin:crt2%O%s} %{pg:gcrt0%O%s}}} - -*switches_need_spaces: - - -*cross_compile: -0 - -*version: -3.4.4 - -*multilib: -. ; - -*multilib_defaults: - - -*multilib_extra: - - -*multilib_matches: - - -*multilib_exclusions: - - -*multilib_options: - - -*linker: -collect2 - -*link_libgcc: -%D - -*md_exec_prefix: - - -*md_startfile_prefix: - - -*md_startfile_prefix_1: - - -*startfile_prefix_spec: - - -*sysroot_suffix_spec: - - -*sysroot_hdrs_suffix_spec: - - -*cc1_cpu: -%{!mtune*: %{m386:mtune=i386 %n`-m386' is deprecated. Use `-march=i386' or `-mtune=i386' instead. -} %{m486:-mtune=i486 %n`-m486' is deprecated. Use `-march=i486' or `-mtune=i486' instead. -} %{mpentium:-mtune=pentium %n`-mpentium' is deprecated. Use `-march=pentium' or `-mtune=pentium' instead. -} %{mpentiumpro:-mtune=pentiumpro %n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mtune=pentiumpro' instead. -} %{mcpu=*:-mtune=%* %n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead. -}} %<mcpu=* %{mpni:-msse3 %n`-mpni' is deprecated. Use `-msse3' instead. -} %{mno-pni:-mno-sse3 %n`-mno-pni' is deprecated. Use `-mno-sse3' instead. -} %{mintel-syntax:-masm=intel %n`-mintel-syntax' is deprecated. Use `-masm=intel' instead. -} %{mno-intel-syntax:-masm=att %n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead. -} - -*mingw_include_path: -i686-pc-cygwin - -*link_command: -%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %l %{pie:-pie} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov} %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}} %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}} - |