summaryrefslogtreecommitdiff
path: root/formats/protobuf/commonTest/src/kotlinx/serialization/test/CurrentPlatform.common.kt
blob: c4a6b986a64186b612d40b4c0e771fbcb0c381e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * Copyright 2017-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

package kotlinx.serialization.test

enum class Platform {
    JVM, JS_LEGACY, JS_IR, NATIVE
}

public expect val currentPlatform: Platform

public fun isJs(): Boolean = currentPlatform == Platform.JS_LEGACY || currentPlatform == Platform.JS_IR
public fun isJsLegacy(): Boolean = currentPlatform == Platform.JS_LEGACY
public fun isJvm(): Boolean = currentPlatform == Platform.JVM
public fun isNative(): Boolean = currentPlatform == Platform.NATIVE