1 /***************************************************************************
2  *  Copyright (C) 2016-2020 by Mihai Moldovan <ionic@ionic.de>             *
3  *                                                                         *
4  *  This program is free software; you can redistribute it and/or modify   *
5  *  it under the terms of the GNU General Public License as published by   *
6  *  the Free Software Foundation; either version 2 of the License, or      *
7  *  (at your option) any later version.                                    *
8  *                                                                         *
9  *  This program is distributed in the hope that it will be useful,        *
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
12  *  GNU General Public License for more details.                           *
13  *                                                                         *
14  *  You should have received a copy of the GNU General Public License      *
15  *  along with this program; if not, write to the                          *
16  *  Free Software Foundation, Inc.,                                        *
17  *  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.              *
18  ***************************************************************************/
19 
20 #ifndef UNIX_STDINT_H
21 #define UNIX_STDINT_H
22 
23 #ifdef Q_OS_UNIX
24 
25 #include <stdint.h>
26 
27 /*
28  * We need this ugly hack because the cstdint header is C++11-only
29  * (or available with extensions we can't portably use)
30  * and stdint.h won't put these types into the std namespace.
31  */
32 namespace std {
33   using ::int8_t;
34   using ::int16_t;
35   using ::int32_t;
36   using ::int64_t;
37   using ::uint8_t;
38   using ::uint16_t;
39   using ::uint32_t;
40   using ::uint64_t;
41 }
42 
43 /* Same issue with unistd's ssize_t type. */
44 namespace std {
45   using ::ssize_t;
46 }
47 
48 #endif /* defined (Q_OS_UNIX) */
49 
50 
51 #endif /* !defined (UNIX_STDINT_H) */
52