summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Kowalczyk <kkowalczyk@tlapx60ubu.(none)>2007-09-24 01:08:17 -0700
committerKrzysztof Kowalczyk <kkowalczyk@tlapx60ubu.(none)>2007-09-24 01:08:17 -0700
commit6347915085a487da08d39a859f4261fa812dab09 (patch)
tree46b8cc474aefe212218e19d7155d597c151ecba1
parented01b3965c57ce2a4eabf9c46b5319ea627d3324 (diff)
Add Error.cc in msvc build and use setErrorFunction in perf-test.
-rw-r--r--makefile.vc3
-rw-r--r--test/perf-test.cc10
2 files changed, 6 insertions, 7 deletions
diff --git a/makefile.vc b/makefile.vc
index 0b0f0eec..feb613b1 100644
--- a/makefile.vc
+++ b/makefile.vc
@@ -82,7 +82,7 @@ GOO_OBJS=$(O)\FixedPoint.obj $(O)\GooHash.obj $(O)\GooList.obj $(O)\GooString.ob
POPPLER_OBJS=$(O)\Annot.obj $(O)\Array.obj $(O)\BuiltinFont.obj $(O)\BuiltinFontTables.obj \
$(O)\CMap.obj $(O)\Catalog.obj $(O)\CharCodeToUnicode.obj $(O)\DCTStream.obj \
- $(O)\Decrypt.obj $(O)\Dict.obj \
+ $(O)\Decrypt.obj $(O)\Dict.obj $(O)\Error.obj \
$(O)\FontEncodingTables.obj $(O)\FontInfo.obj $(O)\Form.obj $(O)\Function.obj \
$(O)\Gfx.obj $(O)\GfxFont.obj $(O)\GfxState.obj $(O)\GlobalParams.obj \
$(O)\GlobalParamsWin.obj \
@@ -95,7 +95,6 @@ POPPLER_OBJS=$(O)\Annot.obj $(O)\Array.obj $(O)\BuiltinFont.obj $(O)\BuiltinFont
$(O)\Stream.obj $(O)\TextOutputDev.obj $(O)\UnicodeMap.obj \
$(O)\UnicodeTypeTable.obj $(O)\XRef.obj
-#$(O)\Error.obj \
# $(O)\FlateStream.obj
SPLASH_OBJS=$(O)\Splash.obj $(O)\SplashBitmap.obj $(O)\SplashClip.obj \
diff --git a/test/perf-test.cc b/test/perf-test.cc
index 02dfd52e..7697a74b 100644
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -36,6 +36,7 @@
#include <dirent.h>
#endif
+#include "Error.h"
#include "ErrorCodes.h"
#include "GooString.h"
#include "GooList.h"
@@ -787,8 +788,7 @@ void OutputDebugString(const char *txt)
#define _vsnprintf vsnprintf
#endif
-void CDECL error(int pos, char *msg, ...) {
- va_list args;
+void my_error(int pos, char *msg, va_list args) {
char buf[4096], *p = buf;
// NB: this can be called before the globalParams object is created
@@ -805,7 +805,6 @@ void CDECL error(int pos, char *msg, ...) {
}
p = buf;
- va_start(args, msg);
p += _vsnprintf(p, sizeof(buf) - 1, msg, args);
while ( p > buf && isspace(p[-1]) )
*--p = '\0';
@@ -813,7 +812,6 @@ void CDECL error(int pos, char *msg, ...) {
*p++ = '\n';
*p = '\0';
OutputDebugString(buf);
- va_end(args);
if (pos >= 0) {
p += _snprintf(p, sizeof(buf)-1, "Error (%d): ", pos);
@@ -826,7 +824,7 @@ void CDECL error(int pos, char *msg, ...) {
if (gErrFile)
fprintf(gErrFile, "Error: ");
}
-
+#if 0
p = buf;
va_start(args, msg);
p += _vsnprintf(p, sizeof(buf) - 3, msg, args);
@@ -839,6 +837,7 @@ void CDECL error(int pos, char *msg, ...) {
if (gErrFile)
fprintf(gErrFile, buf);
va_end(args);
+#endif
}
void LogInfo(char *fmt, ...)
@@ -1314,6 +1313,7 @@ int main(int argc, char **argv)
{
//runAllUnitTests();
+ setErrorFunction(my_error);
ParseCommandLine(argc, argv);
if (0 == StrList_Len(&gArgsListRoot))
PrintUsageAndExit(argc, argv);