forked from vysheng/tg
-
Notifications
You must be signed in to change notification settings - Fork 52
/
telegram-cli-cygwin.patch
38 lines (35 loc) · 1.95 KB
/
telegram-cli-cygwin.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- tg/Makefile 2016-07-24 18:04:11.022621500 +0200
+++ tg-cygwin/Makefile 2016-07-24 22:55:32.710938800 +0200
@@ -4,9 +4,9 @@
LDFLAGS= -L/usr/local/lib -L/usr/lib -L/usr/lib
CPPFLAGS= -I/usr/local/include -I/usr/include -I/usr/include
DEFS=-DHAVE_CONFIG_H
-COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC
+COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter
EXTRA_LIBS=-ljansson -lconfig -lz -levent -lreadline -llua-5.2 -lssl -lcrypto
-LOCAL_LDFLAGS=-rdynamic -ggdb -levent ${EXTRA_LIBS} -ldl -lpthread -lutil
+LOCAL_LDFLAGS=-ggdb -levent ${EXTRA_LIBS} -ldl -lpthread -lutil
LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS}
DEP=dep
--- tg\loop.c Sun Jul 24 15:30:11 2016
+++ tg-cygwin\loop.c Sat Jul 23 17:51:49 2016
@@ -489,8 +489,9 @@
close (auth_file_fd);
}
-void write_secret_chat (tgl_peer_t *Peer, void *extra) {
- struct tgl_secret_chat *P = (void *)Peer;
+// In Cygwin's Python, _P is marco constant. So change tgl_peer_t *_P -> tgl_peer_t *_Peer
+void write_secret_chat (tgl_peer_t *_Peer, void *extra) {
+ struct tgl_secret_chat *P = (void *)_Peer;
if (tgl_get_peer_type (P->id) != TGL_PEER_ENCR_CHAT) { return; }
if (P->state != sc_ok) { return; }
int *a = extra;
@@ -737,7 +738,8 @@
vlogprintf (E_WARNING, "Accepting incoming connection\n");
socklen_t clilen = 0;
struct sockaddr_in cli_addr;
- int fd = accept (efd, (struct sockaddr *)&cli_addr, &clilen);
+ // In Cygwin, put unsigned int in socklen_t produce warning. Add (socklen_t *) casting
+ int fd = accept (efd, (struct sockaddr *)&cli_addr, (socklen_t *)&clilen);
assert (fd >= 0);
struct bufferevent *bev = bufferevent_socket_new (TLS->ev_base, fd, 0);