Skip to content

Commit 535d928

Browse files
author
Hiroshi Inoue
committed
Remove compile errors of psql.exe and libpq.dll under
Multibyte mode.
1 parent ed19b91 commit 535d928

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/bin/psql/win32.mak

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ CLEAN :
3232
-@erase "$(INTDIR)\describe.obj"
3333
-@erase "$(INTDIR)\tab-complete.obj"
3434
-@erase "$(INTDIR)\getopt.obj"
35+
-@erase "$(INTDIR)\mbprint.obj"
3536
-@erase "$(INTDIR)\vc50.idb"
3637
-@erase "$(OUTDIR)\psql.exe"
3738

@@ -73,6 +74,7 @@ LINK32_OBJS= \
7374
"$(INTDIR)\describe.obj" \
7475
"$(INTDIR)\tab-complete.obj" \
7576
"$(INTDIR)\getopt.obj" \
77+
"$(INTDIR)\mbprint.obj" \
7678
"..\..\interfaces\libpq\Release\libpqdll.lib"
7779

7880
"$(OUTDIR)\psql.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)

src/include/pg_config.h.win32

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifndef pg_config_h_win32__
2+
#define pg_config_h_win32__
13
/*
24
* Parts of pg_config.h that you get with autoconf on other systems
35
*/
@@ -23,3 +25,8 @@
2325

2426
#define HAVE_CXX_STRING_HEADER
2527
#define HAVE_NAMESPACE_STD
28+
29+
/* use _snprintf instead of snprintf */
30+
#define HAVE_SNPRINTF_DECL
31+
#define snprintf _snprintf
32+
#endif /* pg_config_h_win32__ */

src/interfaces/libpq/win32.mak

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ CLEAN :
7373
-@erase "$(OUTDIR)\libpqdll.lib"
7474
!IFDEF MULTIBYTE
7575
-@erase "$(INTDIR)\wchar.obj"
76+
-@erase "$(INTDIR)\encnames.obj"
7677
!ENDIF
7778

7879
"$(OUTDIR)" :
@@ -106,7 +107,7 @@ LIB32_OBJS= \
106107
"$(INTDIR)\pqexpbuffer.obj"
107108

108109
!IFDEF MULTIBYTE
109-
LIB32_OBJS = $(LIB32_OBJS) "$(INTDIR)\wchar.obj"
110+
LIB32_OBJS = $(LIB32_OBJS) "$(INTDIR)\wchar.obj" "$(INTDIR)\encnames.obj"
110111
!ENDIF
111112

112113
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq.res"
@@ -158,6 +159,14 @@ LINK32_OBJS= \
158159
!ENDIF
159160

160161

162+
!IFDEF MULTIBYTE
163+
"$(INTDIR)\encnames.obj" : ..\..\backend\utils\mb\encnames.c
164+
$(CPP) @<<
165+
$(CPP_PROJ) /I "." ..\..\backend\utils\mb\encnames.c
166+
<<
167+
!ENDIF
168+
169+
161170
.c{$(CPP_OBJS)}.obj::
162171
$(CPP) @<<
163172
$(CPP_PROJ) $<

0 commit comments

Comments
 (0)