| 41 | } |
| 42 | |
| 43 | void tmp_dir(DynamicString &path) |
| 44 | { |
| 45 | #if CROWN_PLATFORM_WINDOWS |
| 46 | const char *tmp = os::getenv("TMP"); |
| 47 | if (tmp == NULL) |
| 48 | tmp = os::getenv("TEMP"); |
| 49 | #else |
| 50 | const char *tmp = os::getenv("TMPDIR"); |
| 51 | if (tmp == NULL) |
| 52 | tmp = "/tmp"; |
| 53 | #endif // if CROWN_PLATFORM_WINDOWS |
| 54 | |
| 55 | if (tmp == NULL) { |
| 56 | path = ""; |
| 57 | return; |
| 58 | } |
| 59 | |
| 60 | path = tmp; |
| 61 | } |
| 62 | |
| 63 | } // namespace environment |
| 64 |