comparison dmd/root/root.c @ 1257:7af860e4f403

Changes for mingw to compile properly
author Kelly Wilson <wilsonk cpsc.ucalgary.ca>
date Wed, 22 Apr 2009 14:49:49 -0600
parents e961851fb8be
children c48dcf2e2c02
comparison
equal deleted inserted replaced
1256:6af2359b433a 1257:7af860e4f403
577 for (;;) 577 for (;;)
578 { 578 {
579 switch (*e) 579 switch (*e)
580 { 580 {
581 581
582 case '/':
583 return e + 1;
584
585 #if _WIN32 582 #if _WIN32
586 case '/': 583 case '/':
587 case '\\': 584 case '\\':
588 return e + 1; 585 return e + 1;
589 case ':': 586 case ':':
592 * otherwise it is an ADS (Alternate Data Stream) separator. 589 * otherwise it is an ADS (Alternate Data Stream) separator.
593 * Consider ADS separators as part of the file name. 590 * Consider ADS separators as part of the file name.
594 */ 591 */
595 if (e == str + 1 || e == str + len - 1) 592 if (e == str + 1 || e == str + len - 1)
596 return e + 1; 593 return e + 1;
594 #else
595 case '/':
596 return e + 1;
597 #endif 597 #endif
598 default: 598 default:
599 if (e == str) 599 if (e == str)
600 break; 600 break;
601 e--; 601 e--;
1670 1670
1671 p = buffer; 1671 p = buffer;
1672 psize = sizeof(buffer); 1672 psize = sizeof(buffer);
1673 for (;;) 1673 for (;;)
1674 { 1674 {
1675 #if _WIN32 1675 #if POSIX || IN_LLVM
1676 count = _vsnprintf(p,psize,format,args);
1677 if (count != -1)
1678 break;
1679 psize *= 2;
1680 #elif POSIX
1681 va_list va; 1676 va_list va;
1682 va_copy(va, args); 1677 va_copy(va, args);
1683 /* 1678 /*
1684 The functions vprintf(), vfprintf(), vsprintf(), vsnprintf() 1679 The functions vprintf(), vfprintf(), vsprintf(), vsnprintf()
1685 are equivalent to the functions printf(), fprintf(), sprintf(), 1680 are equivalent to the functions printf(), fprintf(), sprintf(),
1695 psize *= 2; 1690 psize *= 2;
1696 else if (count >= psize) 1691 else if (count >= psize)
1697 psize = count + 1; 1692 psize = count + 1;
1698 else 1693 else
1699 break; 1694 break;
1695 #elif _WIN32
1696 count = _vsnprintf(p,psize,format,args);
1697 if (count != -1)
1698 break;
1699 psize *= 2;
1700 #endif 1700 #endif
1701 p = (char *) alloca(psize); // buffer too small, try again with larger size 1701 p = (char *) alloca(psize); // buffer too small, try again with larger size
1702 } 1702 }
1703 write(p,count); 1703 write(p,count);
1704 } 1704 }