Changeset 10 for python/trunk/Python
- Timestamp:
- Sep 3, 2010, 5:33:06 PM (15 years ago)
- Location:
- python/trunk/Python
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk/Python/dynload_shlib.c
r2 r10 21 21 #else 22 22 #if defined(PYOS_OS2) && defined(PYCC_GCC) 23 #ifdef __KLIBC__ 24 #error "kLIBC has dlfcn.h and shouldn't get here!" 25 #endif 23 26 #include "dlfcn.h" 24 27 #endif 25 28 #endif 26 29 27 #if (defined(__OpenBSD__) || defined(__NetBSD__)) && !defined(__ELF__) 30 #if ((defined(__OpenBSD__) || defined(__NetBSD__)) && !defined(__ELF__)) \ 31 || (defined(__OS2__) && defined(__KLIBC__)) 28 32 #define LEAD_UNDERSCORE "_" 29 33 #else … … 37 41 {"module.dll", "rb", C_EXTENSION}, 38 42 #else 39 #if defined(PYOS_OS2) && defined(PYCC_GCC)43 #if (defined(PYOS_OS2) && defined(PYCC_GCC)) || (defined(__OS2__) && defined(__KLIBC__)) 40 44 {".pyd", "rb", C_EXTENSION}, 41 45 {".dll", "rb", C_EXTENSION}, … … 128 132 #endif 129 133 134 #if (defined(PYOS_OS2) && defined(PYCC_GCC)) 135 // resolve unixroot 136 if (_realrealpath( pathname, pathbuf, sizeof(pathbuf))!=0) 137 pathname = pathbuf; 138 #endif 139 130 140 handle = dlopen(pathname, dlopenflags); 131 141 -
python/trunk/Python/import.c
r2 r10 1564 1564 #include <dirent.h> 1565 1565 1566 #elif defined(__KLIBC__) 1567 #include <stdlib.h> 1568 1566 1569 #elif defined(PYOS_OS2) 1567 1570 #define INCL_DOS … … 1683 1686 1684 1687 /* OS/2 */ 1688 #elif defined(__KLIBC__) 1689 char canon[MAXPATHLEN+1]; 1690 size_t canonlen; 1691 char *p, *p2; 1692 1693 if (Py_GETENV("PYTHONCASEOK") != NULL) 1694 return 1; 1695 1696 /* This resolves case differences and return and native OS/2 1697 path. Unfortunately, it'll also resolve symbolic links 1698 while of course will screw up a bit... */ 1699 if (!_realrealpath(buf, canon, sizeof(canon))) 1700 return 0; 1701 canonlen = strlen(canon); 1702 if (canonlen < namelen) 1703 return 0; 1704 p = strrchr(canon, SEP); 1705 p2 = strrchr(p ? p : canon, ALTSEP); 1706 if (p2) 1707 p = p2; 1708 1709 return strncmp(p ? p + 1 : canon, name, namelen) == 0; 1710 1685 1711 #elif defined(PYOS_OS2) 1686 1712 HDIR hdir = 1; -
python/trunk/Python/pystrtod.c
r2 r10 3 3 #include <Python.h> 4 4 #include <locale.h> 5 #ifdef __EMX__ 6 #include <float.h> 7 #endif 8 5 9 6 10 /* ascii character tests (as opposed to locale tests) */ … … 41 45 PyOS_ascii_strtod(const char *nptr, char **endptr) 42 46 { 47 #ifdef __EMX__ 48 _control87(MCW_EM, MCW_EM); 49 #endif 43 50 char *fail_pos; 44 51 double val = -1.0; … … 173 180 } 174 181 else { 182 //sigfpe here 175 183 val = strtod(digits_pos, &fail_pos); 176 184 } -
python/trunk/Python/sysmodule.c
r2 r10 1556 1556 /* It's a symlink */ 1557 1557 link[nr] = '\0'; 1558 if ( link[0] == SEP)1558 if (IS_ABSPATH(link)) 1559 1559 argv0 = link; /* Link to absolute path */ 1560 else if ( strchr(link, SEP) == NULL)1560 else if (!HAS_ANYSEP(link)) 1561 1561 ; /* Link without path */ 1562 1562 else { 1563 1563 /* Must join(dirname(argv0), link) */ 1564 1564 char *q = strrchr(argv0, SEP); 1565 #ifdef ALTSEP 1566 char *q2 = strrchr(q ? q : argv0, ALTSEP); 1567 if (q2) 1568 q = q2; 1569 #endif 1570 #ifdef DRVSEP 1571 if (!q && HAS_DRV(argv0)) 1572 q = strchr(argv0, DRVSEP); 1573 #endif 1574 1565 1575 if (q == NULL) 1566 1576 argv0 = link; /* argv0 without path */ … … 1568 1578 /* Must make a copy */ 1569 1579 strcpy(argv0copy, argv0); 1570 q = strrchr(argv0copy, SEP);1580 q = &argv0copy[q - argv0]; 1571 1581 strcpy(q+1, link); 1572 1582 argv0 = argv0copy; … … 1609 1619 #endif 1610 1620 p = strrchr(argv0, SEP); 1621 #ifdef ALTSEP 1622 { 1623 char *p2 = strrchr(p ? p : argv0, ALTSEP); 1624 if (p2 != NULL) 1625 p = p2; 1626 } 1627 #endif 1628 #ifdef DRVSEP 1629 if (p == NULL && HAS_DRV(argv0)) 1630 p = strchr(argv0, DRVSEP); 1631 #endif 1611 1632 } 1612 1633 if (p != NULL) { -
python/trunk/Python/traceback.c
r2 r10 158 158 if (strlen(namebuf) != len) 159 159 continue; /* v contains '\0' */ 160 if (len > 0 && namebuf[len-1] != SEP)160 if (len > 0 && IS_SEP(namebuf[len-1])) 161 161 namebuf[len++] = SEP; 162 162 strcpy(namebuf+len, tail);
Note:
See TracChangeset
for help on using the changeset viewer.