1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 #if !defined(XP_UNIX) && !defined(XP_OS2)
5 
6 int
7 ffs(unsigned int i)
8 {
9     int rv = 1;
10 
11     if (!i)
12         return 0;
13 
14     while (!(i & 1)) {
15         i >>= 1;
16         ++rv;
17     }
18 
19     return rv;
20 }
21 #endif
22