Fixed *nix build.
authorHiroshi Saito <hiroshi@winpg.jp>
Wed, 11 Apr 2007 16:36:47 +0000 (16:36 +0000)
committerHiroshi Saito <hiroshi@winpg.jp>
Wed, 11 Apr 2007 16:36:47 +0000 (16:36 +0000)
(errno and PATH_MAX)

mylog.c
psqlodbc.h

diff --git a/mylog.c b/mylog.c
index cc287d0477d7f6ad0f4fb560ccd90b5f0a232d68..a8837788caa56c312a05e39a3a5ae2e38dcd6566 100644 (file)
--- a/mylog.c
+++ b/mylog.c
 #include <time.h>
 
 #ifndef WIN32
-#define    GENERAL_ERRNO       (errno)
-#define    GENERAL_ERRNO_SET(e)    (errno = e)
 #include <pwd.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <errno.h>
+#define    GENERAL_ERRNO       (errno)
+#define    GENERAL_ERRNO_SET(e)    (errno = e)
 #else
 #define    GENERAL_ERRNO       (GetLastError())
 #define    GENERAL_ERRNO_SET(e)    SetLastError(e)
@@ -67,7 +68,7 @@ generate_filename(const char *dirname, const char *prefix, char *filename)
 static void
 generate_homefile(const char *prefix, char *filename)
 {
-   char    dir[_MAX_PATH];
+   char    dir[PATH_MAX];
 #ifdef WIN32
    const char *ptr;
 
index 4f204470d7e78ad482f05eac9701f646fcd7de3e..e53711a8d2877352a91d2ed16397d6c32c2b8810 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Comments:       See "notice.txt" for copyright and license information.
  *
- * $Id: psqlodbc.h,v 1.117 2007/04/03 14:49:02 hinoue Exp $
+ * $Id: psqlodbc.h,v 1.118 2007/04/11 16:36:47 h-saito Exp $
  *
  */
 
@@ -303,8 +303,14 @@ typedef double SDOUBLE;
 /* Info limits */
 #define MAX_INFO_STRING                128
 #define MAX_KEYPARTS               20
-#define MAX_KEYLEN                 512 /* max key of the form
+#define MAX_KEYLEN             512     /* max key of the form
+
                                         * "date+outlet+invoice" */
+/* POSIX defines a PATH_MAX.( wondows is _MAX_PATH ..) */
+#ifndef PATH_MAX
+#define PATH_MAX       1024
+#endif
+
 #define MAX_ROW_SIZE               0   /* Unlimited rowsize with the
                                         * Tuple Toaster */
 #define MAX_STATEMENT_LEN          0   /* Unlimited statement size with