printf_macros.h (822B)
1 // Copyright (c) the JPEG XL Project Authors. All rights reserved. 2 // 3 // Use of this source code is governed by a BSD-style 4 // license that can be found in the LICENSE file. 5 6 #ifndef LIB_JXL_BASE_PRINTF_MACROS_H_ 7 #define LIB_JXL_BASE_PRINTF_MACROS_H_ 8 9 // Format string macros. These should be included after any other system 10 // library since those may unconditionally define these, depending on the 11 // platform. 12 13 // PRIuS and PRIdS macros to print size_t and ssize_t respectively. 14 #if !defined(PRIdS) 15 #if defined(_WIN64) 16 #define PRIdS "lld" 17 #elif defined(_WIN32) 18 #define PRIdS "d" 19 #else 20 #define PRIdS "zd" 21 #endif 22 #endif // PRIdS 23 24 #if !defined(PRIuS) 25 #if defined(_WIN64) 26 #define PRIuS "llu" 27 #elif defined(_WIN32) 28 #define PRIuS "u" 29 #else 30 #define PRIuS "zu" 31 #endif 32 #endif // PRIuS 33 34 #endif // LIB_JXL_BASE_PRINTF_MACROS_H_