]> git.street.me.uk Git - andy/viking.git/blobdiff - src/thumbnails.c
Fix compilation under HURD (missing MAXPATHLEN macro)
[andy/viking.git] / src / thumbnails.c
index f132e756857fa412410e477f03bdf24c271b35ac..e845e13353d028e9c6872761bba5b76dcd70f3e0 100644 (file)
 #undef MIN /* quit yer whining, gcc */
 #undef MAX
 #include <sys/param.h> /* for realpath() */
+#ifndef MAX
+/* We need MAX macro and some system does not offer it */
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#endif
 
 #ifdef WINDOWS
 #define HOME_DIR "C:\\VIKING"
 #define THUMB_DIR "\\THUMBNAILS\\" /* viking maps default viking\maps */
 #define THUMB_SUB_DIR "normal\\"
 #define mkdir(a,b) mkdir(a)
-#define MAX(a,b) (((a)>(b))?(a):(b))
 #define realpath(X,Y) _fullpath(Y,X,MAX_PATH)
 
 #else
 
 #define PIXMAP_THUMB_SIZE  128
 
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
 static char *md5_hash(const char *message);
 static char *pathdup(const char *path);
 static GdkPixbuf *save_thumbnail(const char *pathname, GdkPixbuf *full);