<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>Hi Pierre,</p>
<p>On 2016-11-28 23:56, vlc-devel wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> From: Pierre Ynard <linkfanel@yahoo.fr>
 To: vlc-devel@videolan.org</code></pre>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> Using `sizeof` is not really what you want, you should compare the
 *max*/*min* value of the two types in order to properly check if the
 value will fit.</code></pre>
</blockquote>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code>     #if LUA_MININTEGER > INT64_MIN || LUA_MAXINTEGER < INT64_MAX
         if( val.i_int < LUA_MININTEGER || val.i_int > LUA_MAXINTEGER )</code></pre>
</blockquote>
<pre><code> Lua provides no such macro or anything workable. As I said it would have
 to be added with autoconf, but in my opinion that's not worth it.</code></pre>
</blockquote>
<p>The above is not entirely true, but you are correct in that it is not guaranteed to work for <em>VLC</em> (since we do not require <code>lua >= 5.3</code>).</p>
<p>Lua <code>5.3</code> defines <code>LUA_MININTEGER</code> and <code>LUA_MAXINTEGER</code>, and I honestly assumed that it had been around longer than <code>5.3</code> (but this, as you imply, is not the case).</p>
<ul>
<li>https://www.lua.org/manual/5.3/manual.html#pdf-LUA_MININTEGER</li>
<li>https://www.lua.org/manual/5.3/manual.html#pdf-LUA_MAXINTEGER</li>
</ul>
<p>There are <em>hacks</em> (with heavy emphasize on the usage of “hack”) that would allow for a middle-ground for what you and I want even for lua <code>5.1</code>: though I will refrain from replying until I have explored some other alternatives.</p>
<p>I will try to come up with something that is not <em>too</em> bad during the next few hours.</p>
<p>Best Regards,<br />
Filip Roséen</p>
</body>
</html>