cloudtrends / doubango

Automatically exported from code.google.com/p/doubango
0 stars 0 forks source link

tinyNET does not compile on MAC + fix/patch #233

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. try to compile r867 on mac
2. get error as reported on mailing list on february 21st
https://groups.google.com/forum/#!msg/doubango/tZxUqXuK5Es/JRN-TpcWjvgJ

What is the expected output? What do you see instead?
should compiles, does not compile.

What version of the product are you using? On what operating system?
r867, macOS X 10.7.5, gnu tools (not xcode)

Please provide any additional information below.
here is a fix:
Index: tinyNET/src/tls/tnet_tls.h

note that this typedef is actually done in openssl under windows, there there 
is a possibility to see an error with this patch under windows. I have no 
windows computer at hand to test right now.

===================================================================
--- tinyNET/src/tls/tnet_tls.h  (revision 867)
+++ tinyNET/src/tls/tnet_tls.h  (working copy)
@@ -46,6 +46,7 @@
 TNET_BEGIN_DECLS

 typedef void tnet_tls_socket_handle_t;
+typedef struct ssl_ctx_st SSL_CTX;

 int tnet_tls_socket_connect(tnet_tls_socket_handle_t* self);
 int tnet_tls_socket_accept(tnet_tls_socket_handle_t* self);
@@ -54,7 +55,7 @@
 int tnet_tls_socket_recv(tnet_tls_socket_handle_t* self, void** data, tsk_size_t *size, tsk_bool_t *isEncrypted);

 TINYNET_API tsk_bool_t tnet_tls_is_supported();
-TINYNET_API tnet_tls_socket_handle_t* tnet_tls_socket_create(tnet_fd_t fd, 
struct ssl_ctx_st* ssl_ctx);
+TINYNET_API tnet_tls_socket_handle_t* tnet_tls_socket_create(tnet_fd_t fd, 
SSL_CTX* ssl_ctx);

 TINYNET_GEXTERN const tsk_object_def_t *tnet_tls_socket_def_t;

Index: tinyNET/src/tls/tnet_tls.c
===================================================================
--- tinyNET/src/tls/tnet_tls.c  (revision 867)
+++ tinyNET/src/tls/tnet_tls.c  (working copy)
@@ -57,7 +57,7 @@
 #endif
 }

-tnet_tls_socket_handle_t* tnet_tls_socket_create(tnet_fd_t fd, struct 
ssl_ctx_st* ssl_ctx)
+tnet_tls_socket_handle_t* tnet_tls_socket_create(tnet_fd_t fd, SSL_CTX* 
ssl_ctx)
 {
 #if !HAVE_OPENSSL
        TSK_DEBUG_ERROR("OpenSSL not enabled");

Original issue reported on code.google.com by agouaill...@gmail.com on 6 Apr 2013 at 4:38

GoogleCodeExporter commented 9 years ago
just add a forward declaration instead of "typedef"ing SSL_CTX. On Linux, this 
suppress the warning. Will be part of the next commit.

Original comment by boss...@yahoo.fr on 9 Apr 2013 at 5:11

GoogleCodeExporter commented 9 years ago
r870+

Original comment by boss...@yahoo.fr on 9 Apr 2013 at 11:24

GoogleCodeExporter commented 9 years ago
verified.

Original comment by agouaill...@gmail.com on 10 Apr 2013 at 1:39