peter-iakovlev / mtprotokit Goto Github PK
View Code? Open in Web Editor NEWUniversal MTProto framework for both iOS and OS X
Universal MTProto framework for both iOS and OS X
Hi,
the bundled afnetworking version 1.0, is not compatible with ipv6.
Background
TelegramMessenger/Telegram-iOS#829
MTAtomic
MTContext
MTMetaDisposable
MTMessageTransaction
MTSignalQueueState
MTSubscriber
MTRequestInternalId
also - switching this flag - "-std=gnu99", doesn't seem to make the Expected ';' at end of declaration list compiler error go away.
objc_library(
name = "MtProtoKit",
enable_modules = True,
module_name = "MtProtoKit",
srcs = glob([
"Sources/**/*.m",
"Sources/**/*.h",
]),
copts = [
"-Werror",
"-std=gnu99",
],
hdrs = glob([
"PublicHeaders/**/*.h",
]),
includes = [
"PublicHeaders",
],
deps = [
"//submodules/EncryptionProvider:EncryptionProvider",
],
sdk_frameworks = [
"Foundation",
"Security",
"SystemConfiguration",
"CFNetwork",
],
sdk_dylibs = [
"libz",
],
visibility = [
"//visibility:public",
],
)
UPDATE - actually just using
copts = [
"-std=gnu99",
],
made some errors go away.
UPDATE - new errors
#include <stdatomic.h>
UPDATE - the expected ';' at end of declaration list error is persisting even though I'm specifying -std=gnu99 in the MTProto copts bazel
https://gist.github.com/wweevv-johndpope/703cf760bcc68c9c8918269596d7fb7b
UPDATE -
I just use os_unfair_lock _lock; and it gets past error.
@interface MTDisposableSet ()
{
os_unfair_lock _lock;
...
}
if (OSAtomicCompareAndSwapPtr(block, 0, &_block))
->
if (atomic_compare_exchange_strong_explicit(block, 0, &_block, memory_order_acq_rel, memory_order_acquire))
UPDATE
@interface SSignalMulticastSubscribers : NSObject
{
volatile os_unfair_lock _lock;
...
}
changing
volatile os_unfair_lock _lock; -> os_unfair_lock _lock;
makes above some of the problems go away.
UPDATE
Finally compiling - but crashing due to problem below. how to rewrite
// if (atomic_compare_exchange_strong_explicit(block, 0, &_block))
/Users/jin/Documents/workspace/Telegram/submodules/MtProtoKit/MTProtoKit/MTProtoKit.h:74:9: 'MTProtoKit/AFURLConnectionOperation.h' file not found
@peter-iakovlev I was just wondering what is the license for this project ?
That would be awesome if we could use it by simply installing a pod.
pod 'MTProtoKit`, '~> 0.0.1'
'openssl/bn.h' file not found
use xcode 6.2 compile the results are as follows:
UFW (M iphonesimulator): ERROR: Build failed
Traceback (most recent call last):
File "/Users/admin/Library/Developer/Xcode/DerivedData/MtProtoKit-gzkxssspyozwjjbgmyuwkbgwnpjo/Build/Intermediates/MtProtoKit.build/Debug-iphonesimulator/MtProtoKit iOS.build/Script-D05A831218AFB3F9007F1076.sh", line 812, in
run_build()
File "/Users/admin/Library/Developer/Xcode/DerivedData/MtProtoKit-gzkxssspyozwjjbgmyuwkbgwnpjo/Build/Intermediates/MtProtoKit.build/Debug-iphonesimulator/MtProtoKit iOS.build/Script-D05A831218AFB3F9007F1076.sh", line 787, in run_build
add_symlinks_to_framework(project)
File "/Users/admin/Library/Developer/Xcode/DerivedData/MtProtoKit-gzkxssspyozwjjbgmyuwkbgwnpjo/Build/Intermediates/MtProtoKit.build/Debug-iphonesimulator/MtProtoKit iOS.build/Script-D05A831218AFB3F9007F1076.sh", line 675, in add_symlinks_to_framework
attempt_symlink(os.path.join(base_dir, "Versions", "Current"), os.environ['FRAMEWORK_VERSION'])
File "/Users/admin/Library/Developer/Xcode/DerivedData/MtProtoKit-gzkxssspyozwjjbgmyuwkbgwnpjo/Build/Intermediates/MtProtoKit.build/Debug-iphonesimulator/MtProtoKit iOS.build/Script-D05A831218AFB3F9007F1076.sh", line 493, in attempt_symlink
os.stat(os.path.abspath(os.path.join(link_path, "..", link_to)))
OSError: [Errno 2] No such file or directory: '/Users/admin/Library/Developer/Xcode/DerivedData/MtProtoKit-gzkxssspyozwjjbgmyuwkbgwnpjo/Build/Products/Debug-iphonesimulator/MtProtoKit iOS.framework/Versions/A'
Showing first 200 notices only
Command /bin/sh failed with exit code 1
Please help me,Thank you!
Does this work? is there a fix for this script error that occurs in the Telegram open source and in this version as well. Trying to figure out why Telegram would release and opensource code that does not build and has many errors. Thanks
Any chance there is a more comprehensive README, tutorial or examples I can refer to?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.