History

Rein in unintended external functions on Windows.

Jean-Claude Beaudoin committed 10 years ago

Commit 889ee281 parent 08335c14 files · +7 −5Browse files

Unified · Split

4 files
  1. libtcc.c +2 −2
  2. tcc.h +1 −1
  3. tccpe.c +2 −0
  4. win32/tools/tiny_impdef.c +2 −2
libtcc.c+2−2
@@ -117,7 +117,7 @@ static void tcc_add_systemdir(TCCState *s) · 116 unmodified lines
117#endif117#endif
118 118
119#ifndef CONFIG_TCC_STATIC119#ifndef CONFIG_TCC_STATIC
120void dlclose(void *p)120static void dlclose(void *p)
121{121{
122 FreeLibrary((HMODULE)p);122 FreeLibrary((HMODULE)p);
123}123}
@@ -135,7 +135,7 @@ BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) · 11 unmodified lines
135 135
136/********************************************************/136/********************************************************/
137/* copy a string and truncate it. */137/* copy a string and truncate it. */
138PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s)138ST_FUNC char *pstrcpy(char *buf, int buf_size, const char *s)
139{139{
140 char *q, *q_end;140 char *q, *q_end;
141 int c;141 int c;
tcc.h+1−1
@@ -1167,7 +1167,7 @@ ST_DATA struct TCCState *tcc_state; · 1166 unmodified lines
1167#define AFF_PREPROCESS 0x0004 /* preprocess file */1167#define AFF_PREPROCESS 0x0004 /* preprocess file */
1168 1168
1169/* public functions currently used by the tcc main function */1169/* public functions currently used by the tcc main function */
1170PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s);1170ST_FUNC char *pstrcpy(char *buf, int buf_size, const char *s);
1171ST_FUNC char *pstrcat(char *buf, int buf_size, const char *s);1171ST_FUNC char *pstrcat(char *buf, int buf_size, const char *s);
1172ST_FUNC char *pstrncpy(char *out, const char *in, size_t num);1172ST_FUNC char *pstrncpy(char *out, const char *in, size_t num);
1173PUB_FUNC char *tcc_basename(const char *name);1173PUB_FUNC char *tcc_basename(const char *name);
tccpe.c+2−0
@@ -58,6 +58,7 @@ · 57 unmodified lines
58 58
59#endif59#endif
60 60
61#if 0
61#ifdef _WIN3262#ifdef _WIN32
62void dbg_printf (const char *fmt, ...)63void dbg_printf (const char *fmt, ...)
63{64{
@@ -70,6 +71,7 @@ void dbg_printf (const char *fmt, ...) · 6 unmodified lines
70 OutputDebugString(buffer);71 OutputDebugString(buffer);
71}72}
72#endif73#endif
74#endif
73 75
74/* ----------------------------------------------------------- */76/* ----------------------------------------------------------- */
75#ifndef IMAGE_NT_SIGNATURE77#ifndef IMAGE_NT_SIGNATURE
win32/tools/tiny_impdef.c+2−2
@@ -28,7 +28,7 @@ · 27 unmodified lines
28#include <io.h>28#include <io.h>
29#include <malloc.h>29#include <malloc.h>
30 30
31char *get_export_names(int fd);31static char *get_export_names(int fd);
32#define tcc_free free32#define tcc_free free
33#define tcc_realloc realloc33#define tcc_realloc realloc
34 34
@@ -169,7 +169,7 @@ int read_mem(int fd, unsigned offset, void *buffer, unsigned len) · 134 unmodified lines
169/* -------------------------------------------------------------- */169/* -------------------------------------------------------------- */
170#endif170#endif
171 171
172char *get_export_names(int fd)172static char *get_export_names(int fd)
173{173{
174 int l, i, n, n0;174 int l, i, n, n0;
175 char *p;175 char *p;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t