windows stuff

This commit is contained in:
Vitor Santos Costa 2013-01-19 11:47:14 +00:00
parent 0e262df2ee
commit 05f9a935e1
5 changed files with 406 additions and 394 deletions

View File

@ -27,10 +27,10 @@
* YAP_FindExecutable(argv[0]) should be called on yap initialization to
* locate the executable of Yap
*/
void
Yap_FindExecutable(char *name)
char *
Yap_FindExecutable(void)
{
return NULL;
return "yap";
}
void *

View File

@ -378,6 +378,12 @@ PL_EXPORT(void) Ssetbuffer(IOSTREAM *s, char *buf, size_t size);
PL_EXPORT(int64_t) Stell64(IOSTREAM *s);
PL_EXPORT(int) Sseek64(IOSTREAM *s, int64_t pos, int whence);
#ifdef __WINDOWS__
#if defined(_WINSOCKAPI_) || defined(NEEDS_SWINSOCK)
PL_EXPORT(SOCKET) Swinsock(IOSTREAM *s);
#endif
#endif
PL_EXPORT(int) ScheckBOM(IOSTREAM *s);
PL_EXPORT(int) SwriteBOM(IOSTREAM *s);
PL_EXPORT(ssize_t) Sread_user(void *handle, char *buf, size_t size);

View File

@ -41,11 +41,13 @@ SWI-Prolog.h and SWI-Stream.h
#include "SWI-Prolog.h"
#ifdef __WINDOWS__
#ifndef __YAP_PROLOG__
#ifdef WIN64
#include "config/win64.h"
#else
#include "config/win32.h"
#endif
#endif
#else
#include <config.h>
#endif

6
os/pl-stream.c Normal file → Executable file
View File

@ -21,13 +21,17 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef __WINDOWS__
#if defined(__WINDOWS__)|| defined(__WIN32)
#include "windows/uxnt.h"
#ifdef _YAP_NOT_INSTALLED_
#include <config.h>
#else
#ifdef WIN64
#include "config/win64.h"
#else
#include "config/win32.h"
#endif
#endif
#include <winsock2.h>
#include "windows/mswchar.h"
#define CRLF_MAPPING 1

2
os/pl-string.h Normal file → Executable file
View File

@ -27,7 +27,7 @@
COMMON(char *) store_string(const char *s);
COMMON(void) remove_string(char *s);
COMMON(char) digitName(int n, int small);
//COMMON(char) digitName(int n, int small);
COMMON(int) digitValue(int b, int c);
COMMON(bool) strprefix(const char *string, const char *prefix);
COMMON(bool) strpostfix(const char *string, const char *postfix);