diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-19 10:44:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-19 12:56:30 +0200 |
commit | 2646023729dd16c1a613fac7e8e6a37828d7a404 (patch) | |
tree | cba08360a0812ccd3653a6dcfd1cad03704a3724 /include/tools/long.hxx | |
parent | 1086654d6e8cc22f1f99195668db3f305437e570 (diff) |
add tools::Long typedef and use it in tools
first step to switching long to a 64-bit type on 64-bit windows
Change-Id: I640d807426dfe713c7a8984ef560575f8288dbeb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104516
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/tools/long.hxx')
-rw-r--r-- | include/tools/long.hxx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/tools/long.hxx b/include/tools/long.hxx new file mode 100644 index 000000000000..0a633e0f23cc --- /dev/null +++ b/include/tools/long.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#pragma once + +#include <sal/types.h> + +/** + * We have an unfortunate problem in that, on Windows (both 32 and 64-bit), long is always 32-bit. + * But on Linux (64-bit) long is 64-bit. Which leads to nasty situations where things that work + * on Linux, fail on Windows. + * So....., + * (1) introduce a typedef that will replace all usage of long in our codebase. + * (2) to start with, that typedef acts that same as the long it replaces + * (3) once the replacement is complete, this typedef will, on windows, become 64-bit. + * (4) and once the fallout from (3) is fixed, we can start replacing tools::Long with things + * like sal_Int64. + */ +namespace tools +{ +typedef long Long; +typedef unsigned long ULong; +// stage 3: +//typedef sal_Int64 Long; +//typedef sal_uInt64 ULong; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |