mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-05-26 14:06:30 +00:00
conditional JSON options for iOS/Android (#318)
* conditional JSON options for iOS/Android * update cabal file
This commit is contained in:
committed by
GitHub
parent
229e2607d7
commit
137afb68fe
@@ -27,6 +27,9 @@ extra-source-files:
|
||||
README.md
|
||||
CHANGELOG.md
|
||||
|
||||
if (os(android))
|
||||
ghc-option: -DANDROID
|
||||
|
||||
library
|
||||
exposed-modules:
|
||||
Simplex.Messaging.Agent
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
@@ -97,7 +98,11 @@ enumJSON tagModifier =
|
||||
}
|
||||
|
||||
sumTypeJSON :: (String -> String) -> J.Options
|
||||
#if defined(ANDROID)
|
||||
sumTypeJSON = taggedObjectJSON
|
||||
#else
|
||||
sumTypeJSON = singleFieldJSON
|
||||
#endif
|
||||
|
||||
taggedObjectJSON :: (String -> String) -> J.Options
|
||||
taggedObjectJSON tagModifier =
|
||||
|
||||
Reference in New Issue
Block a user