aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPetar Koretic <petar.koretic@sartura.hr>2014-03-20 09:59:42 +0000
committerAndreas Schneider <asn@cryptomilk.org>2014-03-27 10:45:54 +0100
commit00d4fbe75336b66262fdca86430655094adb8322 (patch)
treecde0798824c0afc8470fd9b5ad9b3f7d7084dd86 /include
parentdee8e5688b4395ee379fd7f36f4a488d57fd0d6c (diff)
downloadlibssh-00d4fbe75336b66262fdca86430655094adb8322.tar.gz
libssh-00d4fbe75336b66262fdca86430655094adb8322.tar.xz
libssh-00d4fbe75336b66262fdca86430655094adb8322.zip
libssh: libhpp: fix multiple definitions for acceptForward function
Defining a non inlined class function in a header will cause multiple definitions when header is included in more that one file since for each file function will get defined. Signed-off-by: Petar Koretic <petar.koretic@sartura.hr> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include')
-rw-r--r--include/libssh/libsshpp.hpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/libssh/libsshpp.hpp b/include/libssh/libsshpp.hpp
index 71d6ff5e..b5169512 100644
--- a/include/libssh/libsshpp.hpp
+++ b/include/libssh/libsshpp.hpp
@@ -361,8 +361,8 @@ public:
* @see ssh_channel_forward_accept
* @see Session::listenForward
*/
- Channel *acceptForward(int timeout_ms);
- /* acceptForward is implemented later in this file */
+ inline Channel *acceptForward(int timeout_ms);
+ /* implemented outside the class due Channel references */
void_throwable cancelForward(const char *address, int port){
int err=ssh_channel_cancel_forward(c_session, address, port);
@@ -581,8 +581,7 @@ private:
};
-/* This code cannot be put inline due to references to Channel */
-Channel *Session::acceptForward(int timeout_ms){
+inline Channel *Session::acceptForward(int timeout_ms){
ssh_channel forward =
ssh_channel_accept_forward(c_session, timeout_ms, NULL);
ssh_throw_null(c_session,forward);