| 645 | } |
| 646 | |
| 647 | txString fxRealFilePath(txLinker* linker, txString path) |
| 648 | { |
| 649 | #if mxWindows |
| 650 | char buffer[C_PATH_MAX]; |
| 651 | DWORD attributes; |
| 652 | if (_fullpath(buffer, path, C_PATH_MAX) != NULL) { |
| 653 | attributes = GetFileAttributes(buffer); |
| 654 | if ((attributes != 0xFFFFFFFF) && (!(attributes & FILE_ATTRIBUTE_DIRECTORY))) { |
| 655 | return fxNewLinkerString(linker, buffer, mxStringLength(buffer)); |
| 656 | } |
| 657 | } |
| 658 | #else |
| 659 | char buffer[C_PATH_MAX]; |
| 660 | struct stat a_stat; |
| 661 | if (realpath(path, buffer) != NULL) { |
| 662 | if (stat(buffer, &a_stat) == 0) { |
| 663 | if (S_ISREG(a_stat.st_mode)) { |
| 664 | return fxNewLinkerString(linker, buffer, mxStringLength(buffer)); |
| 665 | } |
| 666 | } |
| 667 | } |
| 668 | #endif |
| 669 | return NULL; |
| 670 | } |
| 671 | |
| 672 | void fxReferenceLinkerSymbol(txLinker* linker, txID id) |
| 673 | { |
nothing calls this directly
no test coverage detected