Changes supplied bt Hitoshi Tanaka to allow XSpice to compile using MinGW in Windows.
This commit is contained in:
parent
16db93285e
commit
51988dfb80
|
|
@ -1,3 +1,12 @@
|
|||
2005-06-12 Steven Borley <steven.borley@virgin.net>
|
||||
|
||||
* Changes supplied bt Hitoshi Tanaka to allow XSpice to compile using MinGW
|
||||
in Windows. Main change points are as follows:
|
||||
(1) dlopen(), dlsym(), dlclose() and dlerror() were changed
|
||||
to the functions of Windows. (src/spicelib/dev.c)
|
||||
(2) The functions relation to IPC were removed. (src/xspice/ipc/ipc.c,
|
||||
and src/xspice/ipc/ipcsockets.c)
|
||||
|
||||
2005-06-09 Steven Borley <steven.borley@virgin.net>
|
||||
|
||||
* Fixed *# command operation (src/frontend/inp.c)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
* Copyright (c) 1990 University of California
|
||||
* Copyright (c) 2000 Arno W. Peters
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and
|
||||
* its documentation without fee, and without a written agreement is
|
||||
* hereby granted, provided that the above copyright notice, this
|
||||
|
|
@ -39,7 +41,20 @@
|
|||
#ifdef XSPICE
|
||||
/*saj headers for xspice*/
|
||||
#include <string.h> /* for strcpy, strcat*/
|
||||
#ifndef HAS_WINDOWS
|
||||
#include <dlfcn.h> /* to load libraries*/
|
||||
#else /* ifdef HAS_WINDOWS */
|
||||
#include <windows.h>
|
||||
#include "wstdio.h"
|
||||
void *dlopen (const char *, int);
|
||||
void *dlsym (void *, const char *);
|
||||
int dlclose (void *);
|
||||
char *dlerror (void);
|
||||
#define RTLD_LAZY 1 /* lazy function call binding */
|
||||
#define RTLD_NOW 2 /* immediate function call binding */
|
||||
#define RTLD_GLOBAL 4 /* symbols in this dlopen'ed obj are visible to other dlopen'ed objs */
|
||||
static char errstr[128];
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
#include "dllitf.h" /* the coreInfo Structure*/
|
||||
#include "evtudn.h" /*Use defined nodes */
|
||||
|
||||
|
|
@ -488,3 +503,39 @@ int load_opus(char *name){
|
|||
|
||||
#endif
|
||||
/*-------------------- end of XSPICE additions ----------------------*/
|
||||
|
||||
|
||||
#ifdef XSPICE
|
||||
#if defined(__MINGW32__) || defined(HAS_WINDOWS)
|
||||
|
||||
void *dlopen(const char *name,int type)
|
||||
{
|
||||
return LoadLibrary(name);
|
||||
}
|
||||
|
||||
void *dlsym(void *hDll, const char *funcname)
|
||||
{
|
||||
return GetProcAddress(hDll, funcname);
|
||||
}
|
||||
|
||||
char *dlerror(void)
|
||||
{
|
||||
LPVOID lpMsgBuf;
|
||||
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR) &lpMsgBuf,
|
||||
0,
|
||||
NULL
|
||||
);
|
||||
strcpy(errstr,lpMsgBuf);
|
||||
LocalFree(lpMsgBuf);
|
||||
return errstr;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ Georgia Tech Research Corporation
|
|||
Atlanta, Georgia 30332
|
||||
All Rights Reserved
|
||||
|
||||
$Id$
|
||||
|
||||
PROJECT A-8503
|
||||
|
||||
AUTHORS
|
||||
|
|
@ -69,6 +71,8 @@ SUMMARY
|
|||
============================================================================*/
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
|
|
@ -179,7 +183,7 @@ Ipc_Status_t ipc_initialize_server (server_name, m, p)
|
|||
|
||||
num_records = 0;
|
||||
fill_count = 0;
|
||||
|
||||
#ifndef HAS_WINDOWS
|
||||
status = ipc_transport_initialize_server (server_name, m, p,
|
||||
batch_filename);
|
||||
|
||||
|
|
@ -199,6 +203,9 @@ Ipc_Status_t ipc_initialize_server (server_name, m, p)
|
|||
return IPC_STATUS_ERROR;
|
||||
}
|
||||
}
|
||||
#else /* ifdef HAS_WINDOWS */
|
||||
status=IPC_STATUS_OK;
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -215,7 +222,11 @@ Ipc_Status_t ipc_transport_terminate_server ();
|
|||
|
||||
Ipc_Status_t ipc_terminate_server ()
|
||||
{
|
||||
#ifndef HAS_WINDOWS
|
||||
return ipc_transport_terminate_server ();
|
||||
#else /* ifdef HAS_WINDOWS */
|
||||
return 0;
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
@ -261,7 +272,7 @@ Ipc_Status_t ipc_get_line (str, len, wait)
|
|||
{
|
||||
Ipc_Status_t status;
|
||||
Ipc_Boolean_t need_another = IPC_TRUE;
|
||||
|
||||
#ifndef HAS_WINDOWS
|
||||
do {
|
||||
|
||||
status = ipc_transport_get_line (str, len, wait);
|
||||
|
|
@ -366,7 +377,9 @@ Ipc_Status_t ipc_get_line (str, len, wait)
|
|||
break;
|
||||
}
|
||||
} while (need_another);
|
||||
|
||||
#else /* ifndef HAS_WINDOWS */
|
||||
status=IPC_STATUS_OK;
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -410,24 +423,27 @@ Ipc_Status_t ipc_flush ()
|
|||
if( kw_match("#ERRCHK", &out_buffer[last]) ||
|
||||
kw_match(">ENDANAL", &out_buffer[last]) ||
|
||||
kw_match(">ABORTED", &out_buffer[last]) ) {
|
||||
|
||||
#ifndef HAS_WINDOWS
|
||||
status = ipc_transport_send_line (&out_buffer[last],
|
||||
end_of_record_index [i] - last);
|
||||
if (IPC_STATUS_OK != status) {
|
||||
return status;
|
||||
}
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
}
|
||||
last = end_of_record_index [i];
|
||||
}
|
||||
|
||||
/* else, must be interactive mode */
|
||||
} else {
|
||||
#ifndef HAS_WINDOWS
|
||||
/* send the full buffer over the ipc channel */
|
||||
status = ipc_transport_send_line (&out_buffer[0],
|
||||
end_of_record_index [num_records - 1]);
|
||||
if (IPC_STATUS_OK != status) {
|
||||
return status;
|
||||
}
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
}
|
||||
|
||||
/* reset counts to zero and return */
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
Georgia Tech Research Corporation, Atlanta, Georgia 30332
|
||||
All Rights Reserved
|
||||
|
||||
$Id$
|
||||
|
||||
PROJECT ATESSE A-8503
|
||||
|
||||
|
|
@ -90,7 +91,9 @@
|
|||
=============================================================================*/
|
||||
|
||||
|
||||
/*#ifdef IPC_UNIX_SOCKETS */
|
||||
/* #ifdef IPC_UNIX_SOCKETS */
|
||||
#include "config.h"
|
||||
#ifndef HAS_WINDOWS
|
||||
|
||||
/*=== INCLUDE FILES ===*/
|
||||
#include "ngspice.h"
|
||||
|
|
@ -741,4 +744,5 @@ Ipc_Status_t ipc_transport_terminate_server ()
|
|||
return status;
|
||||
}
|
||||
|
||||
/*#endif IPC_UNIX_SOCKETS */
|
||||
/* #endif IPC_UNIX_SOCKETS */
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
|
|
|
|||
Loading…
Reference in New Issue