cleanup: windows: convert argv (UCS-2 to UTF-8) at earliest

Discussed at [1].

Use wmain under windows, drop the custom parsing and shell32 linkage.

There is no need for gc magic as this allocation is static.

[1] http://permalink.gmane.org/gmane.network.openvpn.devel/5433

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Clean-up: Presume that Linux is always IPv6 capable at build time

These days it is highly unlikely that OpenVPN will be built in a non-IPv6
capable Linux environment.  So remove compile-time related macros identifying
that.

This also solves an issue which was introduced in commit 51bd56f46f55177cf0f8b
where HAVE_TUN_PI is no longer detected.  The tun_pi struct is defined in
linux/if_tun.h, which will be checked for later on.  As this struct has history
in linux/if_tun.h all back to the beginning of the kernel git tree (2.6.12-rc2,
April 2005), it is considered not needed to check for this struct explicit.

[ v2: Commit 7c0a2b5f2b4409 modifies some of the checks this patch touches.  This
      patch just adopts to those changes ]

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Alon Bar-Lev <alon.barlev@gmail.com>
Message-Id: 1335521425-23391-1-git-send-email-davids@redhat.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6351
crash: packet_id_debug_print: sl may be null

Program received signal SIGSEGV, Segmentation fault.
packet_id_debug_print (msglevel=1174405255, p=0xa36bd0718,
pin=0x3de5feec1b0,
message=0xa330dde80 "PID_TEST", value=0) at
../../../src/openvpn/packet_id.c:504
504       for (i = 0; i < sl->x_size; ++i)

(gdb) print sl
$2 = (const struct seq_list *) 0x0

Reported in the past[1].

[1] http://thread.gmane.org/gmane.network.openvpn.devel/5466

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: James Yonan <james@openvpn.net>
Message-Id: 1333879485-2417-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6259
Message-Id: 4F9A6B4B.7060502@openvpn.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/6350
Signed-off-by: David Sommerseth <davids@redhat.com>
cleanup: syshead: remove OS_SPECIFIC_DIRSEP in favor of autoconf PATH_SEPARATOR

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: move O_BINARY detection to autoconf

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: remove useless WIN32_0_1

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: remove useless constant USE_64_BIT_COUNTERS

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: move apple specific CPPFLAGS out of syshead

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
clenaup: syshead: remove wait macros wrappers

WEXITSTATUS is POSIX, show me the platform that does not support this.

WIFEXITED is not used at Windows code.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: move likely,unlikely to basic.h

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: move sleep,random,syshead.h emulation to compat
cleanup: syshead: rename S_ERROR->S_ERRORS to avoid conflict with stropts.h

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: split pedantic into pedantic, lint

Split pedantic into two: pedantic (compiler only), lint (functional).
Move settings into basic.h.
Remove lint stub in tun.c.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: move _P1003_1B_VISIBLE to autoconf

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: move socket compat into basic.h

Probably not the best place, however, better than syshead.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: remove dead code

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: move SOL_IP emulation to autoconf

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: syshead: move ENABLE_MEMSTATS to autoconf

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
clenaup: syshead: reworder/cleanup includes

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
cleanup: remove check_subnet_conflict

Commeted out as "too many false positives".

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>