From 0c9f800c0e98c69d40cc22f31a9254f07083a5db Mon Sep 17 00:00:00 2001 From: zzz701 Date: Wed, 10 Sep 2025 17:26:35 +0800 Subject: [PATCH] =?UTF-8?q?NDK=E7=BC=96=E8=AF=91=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E5=AE=8F=E5=AE=9A=E4=B9=89=20Signed-off-by:=20zzz701=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../info/application_target_sdk_version.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/third_party/musl/ndk_musl_include/info/application_target_sdk_version.h b/third_party/musl/ndk_musl_include/info/application_target_sdk_version.h index 677b8522e60..991aca70437 100644 --- a/third_party/musl/ndk_musl_include/info/application_target_sdk_version.h +++ b/third_party/musl/ndk_musl_include/info/application_target_sdk_version.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,6 +20,22 @@ extern "C" { #endif +#define __DISTRIBUTEOS_VERSION(maj, min, patch) maj##min##patch // min必须是两位数字dd(如00,01), patch也必须是两位(如00,01) +#define __OH_VERSION(maj,min) maj##.##min +#define __INNER_CONCAT(a,b) a##.##b +#define __INNER_DEPRECATED(platform, version) __attribute__((__availability__(platform, deprecated=version))) +#define __INNER_OBSOLETED(platform, version) __attribute__((__availability__(platform, obsoleted=version))) +#define __INNER_AVAILABILITY(platform, version) __attribute__((__availability__(platform, introduced=version))) + +#define __OH_AVAILABILITY(version) __INNER_AVAILABILITY(ohos, version) +#define __DISTRIBUTEOS_AVAILABILITY(dos_ver, oh_ver) __INNER_AVAILABILITY(ohos, __INNER_CONCAT(oh_ver,dos_ver)) +#define __OH_DEPRECATED(version) __INNER_DEPRECATED(ohos, version) +#define __DISTRIBUTEOS_DEPRECATED(dos_ver, oh_ver) __INNER_DEPRECATED(ohos, __INNER_CONCAT(oh_ver,dos_ver)) +#define __OH_OBSOLETED(version) __INNER_OBSOLETED(ohos, version) +#define __DISTRIBUTEOS_OBSOLETED(dos_ver, oh_ver) __INNER_OBSOLETED(ohos, __INNER_CONCAT(oh_ver,dos_ver)) +#define SINCE(api) __builtin_available(ohos api, *) +#define DISTRIBUTEOS_SINCE(dos_ver, oh_ver) __builtin_available(ohos oh_ver##.##dos_ver, *) + #define SDK_VERSION_FUTURE 9999 #define SDK_VERSION_7 7 #define SDK_VERSION_8 8 -- Gitee