diff options
author | Mark Doffman <mark.doffman@codethink.co.uk> | 2014-03-27 20:50:21 +0000 |
---|---|---|
committer | Mark Doffman <mark.doffman@codethink.co.uk> | 2014-03-27 20:50:21 +0000 |
commit | 68ff94340891f1ae4ea24546acdbbc39c4dcbcd0 (patch) | |
tree | 46f02cba671bcb321482c7961acd91aeee57ced5 /giscanner/grealpath.h | |
parent | 19da3f81593614198206c45527f973a22cdd621e (diff) | |
parent | 89e84d06dffbc732bac26a105244b7270c42e3ec (diff) | |
download | gobject-introspection-68ff94340891f1ae4ea24546acdbbc39c4dcbcd0.tar.gz |
Merge tag 'GOBJECT_INTROSPECTION_1_39_90' into baserock/markdoffman/1_39_90-mergebaserock/markdoffman/1_39_90-merge
Tag 1_39_90
Conflicts:
autogen.sh
configure.ac
Diffstat (limited to 'giscanner/grealpath.h')
-rw-r--r-- | giscanner/grealpath.h | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/giscanner/grealpath.h b/giscanner/grealpath.h deleted file mode 100644 index 176f57ec..00000000 --- a/giscanner/grealpath.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __G_REALPATH_H__ -#define __G_REALPATH_H__ - -#include <stdlib.h> -#ifdef USE_WINDOWS -#include <windows.h> -#endif - -/** - * g_realpath: - * - * this should be a) filled in for win32 and b) put in glib... - */ - -static inline gchar* -g_realpath (const char *path) -{ -#ifndef _WIN32 -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif - char buffer [PATH_MAX]; - if (realpath(path, buffer)) - return g_strdup(buffer); - else - return NULL; -#else - /* We don't want to include <windows.h> as it clashes horribly - * with token names from scannerparser.h. So just declare - * GetFullPathNameA() here unless we already defined it, like - * in giscanner.c. - */ -#ifndef USE_WINDOWS - extern __stdcall GetFullPathNameA(const char*, int, char*, char**); -#endif - char *buffer; - char dummy; - int rc, len; - - rc = GetFullPathNameA(path, 1, &dummy, NULL); - - if (rc == 0) - { - /* Weird failure, so just return the input path as such */ - return g_strdup(path); - } - - len = rc + 1; - buffer = g_malloc(len); - - rc = GetFullPathNameA(path, len, buffer, NULL); - - if (rc == 0 || rc > len) - { - /* Weird failure again */ - g_free(buffer); - return g_strdup(path); - } - - return buffer; -#endif -} - -#endif |