mirror of
https://github.com/frida/tinycc
synced 2024-12-24 22:16:49 +03:00
Rein in unintended external functions on Windows.
This commit is contained in:
parent
08335c1548
commit
889ee28ed5
4
libtcc.c
4
libtcc.c
@ -117,7 +117,7 @@ static void tcc_add_systemdir(TCCState *s)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_TCC_STATIC
|
#ifndef CONFIG_TCC_STATIC
|
||||||
void dlclose(void *p)
|
static void dlclose(void *p)
|
||||||
{
|
{
|
||||||
FreeLibrary((HMODULE)p);
|
FreeLibrary((HMODULE)p);
|
||||||
}
|
}
|
||||||
@ -135,7 +135,7 @@ BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||||||
|
|
||||||
/********************************************************/
|
/********************************************************/
|
||||||
/* copy a string and truncate it. */
|
/* copy a string and truncate it. */
|
||||||
PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s)
|
ST_FUNC char *pstrcpy(char *buf, int buf_size, const char *s)
|
||||||
{
|
{
|
||||||
char *q, *q_end;
|
char *q, *q_end;
|
||||||
int c;
|
int c;
|
||||||
|
2
tcc.h
2
tcc.h
@ -1167,7 +1167,7 @@ ST_DATA struct TCCState *tcc_state;
|
|||||||
#define AFF_PREPROCESS 0x0004 /* preprocess file */
|
#define AFF_PREPROCESS 0x0004 /* preprocess file */
|
||||||
|
|
||||||
/* public functions currently used by the tcc main function */
|
/* public functions currently used by the tcc main function */
|
||||||
PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s);
|
ST_FUNC char *pstrcpy(char *buf, int buf_size, const char *s);
|
||||||
ST_FUNC char *pstrcat(char *buf, int buf_size, const char *s);
|
ST_FUNC char *pstrcat(char *buf, int buf_size, const char *s);
|
||||||
ST_FUNC char *pstrncpy(char *out, const char *in, size_t num);
|
ST_FUNC char *pstrncpy(char *out, const char *in, size_t num);
|
||||||
PUB_FUNC char *tcc_basename(const char *name);
|
PUB_FUNC char *tcc_basename(const char *name);
|
||||||
|
2
tccpe.c
2
tccpe.c
@ -58,6 +58,7 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
void dbg_printf (const char *fmt, ...)
|
void dbg_printf (const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -70,6 +71,7 @@ void dbg_printf (const char *fmt, ...)
|
|||||||
OutputDebugString(buffer);
|
OutputDebugString(buffer);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ----------------------------------------------------------- */
|
/* ----------------------------------------------------------- */
|
||||||
#ifndef IMAGE_NT_SIGNATURE
|
#ifndef IMAGE_NT_SIGNATURE
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
char *get_export_names(int fd);
|
static char *get_export_names(int fd);
|
||||||
#define tcc_free free
|
#define tcc_free free
|
||||||
#define tcc_realloc realloc
|
#define tcc_realloc realloc
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ int read_mem(int fd, unsigned offset, void *buffer, unsigned len)
|
|||||||
/* -------------------------------------------------------------- */
|
/* -------------------------------------------------------------- */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *get_export_names(int fd)
|
static char *get_export_names(int fd)
|
||||||
{
|
{
|
||||||
int l, i, n, n0;
|
int l, i, n, n0;
|
||||||
char *p;
|
char *p;
|
||||||
|
Loading…
Reference in New Issue
Block a user