… | |
… | |
192 | as this indicates an incompatible change. Minor versions are usually |
192 | as this indicates an incompatible change. Minor versions are usually |
193 | compatible to older versions, so a larger minor version alone is usually |
193 | compatible to older versions, so a larger minor version alone is usually |
194 | not a problem. |
194 | not a problem. |
195 | |
195 | |
196 | Example: Make sure we haven't accidentally been linked against the wrong |
196 | Example: Make sure we haven't accidentally been linked against the wrong |
197 | version. |
197 | version (note, however, that this will not detect ABI mismatches :). |
198 | |
198 | |
199 | assert (("libev version mismatch", |
199 | assert (("libev version mismatch", |
200 | ev_version_major () == EV_VERSION_MAJOR |
200 | ev_version_major () == EV_VERSION_MAJOR |
201 | && ev_version_minor () >= EV_VERSION_MINOR)); |
201 | && ev_version_minor () >= EV_VERSION_MINOR)); |
202 | |
202 | |
… | |
… | |
1774 | callback (loop, timer, EV_TIMER); |
1774 | callback (loop, timer, EV_TIMER); |
1775 | |
1775 | |
1776 | And when there is some activity, simply store the current time in |
1776 | And when there is some activity, simply store the current time in |
1777 | C<last_activity>, no libev calls at all: |
1777 | C<last_activity>, no libev calls at all: |
1778 | |
1778 | |
1779 | last_actiivty = ev_now (loop); |
1779 | last_activity = ev_now (loop); |
1780 | |
1780 | |
1781 | This technique is slightly more complex, but in most cases where the |
1781 | This technique is slightly more complex, but in most cases where the |
1782 | time-out is unlikely to be triggered, much more efficient. |
1782 | time-out is unlikely to be triggered, much more efficient. |
1783 | |
1783 | |
1784 | Changing the timeout is trivial as well (if it isn't hard-coded in the |
1784 | Changing the timeout is trivial as well (if it isn't hard-coded in the |