get_current_selection should return char* not const char*

This commit is contained in:
Kovid Goyal
2022-08-09 09:05:13 +05:30
parent e9823eb40c
commit 5bba1a0851
4 changed files with 5 additions and 5 deletions

View File

@@ -1560,7 +1560,7 @@ void _glfwPlatformUpdateIMEState(_GLFWwindow *w, const GLFWIMEUpdateEvent *ev) {
{
NSString *text = nil;
if (_glfw.callbacks.get_current_selection) {
const char *s = _glfw.callbacks.get_current_selection();
char *s = _glfw.callbacks.get_current_selection();
if (s) {
text = [NSString stringWithUTF8String:s];
free(s);

2
glfw/glfw3.h vendored
View File

@@ -1716,7 +1716,7 @@ typedef void (* GLFWjoystickfun)(int,int);
typedef void (* GLFWuserdatafun)(unsigned long long, void*);
typedef void (* GLFWtickcallback)(void*);
typedef bool (* GLFWdrawtextfun)(GLFWwindow *window, const char *text, uint32_t fg, uint32_t bg, uint8_t *output_buf, size_t width, size_t height, float x_offset, float y_offset, size_t right_margin);
typedef const char* (* GLFWcurrentselectionfun)(void);
typedef char* (* GLFWcurrentselectionfun)(void);
/*! @brief Video mode type.
*