8000 Export Win32 console functions · php/php-src@2f05643 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2f05643

Browse files
committed
Export Win32 console functions
1 parent d9b1c99 commit 2f05643

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

win32/console.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "win32/console.h"
2222

23-
BOOL php_win32_console_os_supports_vt100()
23+
PHP_WINUTIL_API BOOL php_win32_console_os_supports_vt100()
2424
{
2525
const DWORD MINV_MAJOR = 10, MINV_MINOR = 0, MINV_BUILD = 10586;
2626
OSVERSIONINFOEX osvi = EG(windows_version_info);
@@ -53,7 +53,7 @@ BOOL php_win32_console_os_supports_vt100()
5353

5454
}
5555

56-
BOOL php_win32_console_handle_is_redirected(DWORD handle_id)
56+
PHP_WINUTIL_API BOOL php_win32_console_handle_is_redirected(DWORD handle_id)
5757
{
5858
BOOL result = FALSE;
5959
HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE;
@@ -66,7 +66,7 @@ BOOL php_win32_console_handle_is_redirected(DWORD handle_id)
6666
return result;
6767
}
6868

69-
BOOL php_win32_console_handle_has_vt100(DWORD handle_id)
69+
PHP_WINUTIL_API BOOL php_win32_console_handle_has_vt100(DWORD handle_id)
7070
{
7171
BOOL result = FALSE;
7272
HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE;
@@ -83,7 +83,7 @@ BOOL php_win32_console_handle_has_vt100(DWORD handle_id)
8383
return result;
8484
}
8585

86-
BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable)
86+
PHP_WINUTIL_API BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable)
8787
{
8888
BOOL result = FALSE;
8989
HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE;

win32/console.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
#ifndef PHP_WIN32_CONSOLE_H
2222
#define PHP_WIN32_CONSOLE_H
2323

24+
#ifndef PHP_WINUTIL_API
25+
#ifdef PHP_EXPORTS
26+
# define PHP_WINUTIL_API __declspec(dllexport)
27+
#else
28+
# define PHP_WINUTIL_API __declspec(dllimport)
29+
#endif
30+
#endif
31+
2432
#include "php.h"
2533
#include "php_streams.h"
2634
#include <windows.h>
@@ -30,20 +38,20 @@
3038
#endif
3139

3240
/* Check if the current Windows version supports VT100 control codes */
33-
BOOL php_win32_console_os_supports_vt100();
41+
PHP_WINUTIL_API BOOL php_win32_console_os_supports_vt100();
3442

3543
/* Check if the standard handle (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE)
3644
is redirected to a file */
37-
BOOL php_win32_console_handle_is_redirected(DWORD handle_id);
45+
PHP_WINUTIL_API BOOL php_win32_console_handle_is_redirected(DWORD handle_id);
3846

3947
/* Check if the console attached to the specified standard handle
4048
(STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) has the
4149
ENABLE_VIRTUAL_TERMINAL_PROCESSING flag set */
42-
BOOL php_win32_console_handle_has_vt100(DWORD handle_id);
50+
PHP_WINUTIL_API BOOL php_win32_console_handle_has_vt100(DWORD handle_id);
4351

4452
/* Set/unset the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for the console
4553
attached to the specified standard handle (STD_OUTPUT_HANDLE,
4654
STD_ERROR_HANDLE) */
47-
BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable);
55+
PHP_WINUTIL_API BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable);
4856

4957
#endif

0 commit comments

Comments
 (0)
0