summaryrefslogtreecommitdiff
path: root/desktop/win32
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-06-12 06:47:49 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-06-12 06:47:49 +0000
commitfdf1e2b471ada5c7284364dbba4c7470d07d849c (patch)
treea87265d4c48be8e9b6a3649ee01f5c0c1de5b346 /desktop/win32
parent0b98937df34ba5ee9f97b043ee76b4f43e850ca9 (diff)
#i90611# Fix for .Net2003 compiler (patch by sb).
Diffstat (limited to 'desktop/win32')
-rw-r--r--desktop/win32/source/unoinfo.cxx52
1 files changed, 29 insertions, 23 deletions
diff --git a/desktop/win32/source/unoinfo.cxx b/desktop/win32/source/unoinfo.cxx
index f672f85ba0..187a38d97d 100644
--- a/desktop/win32/source/unoinfo.cxx
+++ b/desktop/win32/source/unoinfo.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: unoinfo.cxx,v $
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
@@ -29,12 +29,18 @@
************************************************************************/
#include <cstddef>
-#include <cstdio>
-#include <cstdlib>
-#include <cwchar>
+#include <stdio.h>
+#include <stdlib.h>
+#include <wchar.h>
#define WIN32_LEAN_AND_MEAN
+#if defined _MSC_VER
+#pragma warning(push, 1)
+#endif
#include <windows.h>
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
#include "tools/pathutils.hxx"
@@ -46,14 +52,14 @@ namespace {
wchar_t * getBrandPath(wchar_t * path) {
DWORD n = GetModuleFileNameW(NULL, path, MAX_PATH);
if (n == 0 || n >= MAX_PATH) {
- std::exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
return tools::filename(path);
}
void writeNull() {
- if (std::fwrite("\0\0", 1, 2, stdout) != 2) {
- std::exit(EXIT_FAILURE);
+ if (fwrite("\0\0", 1, 2, stdout) != 2) {
+ exit(EXIT_FAILURE);
}
}
@@ -65,40 +71,40 @@ void writePath(
wchar_t * end = tools::buildPath(
path, frontBegin, frontEnd, backBegin, backLength);
if (end == NULL) {
- std::exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
std::size_t n = (end - path) * sizeof (wchar_t);
- if (std::fwrite(path, 1, n, stdout) != n) {
- std::exit(EXIT_FAILURE);
+ if (fwrite(path, 1, n, stdout) != n) {
+ exit(EXIT_FAILURE);
}
}
}
int wmain(int argc, wchar_t ** argv, wchar_t **) {
- if (argc == 2 && std::wcscmp(argv[1], L"c++") == 0) {
+ if (argc == 2 && wcscmp(argv[1], L"c++") == 0) {
wchar_t path[MAX_PATH];
wchar_t * pathEnd = getBrandPath(path);
if (tools::buildPath(path, path, pathEnd, MY_STRING(L"..\\basis-link"))
== NULL)
{
- std::exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
pathEnd = tools::resolveLink(path);
if (pathEnd == NULL ||
(tools::buildPath(path, path, pathEnd, MY_STRING(L"\\ure-link")) ==
NULL))
{
- std::exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
pathEnd = tools::resolveLink(path);
if (pathEnd == NULL) {
- std::exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
writePath(path, pathEnd, MY_STRING(L"\\bin"));
- } else if (argc == 2 && std::wcscmp(argv[1], L"java") == 0) {
- if (std::fwrite("1", 1, 1, stdout) != 1) {
- std::exit(EXIT_FAILURE);
+ } else if (argc == 2 && wcscmp(argv[1], L"java") == 0) {
+ if (fwrite("1", 1, 1, stdout) != 1) {
+ exit(EXIT_FAILURE);
}
wchar_t path[MAX_PATH];
wchar_t * pathEnd = getBrandPath(path);
@@ -106,22 +112,22 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
if (tools::buildPath(path, path, pathEnd, MY_STRING(L"..\\basis-link"))
== NULL)
{
- std::exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
pathEnd = tools::resolveLink(path);
if (pathEnd == NULL) {
- std::exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
writeNull();
writePath(path, pathEnd, MY_STRING(L"\\program\\classes\\unoil.jar"));
if (tools::buildPath(path, path, pathEnd, MY_STRING(L"\\ure-link")) ==
NULL)
{
- std::exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
pathEnd = tools::resolveLink(path);
if (pathEnd == NULL) {
- std::exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
writeNull();
writePath(path, pathEnd, MY_STRING(L"\\java\\ridl.jar"));
@@ -130,7 +136,7 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
writeNull();
writePath(path, pathEnd, MY_STRING(L"\\java\\juh.jar"));
} else {
- std::exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
- std::exit(EXIT_SUCCESS);
+ exit(EXIT_SUCCESS);
}