aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library.js4
-rw-r--r--src/library_gl.js7
-rw-r--r--src/utility.js6
3 files changed, 14 insertions, 3 deletions
diff --git a/src/library.js b/src/library.js
index 201a63e0..0e4ac0b2 100644
--- a/src/library.js
+++ b/src/library.js
@@ -8590,7 +8590,7 @@ LibraryManager.library = {
inet_pton__deps: ['__setErrNo', '$ERRNO_CODES', 'inet_addr'],
inet_pton: function(af, src, dst) {
// int af, const char *src, void *dst
- if ((af ^ {{{ cDefine("AF_INET") }}}) !== 0) { ___setErrNo(ERRNO_CODES.EAFNOSUPPORT); return -1; }
+ if ((af ^ {{{ cDefine('AF_INET') }}}) !== 0) { ___setErrNo(ERRNO_CODES.EAFNOSUPPORT); return -1; }
var ret = _inet_addr(src);
if (ret == -1 || isNaN(ret)) return 0;
setValue(dst, ret, 'i32');
@@ -8678,7 +8678,7 @@ LibraryManager.library = {
var aliasesBuf = _malloc(4);
setValue(aliasesBuf, 0, 'i8*');
setValue(ret+___hostent_struct_layout.h_aliases, aliasesBuf, 'i8**');
- setValue(ret+___hostent_struct_layout.h_addrtype, {{{ cDefine("AF_INET") }}}, 'i32');
+ setValue(ret+___hostent_struct_layout.h_addrtype, {{{ cDefine('AF_INET') }}}, 'i32');
setValue(ret+___hostent_struct_layout.h_length, 4, 'i32');
var addrListBuf = _malloc(12);
setValue(addrListBuf, addrListBuf+8, 'i32*');
diff --git a/src/library_gl.js b/src/library_gl.js
index d0f1a692..8c724245 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -636,6 +636,11 @@ var LibraryGL = {
for (var i = 0; i < n; i++) {
var id = {{{ makeGetValue('buffers', 'i*4', 'i32') }}};
var buffer = GL.buffers[id];
+
+ // From spec: "glDeleteBuffers silently ignores 0's and names that do not
+ // correspond to existing buffer objects."
+ if (!buffer) continue;
+
Module.ctx.deleteBuffer(buffer);
buffer.name = 0;
GL.buffers[id] = null;
@@ -1318,7 +1323,7 @@ var LibraryGL = {
GLEmulation.fogColor = new Float32Array(4);
// Add some emulation workarounds
- Module.printErr('WARNING: using emscripten GL emulation. This is a collection of limited workarounds, do not expect it to work');
+ Module.printErr('WARNING: using emscripten GL emulation. This is a collection of limited workarounds, do not expect it to work. (If you do not want this, build with -s DISABLE_GL_EMULATION=1)');
#if GL_UNSAFE_OPTS == 0
Module.printErr('WARNING: using emscripten GL emulation unsafe opts. If weirdness happens, try -s GL_UNSAFE_OPTS=0');
#endif
diff --git a/src/utility.js b/src/utility.js
index 9cc8d3a3..7d122cef 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -312,6 +312,12 @@ function setUnion(x, y) {
return ret;
}
+function setSize(x) {
+ var ret = 0;
+ for (var xx in x) ret++;
+ return ret;
+}
+
function invertArray(x) {
var ret = {};
for (var i = 0; i < x.length; i++) {