Bug 1276927: Fix B2G widget code to build with Android NDK, r=fabrice draft
authorThomas Zimmermann <tdz@users.sourceforge.net>
Wed, 15 Jun 2016 09:31:28 +0100
changeset 378339 e9768a34b39f0750b934491770e5568c9479a6d5
parent 378181 14c5bf11d37b9e92d27f7089d9392de2ac339bb3
child 378340 94bb5347ecd055409cf0a8d8fa68e2b693e3d0a5
push id20985
push usertdz@users.sourceforge.net
push dateThu, 16 Jun 2016 07:41:33 +0000
reviewersfabrice
bugs1276927
milestone50.0a1
Bug 1276927: Fix B2G widget code to build with Android NDK, r=fabrice MozReview-Commit-ID: Acewzo0hNEE
widget/gonk/libdisplay/BootAnimation.cpp
--- a/widget/gonk/libdisplay/BootAnimation.cpp
+++ b/widget/gonk/libdisplay/BootAnimation.cpp
@@ -11,16 +11,17 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #include <algorithm>
 #include <endian.h>
 #include <fcntl.h>
+#include <pthread.h>
 #include <string>
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <vector>
 #include "mozilla/FileUtils.h"
 #include "png.h"
 
 #include "android/log.h"
@@ -596,17 +597,17 @@ AnimationThread(void *)
         snprintf(search, sizeof(search), "%s/", part.path);
         while ((entry = reader.GetNextEntry(entry))) {
             string name = reader.GetEntryName(entry);
             if (name.find(search) ||
                 !entry->GetDataSize() ||
                 name.length() >= 256)
                 continue;
 
-            part.frames.push_back();
+            part.frames.resize(part.frames.size() + 1);
             AnimationFrame &frame = part.frames.back();
             strcpy(frame.path, name.c_str());
             frame.file = reader.GetLocalEntry(entry);
         }
 
         sort(part.frames.begin(), part.frames.end());
     }