AC_PREREQ(2.61)
AC_INIT([gnunet], [0.9.0pre1],[bug-gnunet@gnu.org])
AM_INIT_AUTOMAKE([gnunet], [0.9.0pre1])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_HEADERS([gnunet_config.h])
AH_TOP([#define _GNU_SOURCE 1])
LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols"
LIBS="$LIBS -lws2_32 -lplibc"
CFLAGS="-mms-bitfields $CFLAGS"
+ CPPFLAGS="-D_WIN32_WINNT=0x0501 $CPPFLAGS"
build_target="mingw"
AC_PROG_CXX
LIBPREFIX=lib
*/
enum GNUNET_ErrorType
{
+ GNUNET_ERROR_TYPE_NONE = 0,
GNUNET_ERROR_TYPE_ERROR = 1,
GNUNET_ERROR_TYPE_WARNING = 2,
GNUNET_ERROR_TYPE_INFO = 4,
#ifdef _MSC_VER
#include <Winsock2.h>
+#include <ws2tcpip.h>
#else
#ifndef MINGW
#include <netdb.h>
#include <stdarg.h>
#include <errno.h>
#include <signal.h>
+#ifdef WINDOWS
+#include <malloc.h> /* for alloca(), on other OSes it's in stdlib.h */
+#endif
#ifndef _MSC_VER
#include <unistd.h> /* KLB_FIX */
#endif
#include "langinfo.h"
#endif
-#include <windows.h>
+#include <winsock2.h>
#include <ws2tcpip.h>
+#include <windows.h>
#include <sys/types.h>
#include <time.h>
#include <stdio.h>
BOOL _plibc_DereferenceShortcut(char *pszShortcut);
char *plibc_ChooseDir(char *pszTitle, unsigned long ulFlags);
char *plibc_ChooseFile(char *pszTitle, unsigned long ulFlags);
-long QueryRegistry(HKEY hMainKey, char *pszKey, char *pszSubKey,
+long QueryRegistry(HKEY hMainKey, const char *pszKey, const char *pszSubKey,
char *pszBuffer, long *pdLength);
BOOL __win_IsHandleMarkedAsBlocking(int hHandle);
#include <sys/timeb.h>
#include <time.h>
#include <dirent.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
#include <windows.h>
-#include <winsock.h>
#include <winerror.h>
#include <iphlpapi.h>
#include <shlobj.h>
BOOL CreateShortcut (const char *pszSrc, const char *pszDest);
BOOL DereferenceShortcut (char *pszShortcut);
- long QueryRegistry (HKEY hMainKey, char *pszKey, char *pszSubKey,
+ long QueryRegistry (HKEY hMainKey, const char *pszKey, const char *pszSubKey,
char *pszBuffer, long *pdLength);
int ListNICs (void (*callback) (void *, const char *, int), void *cls);
BOOL AddPathAccessRights (char *lpszFileName, char *lpszAccountName,
*/
#define _GNU_SOURCE
-#include <ws2tcpip.h>
#include <winsock2.h>
+#include <ws2tcpip.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
return GNUNET_ERROR_TYPE_WARNING;
if (0 == strcasecmp (log, _("ERROR")))
return GNUNET_ERROR_TYPE_ERROR;
+ if (0 == strcasecmp (log, _("NONE")))
+ return GNUNET_ERROR_TYPE_NONE;
return GNUNET_ERROR_TYPE_INVALID;
}
struct GNUNET_CONNECTION_Handle *h = ap->h;
struct AddressProbe *pos;
int error;
- unsigned int len;
+ socklen_t len;
GNUNET_assert (ap->sock != NULL);
GNUNET_CONTAINER_DLL_remove (h->ap_head, h->ap_tail, ap);
PROCESS_INFORMATION proc;
int argcount = 0;
char non_const_filename[MAX_PATH +1];
- int filenamelen = 0;
struct GNUNET_OS_Process *gnunet_proc = NULL;
GNUNET_assert (lsocks == NULL);
/**
* Signal handler called for SIGPIPE.
*/
+#ifndef MINGW
static void
sighandler_pipe ()
{
return;
}
-
+#endif
/**
* Signal handler called for signals that should cause us to shutdown.
*/
w32_sigchld_handler = handler;
else
{
- __p_sig_fn_t sigret = signal (signum, handler);
+ __p_sig_fn_t sigret = signal (signum, (__p_sig_fn_t) handler);
if (sigret == SIG_ERR)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
itmp = tmp;
finSize = tmpSize;
if (iconv (cd,
-#if FREEBSD || DARWIN
+#if FREEBSD || DARWIN || WINDOWS
(const char **) &input,
#else
(char **) &input,
* @remarks Call GetLastError() to obtain extended error information.\r
* @see http://support.microsoft.com/?scid=kb;en-us;132958\r
*/\r
-BOOL _GetAccountSid(LPTSTR SystemName, LPTSTR AccountName, PSID * Sid)\r
+BOOL _GetAccountSid(LPCTSTR SystemName, LPCTSTR AccountName, PSID * Sid)\r
{\r
LPTSTR ReferencedDomain = NULL;\r
DWORD cbSid = 128; /* initial allocation attempt */\r
* @param pszName the name of the account\r
* @param pszDesc description of the account\r
*/\r
-int CreateServiceAccount(char *pszName, char *pszDesc)\r
+int CreateServiceAccount(const char *pszName, const char *pszDesc)\r
{\r
USER_INFO_1 ui;\r
USER_INFO_1008 ui2;\r
STATUS_SUCCESS)\r
return 3;\r
\r
- _GetAccountSid(NULL, (LPTSTR) pszName, &pSID);\r
+ _GetAccountSid(NULL, (LPCTSTR) pszName, &pSID);\r
\r
- if (_SetPrivilegeOnAccount(hPolicy, pSID, L"SeServiceLogonRight", TRUE) != STATUS_SUCCESS)\r
+ if (_SetPrivilegeOnAccount(hPolicy, pSID, (LPWSTR) L"SeServiceLogonRight", TRUE) != STATUS_SUCCESS)\r
return 4;\r
\r
- _SetPrivilegeOnAccount(hPolicy, pSID, L"SeDenyInteractiveLogonRight", TRUE);\r
- _SetPrivilegeOnAccount(hPolicy, pSID, L"SeDenyBatchLogonRight", TRUE);\r
- _SetPrivilegeOnAccount(hPolicy, pSID, L"SeDenyNetworkLogonRight", TRUE);\r
+ _SetPrivilegeOnAccount(hPolicy, pSID, (LPWSTR) L"SeDenyInteractiveLogonRight", TRUE);\r
+ _SetPrivilegeOnAccount(hPolicy, pSID, (LPWSTR) L"SeDenyBatchLogonRight", TRUE);\r
+ _SetPrivilegeOnAccount(hPolicy, pSID, (LPWSTR) L"SeDenyNetworkLogonRight", TRUE);\r
\r
GNLsaClose(hPolicy);\r
\r
NULL, (DWORD) dwErr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &err,\r
0, NULL ))\r
{\r
- err = "";\r
+ err = (char *) LocalAlloc (LMEM_FIXED | LMEM_ZEROINIT, 1);\r
}\r
\r
mem = strlen(err) + strlen(prefix) + 20;\r
struct sockaddr_in addr;
memset(&addr, 0, sizeof addr);
- unsigned int addrlen = sizeof addr;
+ socklen_t addrlen = sizeof addr;
int r;
r = GNUNET_NETWORK_socket_recvfrom(dnsout,
#ifndef _WIN32
#include <arpa/inet.h>
#else
+#include <winsock2.h>
#include <ws2tcpip.h>
#endif