diff --git a/types/types.go b/types/types.go index c5c3692..0060909 100644 --- a/types/types.go +++ b/types/types.go @@ -65,31 +65,31 @@ func (u UUID) String() string { type Platform uint32 const ( - unknown Platform = 0 // PLATFORM_UNKNOWN - macOS Platform = 1 // PLATFORM_MACOS - iOS Platform = 2 // PLATFORM_IOS - tvOS Platform = 3 // PLATFORM_TVOS - watchOS Platform = 4 // PLATFORM_WATCHOS - bridgeOS Platform = 5 // PLATFORM_BRIDGEOS - macCatalyst Platform = 6 // PLATFORM_MACCATALYST - iOSSimulator Platform = 7 // PLATFORM_IOSSIMULATOR - tvOSSimulator Platform = 8 // PLATFORM_TVOSSIMULATOR - watchOSSimulator Platform = 9 // PLATFORM_WATCHOSSIMULATOR - driverKit Platform = 10 // PLATFORM_DRIVERKIT - realityOS Platform = 11 // PLATFORM_REALITYOS - realityOSSimulator Platform = 12 // PLATFORM_REALITYOSSIMULATOR - firmware Platform = 13 // PLATFORM_FIRMWARE - sepOS Platform = 14 // PLATFORM_SEPOS - PLATFORM_MACOS_EXCLAVECORE Platform = 15 // PLATFORM_MACOS_EXCLAVECORE - PLATFORM_MACOS_EXCLAVEKIT Platform = 16 // PLATFORM_MACOS_EXCLAVEKIT - PLATFORM_IOS_EXCLAVECORE Platform = 17 // PLATFORM_IOS_EXCLAVECORE - PLATFORM_IOS_EXCLAVEKIT Platform = 18 // PLATFORM_IOS_EXCLAVEKIT - PLATFORM_TVOS_EXCLAVECORE Platform = 19 // PLATFORM_TVOS_EXCLAVECORE - PLATFORM_TVOS_EXCLAVEKIT Platform = 20 // PLATFORM_TVOS_EXCLAVEKIT - PLATFORM_WATCHOS_EXCLAVECORE Platform = 21 // PLATFORM_WATCHOS_EXCLAVECORE - PLATFORM_WATCHOS_EXCLAVEKIT Platform = 22 // PLATFORM_WATCHOS_EXCLAVEKIT - - any Platform = 0xFFFFFFFF // PLATFORM_ANY + Unknown Platform = 0 // PLATFORM_UNKNOWN + macOS Platform = 1 // PLATFORM_MACOS + iOS Platform = 2 // PLATFORM_IOS + tvOS Platform = 3 // PLATFORM_TVOS + watchOS Platform = 4 // PLATFORM_WATCHOS + bridgeOS Platform = 5 // PLATFORM_BRIDGEOS + macCatalyst Platform = 6 // PLATFORM_MACCATALYST + iOsSimulator Platform = 7 // PLATFORM_IOSSIMULATOR + tvOsSimulator Platform = 8 // PLATFORM_TVOSSIMULATOR + watchOsSimulator Platform = 9 // PLATFORM_WATCHOSSIMULATOR + Driverkit Platform = 10 // PLATFORM_DRIVERKIT + visionOS Platform = 11 // PLATFORM_VISIONOS + visionOsSimulator Platform = 12 // PLATFORM_VISIONOSSIMULATOR + Firmware Platform = 13 // PLATFORM_FIRMWARE + SepOS Platform = 14 // PLATFORM_SEPOS + macOSExclaveCore Platform = 15 // PLATFORM_MACOS_EXCLAVECORE + macOSExclaveKit Platform = 16 // PLATFORM_MACOS_EXCLAVEKIT + iOSExclaveCore Platform = 17 // PLATFORM_IOS_EXCLAVECORE + iOSExclaveKit Platform = 18 // PLATFORM_IOS_EXCLAVEKIT + tvOsExclaveCore Platform = 19 // PLATFORM_TVOS_EXCLAVECORE + tvOsExclaveKit Platform = 20 // PLATFORM_TVOS_EXCLAVEKIT + watchOsExclaveCore Platform = 21 // PLATFORM_WATCHOS_EXCLAVECORE + watchOsExclaveKit Platform = 22 // PLATFORM_WATCHOS_EXCLAVEKIT + + ANY Platform = 0xFFFFFFFF // PLATFORM_ANY ) func GetPlatformByName(name string) (Platform, error) { @@ -104,26 +104,42 @@ func GetPlatformByName(name string) (Platform, error) { return watchOS, nil case "bridgeos": return bridgeOS, nil - case "maccatalyst": + case "maccatalyst", "catalyst": return macCatalyst, nil - case "iossimulator": - return iOSSimulator, nil - case "tvossimulator": - return tvOSSimulator, nil - case "watchossimulator": - return watchOSSimulator, nil + case "iossimulator", "ios_simulator": + return iOsSimulator, nil + case "tvossimulator", "tvos_simulator": + return tvOsSimulator, nil + case "watchossimulator", "watchos_simulator": + return watchOsSimulator, nil case "driverkit": - return driverKit, nil - case "realityos": - return realityOS, nil - case "realityossimulator": - return realityOSSimulator, nil + return Driverkit, nil + case "visionos": + return visionOS, nil + case "visionossimulator", "visionos_simulator": + return visionOsSimulator, nil case "firmware": - return firmware, nil + return Firmware, nil case "sepos": - return sepOS, nil + return SepOS, nil + case "macosexclavecore", "macos_exclavecore": + return macOSExclaveCore, nil + case "macosexclavekit", "macos_exclavekit": + return macOSExclaveKit, nil + case "iosexclavecore", "ios_exclavecore": + return iOSExclaveCore, nil + case "iosexclavekit", "ios_exclavekit": + return iOSExclaveKit, nil + case "tvosexclavecore", "tvos_exclavecore": + return tvOsExclaveCore, nil + case "tvosexclavekit", "tvos_exclavekit": + return tvOsExclaveKit, nil + case "watchosexclavecore", "watchos_exclavecore": + return watchOsExclaveCore, nil + case "watchosexclavekit", "watchos_exclavekit": + return watchOsExclaveKit, nil default: - return unknown, errors.New("unknown platform") + return Unknown, fmt.Errorf("unknown platform") } } diff --git a/types/types_string.go b/types/types_string.go index b3d9298..a2cccb4 100644 --- a/types/types_string.go +++ b/types/types_string.go @@ -8,39 +8,39 @@ func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. var x [1]struct{} - _ = x[unknown-0] + _ = x[Unknown-0] _ = x[macOS-1] _ = x[iOS-2] _ = x[tvOS-3] _ = x[watchOS-4] _ = x[bridgeOS-5] _ = x[macCatalyst-6] - _ = x[iOSSimulator-7] - _ = x[tvOSSimulator-8] - _ = x[watchOSSimulator-9] - _ = x[driverKit-10] - _ = x[realityOS-11] - _ = x[realityOSSimulator-12] - _ = x[firmware-13] - _ = x[sepOS-14] - _ = x[PLATFORM_MACOS_EXCLAVECORE-15] - _ = x[PLATFORM_MACOS_EXCLAVEKIT-16] - _ = x[PLATFORM_IOS_EXCLAVECORE-17] - _ = x[PLATFORM_IOS_EXCLAVEKIT-18] - _ = x[PLATFORM_TVOS_EXCLAVECORE-19] - _ = x[PLATFORM_TVOS_EXCLAVEKIT-20] - _ = x[PLATFORM_WATCHOS_EXCLAVECORE-21] - _ = x[PLATFORM_WATCHOS_EXCLAVEKIT-22] - _ = x[any-4294967295] + _ = x[iOsSimulator-7] + _ = x[tvOsSimulator-8] + _ = x[watchOsSimulator-9] + _ = x[Driverkit-10] + _ = x[visionOS-11] + _ = x[visionOsSimulator-12] + _ = x[Firmware-13] + _ = x[SepOS-14] + _ = x[macOSExclaveCore-15] + _ = x[macOSExclaveKit-16] + _ = x[iOSExclaveCore-17] + _ = x[iOSExclaveKit-18] + _ = x[tvOsExclaveCore-19] + _ = x[tvOsExclaveKit-20] + _ = x[watchOsExclaveCore-21] + _ = x[watchOsExclaveKit-22] + _ = x[ANY-4294967295] } const ( - _Platform_name_0 = "unknownmacOSiOStvOSwatchOSbridgeOSmacCatalystiOSSimulatortvOSSimulatorwatchOSSimulatordriverKitrealityOSrealityOSSimulatorfirmwaresepOSPLATFORM_MACOS_EXCLAVECOREPLATFORM_MACOS_EXCLAVEKITPLATFORM_IOS_EXCLAVECOREPLATFORM_IOS_EXCLAVEKITPLATFORM_TVOS_EXCLAVECOREPLATFORM_TVOS_EXCLAVEKITPLATFORM_WATCHOS_EXCLAVECOREPLATFORM_WATCHOS_EXCLAVEKIT" - _Platform_name_1 = "any" + _Platform_name_0 = "UnknownmacOSiOStvOSwatchOSbridgeOSmacCatalystiOsSimulatortvOsSimulatorwatchOsSimulatorDriverkitvisionOSvisionOsSimulatorFirmwareSepOSmacOSExclaveCoremacOSExclaveKitiOSExclaveCoreiOSExclaveKittvOsExclaveCoretvOsExclaveKitwatchOsExclaveCorewatchOsExclaveKit" + _Platform_name_1 = "ANY" ) var ( - _Platform_index_0 = [...]uint16{0, 7, 12, 15, 19, 26, 34, 45, 57, 70, 86, 95, 104, 122, 130, 135, 161, 186, 210, 233, 258, 282, 310, 337} + _Platform_index_0 = [...]uint8{0, 7, 12, 15, 19, 26, 34, 45, 57, 70, 86, 95, 103, 120, 128, 133, 149, 164, 178, 191, 206, 220, 238, 255} ) func (i Platform) String() string {