mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-05 09:30:35 +03:00
- enable `HAVE_LONGLONG` for MinGW and MSVC versions supporting it.
Necessary for `GNUmakefile`/`NMakefile` builds to create the same
binaries as CMake/autotools ones do.
- enable `HAVE_STDLIB_H`. It has been universally available on
Windows for a long time.
Fixes these clang-cl warnings:
```
src\wincng.c(444,5) : warning: implicit declaration of function 'free' is invalid in C99 [-Wimplicit-function-declaration]
free(buf);
^
src\wincng.c(491,20) : warning: implicitly declaring library function 'malloc' with type 'void *(unsigned long long)' [-Wimplicit-function-declaration]
pbHashObject = malloc(dwHashObject);
^
src\wincng.c(491,20) : note: include the header <stdlib.h> or explicitly provide a declaration for 'malloc'
src\wincng.c(2106,14) : warning: implicitly declaring library function 'realloc' with type 'void *(void *, unsigned long long)' [-Wimplicit-function-declaration]
bignum = realloc(bn->bignum, length);
^
src\wincng.c(2106,14) : note: include the header <stdlib.h> or explicitly provide a declaration for 'realloc'
3 warnings generated.
```
43 lines
774 B
C
43 lines
774 B
C
#ifndef LIBSSH2_CONFIG_H
|
|
#define LIBSSH2_CONFIG_H
|
|
|
|
#ifndef WIN32
|
|
#define WIN32
|
|
#endif
|
|
|
|
#ifndef _CRT_SECURE_NO_DEPRECATE
|
|
#define _CRT_SECURE_NO_DEPRECATE 1
|
|
#endif
|
|
|
|
#define HAVE_LIBCRYPT32
|
|
#define HAVE_WINSOCK2_H
|
|
#define HAVE_STDLIB_H
|
|
#define HAVE_IOCTLSOCKET
|
|
#define HAVE_SELECT
|
|
#define HAVE_SNPRINTF
|
|
|
|
#ifdef __MINGW32__
|
|
# define HAVE_UNISTD_H
|
|
# define HAVE_INTTYPES_H
|
|
# define HAVE_SYS_TIME_H
|
|
# define HAVE_GETTIMEOFDAY
|
|
# define HAVE_LONGLONG
|
|
# define HAVE_STRTOLL
|
|
#elif defined(_MSC_VER)
|
|
# if _MSC_VER >= 1310
|
|
# define HAVE_LONGLONG
|
|
# endif
|
|
# if _MSC_VER >= 1800
|
|
# define HAVE_STRTOLL
|
|
# endif
|
|
# if _MSC_VER < 1900
|
|
# undef HAVE_SNPRINTF
|
|
# if _MSC_VER < 1500
|
|
# define vsnprintf _vsnprintf
|
|
# endif
|
|
# define strdup _strdup
|
|
# endif
|
|
#endif
|
|
|
|
#endif /* LIBSSH2_CONFIG_H */
|