2004-05-26 Stefan Jones <stefan.jones@multigig.com>
* src/tclspice.c src/include/ngspice.h src/misc/tilde.c
src/spicelib/devices/dev.c src/xspice/ipc/ipcsockets.c:
Fixup for compiling under mingw
This commit is contained in:
parent
66cf87899f
commit
3b794a57d1
|
|
@ -1,3 +1,9 @@
|
|||
2004-05-26 Stefan Jones <stefan.jones@multigig.com>
|
||||
|
||||
* src/tclspice.c src/include/ngspice.h src/misc/tilde.c
|
||||
src/spicelib/devices/dev.c src/xspice/ipc/ipcsockets.c:
|
||||
Fixup for compiling under mingw
|
||||
|
||||
2004-05-21 Stefan Jones <stefan.jones@multigig.com>
|
||||
|
||||
* src/frontend/terminal.c:
|
||||
|
|
|
|||
|
|
@ -184,3 +184,11 @@ extern int tcl_fprintf(FILE *f, const char *format, ...);
|
|||
#define fprintf tcl_fprintf
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
|
||||
#define sigjmp_buf jmp_buf
|
||||
#define sigsetjmp(a,b) setjmp(a)
|
||||
#define siglongjmp longjmp
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ tildexpand(char *string)
|
|||
#endif
|
||||
}
|
||||
if (result) {
|
||||
#ifdef HAVE_PWD_H
|
||||
strcpy(buf, result);
|
||||
if (*string)
|
||||
strcat(buf, string);
|
||||
|
|
@ -79,9 +78,4 @@ tildexpand(char *string)
|
|||
|
||||
} else
|
||||
return NULL;
|
||||
|
||||
#else
|
||||
/* Emulate the old behavior to prevent side effects. -- ro */
|
||||
return copy(string);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
* ENHANCEMENTS, OR MODIFICATIONS. */
|
||||
|
||||
#include <config.h>
|
||||
#include <ngspice.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <devdefs.h>
|
||||
|
|
@ -39,7 +41,13 @@
|
|||
#ifdef XSPICE
|
||||
/*saj headers for xspice*/
|
||||
#include <string.h> /* for strcpy, strcat*/
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#include <dlfcn.h> /* to load librarys*/
|
||||
#else
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "dllitf.h" /* the coreInfo Structure*/
|
||||
#include "evtudn.h" /*Use defined nodes */
|
||||
|
||||
|
|
@ -346,6 +354,7 @@ int add_udn(int n,Evt_Udn_Info_t **udns){
|
|||
|
||||
extern struct coreInfo_t coreInfo;
|
||||
|
||||
#ifndef __MINGW32__
|
||||
|
||||
int load_opus(char *name){
|
||||
void *lib;
|
||||
|
|
@ -422,5 +431,77 @@ int load_opus(char *name){
|
|||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int load_opus(char *name){
|
||||
void *lib;
|
||||
int *num=NULL;
|
||||
struct coreInfo_t **core;
|
||||
SPICEdev **devs;
|
||||
Evt_Udn_Info_t **udns;
|
||||
void *(*fetch)(void)=NULL;
|
||||
|
||||
lib = LoadLibrary(name);
|
||||
if(!lib){
|
||||
printf("Could not open library %s\n",name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
fetch = GetProcAddress(lib,"CMdevNum");
|
||||
if(fetch){
|
||||
num = (int *)(*fetch)();
|
||||
printf("Got %u devices.\n",*num);
|
||||
fetch = NULL;
|
||||
}else{
|
||||
printf("Could not find symbol CMdevNum\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fetch = GetProcAddress(lib,"CMdevs");
|
||||
if(fetch){
|
||||
devs = (SPICEdev **)(*fetch)();
|
||||
fetch = NULL;
|
||||
}else{
|
||||
printf("Could not find symbol CMdevs\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fetch = GetProcAddress(lib,"CMgetCoreItfPtr");
|
||||
if(fetch){
|
||||
core = (struct coreInfo_t **)(*fetch)();
|
||||
*core = &coreInfo;
|
||||
fetch = NULL;
|
||||
}else{
|
||||
printf("Could not find symbol CMgetCoreItfPtr\n");
|
||||
return 1;
|
||||
}
|
||||
add_device(*num,devs,1);
|
||||
|
||||
fetch = GetProcAddress(lib,"CMudnNum");
|
||||
if(fetch){
|
||||
num = (int *)(*fetch)();
|
||||
printf("Got %u udns.\n",*num);
|
||||
fetch = NULL;
|
||||
}else{
|
||||
printf("Could not find symbol CMudnNum\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fetch = GetProcAddress(lib,"CMudns");
|
||||
if(fetch){
|
||||
udns = (Evt_Udn_Info_t **)(*fetch)();
|
||||
fetch = NULL;
|
||||
}else{
|
||||
printf("Could not find symbol CMudns\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
add_udn(*num,udns);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* MINGW */
|
||||
|
||||
#endif
|
||||
/*-------------------- end of XSPICE additions ----------------------*/
|
||||
|
|
|
|||
|
|
@ -53,6 +53,9 @@
|
|||
|
||||
/* To interupt a spice run */
|
||||
#include <signal.h>
|
||||
#ifndef sighandler_t
|
||||
typedef void (*sighandler_t)(int);
|
||||
#endif
|
||||
#include <setjmp.h>
|
||||
extern sigjmp_buf jbuf;
|
||||
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@
|
|||
|
||||
/*=== INCLUDE FILES ===*/
|
||||
#include "ngspice.h"
|
||||
|
||||
#ifndef __MINGW32__
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
|
@ -741,4 +744,41 @@ Ipc_Status_t ipc_transport_terminate_server ()
|
|||
return status;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include "ipc.h"
|
||||
#include "ipctiein.h"
|
||||
|
||||
Ipc_Status_t ipc_transport_initialize_server (server_name, mode, protocol,
|
||||
batch_filename)
|
||||
char *server_name; /* not used */
|
||||
Ipc_Mode_t mode; /* not used */
|
||||
Ipc_Protocol_t protocol; /* IN - only used in assert */
|
||||
char *batch_filename; /* OUT - returns a value */
|
||||
/* Note that unused parameters are required to maintain compatibility */
|
||||
/* with version 1 (mailboxes) functions of the same names. */
|
||||
{
|
||||
return IPC_STATUS_ERROR;
|
||||
}
|
||||
|
||||
Ipc_Status_t ipc_transport_get_line (str, len, wait)
|
||||
char *str; /* returns the result, null terminated */
|
||||
int *len; /* length of str passed IN and passed OUT */
|
||||
Ipc_Wait_t wait; /* IN - wait or dont wait on incoming msg */
|
||||
{
|
||||
return IPC_STATUS_ERROR;
|
||||
}
|
||||
|
||||
Ipc_Status_t ipc_transport_send_line (str, len)
|
||||
char *str; /* IN - String to write */
|
||||
int len; /* IN - Number of characters out of STR to write */
|
||||
{
|
||||
return IPC_STATUS_ERROR;
|
||||
}
|
||||
|
||||
Ipc_Status_t ipc_transport_terminate_server () {
|
||||
return IPC_STATUS_ERROR;
|
||||
}
|
||||
#endif /* MINGW */
|
||||
|
||||
/*#endif IPC_UNIX_SOCKETS */
|
||||
|
|
|
|||
Loading…
Reference in New Issue