aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Claude Beaudoin <jean.claude.beaudoin@gmail.com>2016-09-27 01:43:40 -0400
committerJean-Claude Beaudoin <jean.claude.beaudoin@gmail.com>2016-09-27 01:43:40 -0400
commit889ee28ed562af4344cba27f17076c88ec099c74 (patch)
treeff11a61c7bd3bb1b7e0eb10ed7b17f0e8427369d
parent08335c1548c015ccbdaebcd3dae27d94a48d182a (diff)
downloadtinycc-889ee28ed562af4344cba27f17076c88ec099c74.tar.gz
tinycc-889ee28ed562af4344cba27f17076c88ec099c74.tar.bz2
Rein in unintended external functions on Windows.
-rw-r--r--libtcc.c4
-rw-r--r--tcc.h2
-rw-r--r--tccpe.c2
-rw-r--r--win32/tools/tiny_impdef.c4
4 files changed, 7 insertions, 5 deletions
diff --git a/libtcc.c b/libtcc.c
index d367ed1..827d3c0 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -117,7 +117,7 @@ static void tcc_add_systemdir(TCCState *s)
#endif
#ifndef CONFIG_TCC_STATIC
-void dlclose(void *p)
+static void dlclose(void *p)
{
FreeLibrary((HMODULE)p);
}
@@ -135,7 +135,7 @@ BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved)
/********************************************************/
/* 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;
int c;
diff --git a/tcc.h b/tcc.h
index 74a4c20..20846a3 100644
--- a/tcc.h
+++ b/tcc.h
@@ -1167,7 +1167,7 @@ ST_DATA struct TCCState *tcc_state;
#define AFF_PREPROCESS 0x0004 /* preprocess file */
/* 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 *pstrncpy(char *out, const char *in, size_t num);
PUB_FUNC char *tcc_basename(const char *name);
diff --git a/tccpe.c b/tccpe.c
index 2484e4f..4069e51 100644
--- a/tccpe.c
+++ b/tccpe.c
@@ -58,6 +58,7 @@
#endif
+#if 0
#ifdef _WIN32
void dbg_printf (const char *fmt, ...)
{
@@ -70,6 +71,7 @@ void dbg_printf (const char *fmt, ...)
OutputDebugString(buffer);
}
#endif
+#endif
/* ----------------------------------------------------------- */
#ifndef IMAGE_NT_SIGNATURE
diff --git a/win32/tools/tiny_impdef.c b/win32/tools/tiny_impdef.c
index 48de44f..b6debe6 100644
--- a/win32/tools/tiny_impdef.c
+++ b/win32/tools/tiny_impdef.c
@@ -28,7 +28,7 @@
#include <io.h>
#include <malloc.h>
-char *get_export_names(int fd);
+static char *get_export_names(int fd);
#define tcc_free free
#define tcc_realloc realloc
@@ -169,7 +169,7 @@ int read_mem(int fd, unsigned offset, void *buffer, unsigned len)
/* -------------------------------------------------------------- */
#endif
-char *get_export_names(int fd)
+static char *get_export_names(int fd)
{
int l, i, n, n0;
char *p;