<p></p>
<p><b>@b4n</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/2602#discussion_r516258359">src/plugindata.h</a>:</p>
<pre style='color:#555'>> @@ -60,9 +60,9 @@ G_BEGIN_DECLS
  */
 #define GEANY_API_VERSION 239
 
-
-/* when gtk2 and gtk3 were both supported at the same time this was used
- * to prevent loading gtk2 plugins with gtk3 Geany or vice versa. */
+/* hack to have a different ABI when built with different GTK major versions
+ * because loading plugins linked to a different one leads to crashes.
+ * Only GTK3 is currently supported. */
</pre>
<p>Yeah maybe we could promote that as non-hack.  For other GTK versions, it's just a matter of shifting by an additional 8 or so.  That could be something like this:</p>
<div class="highlight highlight-source-c"><pre>#<span class="pl-k">define</span> <span class="pl-en">GEANY_ABI_SHIFT</span> (<span class="pl-c1">8</span> * (GTK_MAJOR_VERSION - <span class="pl-c1">2</span>))</pre></div>
<p>Though, I figure the shift was kind of misguided, because it doesn't make much sense to actually shift, we could just offset, and we'd loose a whole lot less values.</p>
<p>Maybe we could change this to something like this instead:</p>
<div class="highlight highlight-source-c"><pre><span class="pl-c"><span class="pl-c">/*</span> 18360 is (72<<8) which was the actual value of the ABI while it used</span>
<span class="pl-c"> * shifting, minus 72 that is still added as the base ABI version. This</span>
<span class="pl-c"> * was with GTK3; with each newer version we move the offset by an</span>
<span class="pl-c"> * additional 1024 of available ABI range <span class="pl-c">*/</span></span>
#<span class="pl-k">define</span> <span class="pl-en">GEANY_ABI_OFFSET</span> (<span class="pl-c1">18360</span> + <span class="pl-c1">1024</span> * (GTK_MAJOR_VERSION - <span class="pl-c1">3</span>))
#<span class="pl-k">define</span> <span class="pl-en">GEANY_ABI_VERSION</span> (<span class="pl-c1">72</span> + GEANY_ABI_OFFSET)</pre></div>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/2602#discussion_r516258359">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ45WDJMN2Y7YPFYOEDSN4OSTANCNFSM4R7XJSAA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAIOWJ5DTPLLQJUKQDOMQMDSN4OSTA5CNFSM4R7XJSAKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOD4OQ4AQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/2602#discussion_r516258359",
"url": "https://github.com/geany/geany/pull/2602#discussion_r516258359",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>