Fossil

Check-in [45b76344]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Further magic _WIN32_WINNT changes to fix the build for mingw.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 45b76344362cba9a9b3ae687760e34e32b43a3f1
User & Date: drh 2016-11-04 17:28:36
Context
2016-11-04
17:35
int/size_t pedantry check-in: 30d96141 user: andygoth tags: trunk
17:28
Further magic _WIN32_WINNT changes to fix the build for mingw. check-in: 45b76344 user: drh tags: trunk
17:25
Modify linenoise.c so that it can build with -std=c89. Baseline linenoise.c relied on snprintf(), strdup(), and strcasecmp() which are technically not in C89. Since linenoise.c's only purpose (at present) is to implement the SQLite shell, make use of the SQLite compatibility functions. Following this change, "fossil clean -f && CFLAGS='-std=c89 -Wall' ./configure && make" builds without warnings or errors on gcc 4.4.7 20120313 (Red Hat 4.4.7-3) on CentOS release 6.4 (Final). Unrelated note: discovered during testing that "CFLAGS=-Werror ./configure" fails to add -lm to link step due to conflicting types for built-in function "sin" being regarded as an error. check-in: 8133501e user: andygoth tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/http_socket.c.

21
22
23
24
25
26
27
28


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
** This file implements a singleton.  A single client socket may be active
** at a time.  State information is stored in static variables.  The identity
** of the server is held in global variables that are set by url_parse().
**
** Low-level sockets are abstracted out into this module because they
** are handled different on Unix and windows.
*/



#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1  /* IPv6 won't compile on Solaris without this */
#endif
#include "config.h"
#include "http_socket.h"
#if defined(_WIN32)
#  if !defined(_WIN32_WINNT)
#    define _WIN32_WINNT 0x0501
#  endif
#  include <winsock2.h>
#  include <ws2tcpip.h>
#else
#  include <netinet/in.h>
#  include <arpa/inet.h>
#  include <sys/socket.h>
#  include <netdb.h>







|
>
>






<
<
<







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36



37
38
39
40
41
42
43
** This file implements a singleton.  A single client socket may be active
** at a time.  State information is stored in static variables.  The identity
** of the server is held in global variables that are set by url_parse().
**
** Low-level sockets are abstracted out into this module because they
** are handled different on Unix and windows.
*/
#if defined(_WIN32)
# define _WIN32_WINNT 0x501
#endif
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1  /* IPv6 won't compile on Solaris without this */
#endif
#include "config.h"
#include "http_socket.h"
#if defined(_WIN32)



#  include <winsock2.h>
#  include <ws2tcpip.h>
#else
#  include <netinet/in.h>
#  include <arpa/inet.h>
#  include <sys/socket.h>
#  include <netdb.h>