Bump version to 21.06.18.1
[LibreOffice.git] / include / tools / long.hxx
blobef707070af8b2359d142393ba0dce547dc581425
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9 #pragma once
11 #include <sal/types.h>
13 /**
14 * We have an unfortunate problem in that, on Windows (both 32 and 64-bit), long is always 32-bit.
15 * But on Linux (64-bit) long is 64-bit. Which leads to nasty situations where things that work
16 * on Linux, fail on Windows.
17 * So.....,
18 * (1) introduce a typedef that will replace all usage of long in our codebase.
19 * (2) to start with, that typedef acts that same as the long it replaces
20 * (3) once the replacement is complete, this typedef will, on windows, become 64-bit.
21 * (4) and once the fallout from (3) is fixed, we can start replacing tools::Long with things
22 * like sal_Int64.
24 namespace tools
26 #if defined _WIN64
27 typedef sal_Int64 Long;
28 typedef sal_uInt64 ULong;
29 #else
30 typedef long Long;
31 typedef unsigned long ULong;
32 #endif
35 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */