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)
66 #define WIN32_LEAN_AND_MEAN
70 dlopen (const char * f
, int ATTRIBUTE_UNUSED flag
)
72 return LoadLibrary (f
);
78 FreeLibrary ((HINSTANCE
) h
);
84 static LPVOID lpMsgBuf
= NULL
;
87 /* free the error message buffer */
91 /* get the error code */
94 /* get the corresponding error message */
96 FORMAT_MESSAGE_ALLOCATE_BUFFER
|
97 FORMAT_MESSAGE_FROM_SYSTEM
|
98 FORMAT_MESSAGE_IGNORE_INSERTS
,
101 MAKELANGID(LANG_NEUTRAL
, SUBLANG_DEFAULT
),
105 return (char *) lpMsgBuf
;
109 dlsym (void *handle
, const char *symbol
)
111 return (void *) GetProcAddress((HMODULE
) handle
, symbol
);