mirror of
				https://github.com/libssh2/libssh2.git
				synced 2025-11-03 22:13:11 +03:00 
			
		
		
		
	portability: introduce LIBSSH2_INT64_T_FORMAT for 64bit printf()s
As pointed out in bug #177, some of the Windows compilers use %I64 to output 64 bit variables with the printf family.
This commit is contained in:
		@@ -1149,4 +1149,11 @@ void _libssh2_init_if_needed (void);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#define ARRAY_SIZE(a) (sizeof ((a)) / sizeof ((a)[0]))
 | 
					#define ARRAY_SIZE(a) (sizeof ((a)) / sizeof ((a)[0]))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* define to output the libssh2_int64_t type in a *printf() */
 | 
				
			||||||
 | 
					#if defined( BORLANDC ) || defined( _MSC_VER ) || defined( MINGW32 )
 | 
				
			||||||
 | 
					#define LIBSSH2_INT64_T_FORMAT "I64"
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					#define LIBSSH2_INT64_T_FORMAT "ll"
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* LIBSSH2_H */
 | 
					#endif /* LIBSSH2_H */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -939,7 +939,8 @@ scp_send(LIBSSH2_SESSION * session, const char *path, int mode,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        session->scpSend_response_len =
 | 
					        session->scpSend_response_len =
 | 
				
			||||||
            snprintf((char *) session->scpSend_response,
 | 
					            snprintf((char *) session->scpSend_response,
 | 
				
			||||||
                     LIBSSH2_SCP_RESPONSE_BUFLEN, "C0%o %llu %s\n", mode,
 | 
					                     LIBSSH2_SCP_RESPONSE_BUFLEN, "C0%o %"
 | 
				
			||||||
 | 
					                     LIBSSH2_INT64_T_FORMAT "u %s\n", mode,
 | 
				
			||||||
                     size, base);
 | 
					                     size, base);
 | 
				
			||||||
        _libssh2_debug(session, LIBSSH2_TRACE_SCP, "Sent %s",
 | 
					        _libssh2_debug(session, LIBSSH2_TRACE_SCP, "Sent %s",
 | 
				
			||||||
                       session->scpSend_response);
 | 
					                       session->scpSend_response);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user