8 * <h1><b>Copyright.</b></h1>\n
10 * PCB, interactive printed circuit board design
12 * Copyright (C) 2004, 2006 Dan McMahill
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37 #ifdef HAVE_LIBDMALLOC
45 return (float) exp ((double) x
);
53 return (float) log ((double) x
);
61 return (long) rand ();
65 #if !defined(HAVE_DLFCN_H) && defined(WIN32)
69 dlopen (const char * f
, int ATTRIBUTE_UNUSED flag
)
71 return LoadLibrary (f
);
77 FreeLibrary ((HINSTANCE
) h
);
83 static LPVOID lpMsgBuf
= NULL
;
86 /* free the error message buffer */
90 /* get the error code */
93 /* get the corresponding error message */
95 FORMAT_MESSAGE_ALLOCATE_BUFFER
|
96 FORMAT_MESSAGE_FROM_SYSTEM
|
97 FORMAT_MESSAGE_IGNORE_INSERTS
,
100 MAKELANGID(LANG_NEUTRAL
, SUBLANG_DEFAULT
),
104 return (char *) lpMsgBuf
;
108 dlsym (void *handle
, const char *symbol
)
110 return (void *) GetProcAddress((HMODULE
) handle
, symbol
);