mainloop: factor out the query of the number of processors into a separate function
compat: Move into a subdirectory

In preparation for splitting up compat.c, move it and the header to a
subdirectory.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lib/compat/: Split compat.c into smaller files

Instead of having one monolithic file for all compat functions, separate
them by topic (by function, except in case of pread/pwrite).

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
syslog-ng.h: added windows.h inclusion

This patch adds the inclusion of the Win32 windows.h header into syslog-ng.h
through a compat/win32.h wrapper. It uses the WIN32_LEAN_AND_MEAN
macro to minimize the global namespace pollution.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
compat: added a number of time related function implementations for platforms that lack them

These functions are implemented:
  - clock_gettime() - based on gettimeofday, potentially platform independent
  - localtime_r()   - based on localtime(), potentially platform independent
  - strptime()      - implementation from NetBSD, potentially platform independent
  - nanosleep()     - Win32 specific
  - sleep()         - Win32 specific

Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
compat: add win32 specific fsync implementation
compat: add win32 mmap() implementation
compat: add win32 specific getpid() implementation
compat: add win32 specific socket helpers

This patch adds a number of socket functions that are missing on Win32.

These are:
  - inet_ntop
  - inet_pton
  - inet_aton

Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
compat: add win32 specific iov implementation
compat: add strtok_r implementation for platforms that lack that
compat: add win32 iv_fd implementation
compat: add win32 implementation for syslog() constants
get_processor_count: add win32 port
WIP: eventlog-tags
WIP: g_socket_get_error() on win32