* autoload.c: Define DECLSPEC_IMPORT for mingw-w64 headers.
* filemanip.h: Include <sys/types.h> to fix missing mode_t typedef
error with mingw-w64 headers.
* gpg-packet.cc: Include "win32.h" to avoid macro redefinition
errors with mingw-w64 headers.
(ARRAYSIZE): Do not redefine.
* main.cc (_argv): Declare if using mingw-w64 headers.
(WinMain): Move up _argv definition to before it is first used.
* ntdll.h: Include PSDK headers with mingw-w64 instead of DDK.
* package_message.h: Include "win32.h" instead of <windows.h>.
* propsheet.cc (PROPSHEETHEADER_V1_SIZE): Do not redefine.
* win32.h: Include <sys/types.h> to fix missing mode_t typedef
error with mingw-w64 headers.
Define DECLSPEC_IMPORT for mingw-w64 headers.
+2012-09-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+ Fix build with mingw-w64 headers.
+ * autoload.c: Define DECLSPEC_IMPORT for mingw-w64 headers.
+ * filemanip.h: Include <sys/types.h> to fix missing mode_t typedef
+ error with mingw-w64 headers.
+ * gpg-packet.cc: Include "win32.h" to avoid macro redefinition
+ errors with mingw-w64 headers.
+ (ARRAYSIZE): Do not redefine.
+ * main.cc (_argv): Declare if using mingw-w64 headers.
+ (WinMain): Move up _argv definition to before it is first used.
+ * ntdll.h: Include PSDK headers with mingw-w64 instead of DDK.
+ * package_message.h: Include "win32.h" instead of <windows.h>.
+ * propsheet.cc (PROPSHEETHEADER_V1_SIZE): Do not redefine.
+ * win32.h: Include <sys/types.h> to fix missing mode_t typedef
+ error with mingw-w64 headers.
+ Define DECLSPEC_IMPORT for mingw-w64 headers.
+
2012-08-30 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
First step towards X86-64 compatibility.
#endif
#define WIN32_LEAN_AND_MEAN
+#define DECLSPEC_IMPORT
#include <windows.h>
typedef struct {
#ifndef SETUP_FILEMANIP_H
#define SETUP_FILEMANIP_H
+#include <sys/types.h>
#include <string>
extern int find_tar_ext (const char *path);
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include "win32.h"
#include "io_stream.h"
#include "gcrypt.h"
#include "gpg-packet.h"
#define MESSAGE while (0) msg
#endif /* CRYPTODEBUGGING */
+#ifndef ARRAYSIZE
#define ARRAYSIZE(_ar) (sizeof (_ar) / sizeof (_ar[0]))
+#endif
static const struct { char from; char to; } RFC4880HashCodesToGPGHashCodes[] =
{
#include <wincon.h>
#include <fstream>
+#ifdef __MINGW64_VERSION_MAJOR
+extern char **_argv;
+#endif
+
using namespace std;
HINSTANCE hinstance;
snprintf(locale, sizeof locale, ".%u", GetACP());
setlocale(LC_ALL, locale);
+ char **_argv;
+ int argc;
+ for (argc = 0, _argv = __argv; *_argv; _argv++)
+ ++argc;
+ _argv = __argv;
+
set_legacy (_argv[0]);
if (is_legacy && IsWindowsNT ())
GetCurrentDirectory (MAX_PATH, cwd);
local_dir = std::string (cwd);
- // TODO: make an equivalent for __argv under cygwin.
- char **_argv;
- int argc;
- for (argc = 0, _argv = __argv; *_argv; _argv++)
- ++argc;
- _argv = __argv;
-
if (!GetOption::GetInstance ().Process (argc,_argv, NULL))
exit (1);
#define NTOSAPI
+#ifdef __MINGW64_VERSION_MAJOR
+#include <winternl.h>
+#include <ntdef.h>
+#include <ntstatus.h>
+#define DDKAPI __stdcall
+#else
#include "ddk/ntapi.h"
#include "ddk/ntifs.h"
+#endif
extern "C" {
NTSTATUS DDKAPI NtCreateFile (PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES,
#include "UserSettings.h"
#include "state.h"
#include <stdlib.h>
-#include <windows.h>
+#include "win32.h"
class packagemessage
{
}
DLLVERSIONINFO;
typedef HRESULT CALLBACK (*DLLGETVERSIONPROC) (DLLVERSIONINFO * pdvi);
+
+#ifndef PROPSHEETHEADER_V1_SIZE
#define PROPSHEETHEADER_V1_SIZE 40
+#endif
// Sort of a "hidden" Windows structure. Used in the PropSheetCallback.
#include <pshpack1.h>
#ifndef SETUP_WIN32_H
#define SETUP_WIN32_H
+#include <sys/types.h>
#include <string>
/* Any include of <windows.h> should be through this file, which wraps it in
* multiple declaration errors at link time. This define turns that off again.
* It will default to off again in later w32api versions, but we need to work
* with 3.1 for now. */
+#define DECLSPEC_IMPORT
#define WINBASEAPI
/* Require at least Internet Explorer 3, in order to have access to