1 //===-- UuidCompatibility.h -------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // Include this header if your system does not have a definition of uuid_t 10 11 #ifndef utility_UUID_COMPATIBILITY_H 12 #define utility_UUID_COMPATIBILITY_H 13 14 // uuid_t is guaranteed to always be a 16-byte array 15 typedef unsigned char uuid_t[16]; 16 17 // Return 1 if uuid is null, that is, all zeroes. 18 inline __attribute__((always_inline)) int uuid_is_null(uuid_t uuid) { 19 for (int i = 0; i < 16; i++) 20 if (uuid[i]) 21 return 0; 22 return 1; 23 } 24 25 #endif // utility_UUID_COMPATIBILITY_H 26