Bug 1276927: Fix B2G widget code to build with Android NDK, r=fabrice
MozReview-Commit-ID: Acewzo0hNEE
--- 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());
}