summaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-02-27 12:56:11 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-02-27 12:56:11 (GMT)
commit57662b4051d9c861e089072ed3dc6409f81ff3f7 (patch)
treee6e8a8baea092d5de23f22d7a9349ec73f47526f /addon
parentaba8e32396ce444904f2fd44cedeb5b998fd67a6 (diff)
downloadDoxygen-57662b4051d9c861e089072ed3dc6409f81ff3f7.zip
Doxygen-57662b4051d9c861e089072ed3dc6409f81ff3f7.tar.gz
Doxygen-57662b4051d9c861e089072ed3dc6409f81ff3f7.tar.bz2
Problem with temporary / intermediate directory in doxyparse
When we want to use doxyparse under Windows we get the message like: ``` error: tag OUTPUT_DIRECTORY: Output directory '/tmp/doxyparse-9848' does not exist and cannot be created ``` as this is a *nix type path and the '/tmp', normally doesn't exists on Windows, better to see what is the real temporary directory (on all systems) and make everything system independent.
Diffstat (limited to 'addon')
-rw-r--r--addon/doxyparse/doxyparse.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/addon/doxyparse/doxyparse.cpp b/addon/doxyparse/doxyparse.cpp
index 515d2ba..78a91d3 100644
--- a/addon/doxyparse/doxyparse.cpp
+++ b/addon/doxyparse/doxyparse.cpp
@@ -44,6 +44,7 @@
#include <qcstring.h>
#include <qregexp.h>
#include "namespacedef.h"
+#include "portable.h"
class Doxyparse : public CodeOutputInterface
{
@@ -449,12 +450,14 @@ int main(int argc,char **argv) {
// we need a place to put intermediate files
std::ostringstream tmpdir;
-#if !defined(_WIN32) || defined(__CYGWIN__)
- unsigned int pid = (uint)getpid();
-#else
- unsigned int pid = (uint)GetCurrentProcessId();
-#endif
- tmpdir << "/tmp/doxyparse-" << pid;
+ unsigned int pid = Portable::pid();
+ if (Portable::getenv("TMP"))
+ tmpdir << Portable::getenv("TMP") << "/doxyparse-" << pid;
+ else if (Portable::getenv("TEMP"))
+ tmpdir << Portable::getenv("TEMP") << "/doxyparse-" << pid;
+ else
+ tmpdir << "doxyparse-" << pid;
+
Config_getString(OUTPUT_DIRECTORY)= tmpdir.str().c_str();
// enable HTML (fake) output to omit warning about missing output format
Config_getBool(GENERATE_HTML)=TRUE;