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
117117 #endif
118118
119119 #ifndef CONFIG_TCC_STATIC
120−void dlclose(void *p)
120+static void dlclose(void *p)
121121 {
122122 FreeLibrary((HMODULE)p);
123123 }
@@ -135,7 +135,7 @@ BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) · 11 unmodified lines
135135
136136 /********************************************************/
137137 /* copy a string and truncate it. */
138−PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s)
138+ST_FUNC char *pstrcpy(char *buf, int buf_size, const char *s)
139139 {
140140 char *q, *q_end;
141141 int c;
tcc.h+1−1
@@ -1167,7 +1167,7 @@ ST_DATA struct TCCState *tcc_state; · 1166 unmodified lines
11671167 #define AFF_PREPROCESS 0x0004 /* preprocess file */
11681168
11691169 /* public functions currently used by the tcc main function */
1170−PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s);
1170+ST_FUNC char *pstrcpy(char *buf, int buf_size, const char *s);
11711171 ST_FUNC char *pstrcat(char *buf, int buf_size, const char *s);
11721172 ST_FUNC char *pstrncpy(char *out, const char *in, size_t num);
11731173 PUB_FUNC char *tcc_basename(const char *name);
tccpe.c+2−0
@@ -58,6 +58,7 @@ · 57 unmodified lines
5858
5959 #endif
6060
61+#if 0
6162 #ifdef _WIN32
6263 void dbg_printf (const char *fmt, ...)
6364 {
@@ -70,6 +71,7 @@ void dbg_printf (const char *fmt, ...) · 6 unmodified lines
7071 OutputDebugString(buffer);
7172 }
7273 #endif
74+#endif
7375
7476 /* ----------------------------------------------------------- */
7577 #ifndef IMAGE_NT_SIGNATURE
win32/tools/tiny_impdef.c+2−2
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #include <io.h>
2929 #include <malloc.h>
3030
31−char *get_export_names(int fd);
31+static char *get_export_names(int fd);
3232 #define tcc_free free
3333 #define tcc_realloc realloc
3434
@@ -169,7 +169,7 @@ int read_mem(int fd, unsigned offset, void *buffer, unsigned len) · 134 unmodified lines
169169 /* -------------------------------------------------------------- */
170170 #endif
171171
172−char *get_export_names(int fd)
172+static char *get_export_names(int fd)
173173 {
174174 int l, i, n, n0;
175175 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