Skip to content

Commit 865d540

Browse files
committed
xrCore: hidden under define functions of clipboard
1 parent d7447ef commit 865d540

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/xrCore/os_clipboard.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
void os_clipboard::copy_to_clipboard(LPCSTR buf)
1414
{
15+
#if defined(WINDOWS)
1516
if (!OpenClipboard(0))
1617
return;
1718
u32 handle_size = (xr_strlen(buf) + 1) * sizeof(char);
@@ -28,13 +29,14 @@ void os_clipboard::copy_to_clipboard(LPCSTR buf)
2829
EmptyClipboard();
2930
SetClipboardData(CF_TEXT, handle);
3031
CloseClipboard();
32+
#endif
3133
}
3234

3335
void os_clipboard::paste_from_clipboard(LPSTR buffer, u32 const& buffer_size)
3436
{
3537
VERIFY(buffer);
3638
VERIFY(buffer_size > 0);
37-
39+
#if defined(WINDOWS)
3840
if (!OpenClipboard(0))
3941
return;
4042

@@ -56,10 +58,12 @@ void os_clipboard::paste_from_clipboard(LPSTR buffer, u32 const& buffer_size)
5658

5759
GlobalUnlock(hmem);
5860
CloseClipboard();
61+
#endif
5962
}
6063

6164
void os_clipboard::update_clipboard(LPCSTR string)
6265
{
66+
#if defined(WINDOWS)
6367
if (!OpenClipboard(0))
6468
return;
6569

@@ -89,4 +93,5 @@ void os_clipboard::update_clipboard(LPCSTR string)
8993
#ifdef _EDITOR
9094
xr_free(buffer);
9195
#endif // #ifdef _EDITOR
96+
#endif
9297
}

0 commit comments

Comments
 (0)