FLTK logo

Re: [fltk/fltk] Add lambdas with captures as callback option. (PR #1597)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Library      Forums      Links      Apps     Login 
[  All Forums  |  Back to fltk.issues  ]
 
[ Previous Message ] [ New Message | Reply ] [ Next Message ]

Re: [fltk/fltk] Add lambdas with captures as callback option. (PR #1597) ManoloFLTK 10:27 Sep 06  
 
ManoloFLTK left a comment (fltk/fltk#1597)

@MatthiasWM I think there's an error in function Fl_Widget::do_callback(). Its first statement

  if (!callback()) return;

should become

  if (!callback() && !callback_is_stdf()) return;

That's because the 2 member variables callback_ and stdf_callback_ are in an union but have distinct sizes, so that the second can be non-null while the first is null. I ommit all details here, but I had an error because of that when trying to replace the instances of FL_INLINE_CALLBACK_# in src/drivers/PostScript/Fl_PostScript.cxx by lambdas. The error occurred under macOS built with FLTK_BACKEND_X11=1 and not under Linux, but it occurred.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/pull/1597/c5560907360@github.com>

[ Direct Link to Message ]
 
     
[ Previous Message ] [ New Message | Reply ] [ Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2026 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.