]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
charon-nm: Use CALLBACK macro for callback job's cancel implementation
authorTobias Brunner <tobias@strongswan.org>
Fri, 21 Feb 2025 15:47:34 +0000 (16:47 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 19 Mar 2025 09:22:37 +0000 (10:22 +0100)
Casting to this specific function type doesn't work anymore if C23 is
used as the types mismatch.

src/charon-nm/nm/nm_backend.c

index aefd3f9568876d6a9a9956248ee35c6c1c506f49..8ee1785212e6e1dee1bd0fa4839bb4333c7d65ff 100644 (file)
@@ -78,7 +78,8 @@ static job_requeue_t run(nm_backend_t *this)
 /**
  * Cancel the GLib Main Event Loop
  */
-static bool cancel(nm_backend_t *this)
+CALLBACK(cancel, bool,
+       nm_backend_t *this)
 {
        if (this->loop)
        {
@@ -152,7 +153,7 @@ static bool nm_backend_init()
 
        lib->processor->queue_job(lib->processor,
                (job_t*)callback_job_create_with_prio((callback_job_cb_t)run, this,
-                               NULL, (callback_job_cancel_t)cancel, JOB_PRIO_CRITICAL));
+                               NULL, cancel, JOB_PRIO_CRITICAL));
        return TRUE;
 }