Legacy mode for non-multiplatform stdlib sources

This commit is contained in:
Ilya Gorbunov
2017-11-02 21:54:41 +03:00
parent 4404257329
commit 31e00efa8f
@@ -45,7 +45,8 @@ class MemberBuilder(
val f get() = family
var hasPlatformSpecializations: Boolean = false
private val legacyMode = true
var hasPlatformSpecializations: Boolean = legacyMode
private set
var doc: String? = null; private set
@@ -143,10 +144,19 @@ class MemberBuilder(
fun build(builder: Appendable) {
// TODO: legacy mode when all is headerOnly + no_impl
// except functions with optional parameters - they are common + no_impl
val headerOnly: Boolean = platform == Platform.Common && hasPlatformSpecializations
val isImpl: Boolean = platform != Platform.Common && Platform.Common in allowedPlatforms
val headerOnly: Boolean
val isImpl: Boolean
if (!legacyMode) {
headerOnly = platform == Platform.Common && hasPlatformSpecializations
isImpl = platform != Platform.Common && Platform.Common in allowedPlatforms
}
else {
// legacy mode when all is headerOnly + no_impl
// except functions with optional parameters - they are common + no_impl
val hasOptionalParams = signature.contains("=")
headerOnly = platform == Platform.Common && !hasOptionalParams
isImpl = false
}
val returnType = returns ?: throw RuntimeException("No return type specified for $signature")