mingw-w64 headers and libs are
here/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
def-files for import libraries are in folder mingw-w64-crt\lib32\ or mingw-w64-crt\lib64\
leading undescore is missing in 32-bit def-files.
Addition to end of _mingw.h
#ifdef __POCC__
#ifdef _WIN64
#define __x86_64__
#define _AMD64_
#define __unaligned
#else
#define __i386__
#define _X86_
#endif
#include <wchar.h>
#include <intrin.h>
#define __buildmemorybarrier() {unsigned char Barrier;__asm {}};
#endif /* __POCC__ */
__buildmemorybarrier() is still broken.
32 bit def-files need to modify.
Helper program here:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <io.h>
int main(int argc, char **argv)
{
FILE *fi, *fo;
char buf[4096];
if (argc < 2)
{
printf("Usage:\n%s file\n", argv[0]);
return 1;
}
struct _finddata_t info;
intptr_t hf;
if ((hf = _findfirst(argv[1], &info)) != -1)
{
do
{
strcpy(buf, info.name);
strcat(buf, ".bak");
rename(info.name, buf);
if ((fi = fopen(buf, "r")) == NULL)
//if ((fi = fopen(info.name, "r")) == NULL)
{
fprintf(stderr, "can't open file '%s'\n", argv[1]);
return 1;
}
int iExp = 0;
//fo = stdout;
fo = fopen(info.name, "wt");
while (fgets(buf, sizeof(buf), fi))
{
if (!iExp && !strncmp(buf, "EXPORTS", 5))
{
iExp = 1;
fputs(buf, fo);
}
else
{
if (iExp && buf[0] != ';' && strchr(buf, '@')) // only stdcall
fputs("_", fo);
fputs(buf, fo);
}
}
if (fo != stdout)
fclose(fo);
fclose(fi);
} while (_findnext(hf, &info) == 0);
_findclose(hf);
}
return 0;
}