diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/library.js | 2 | ||||
-rw-r--r-- | src/library_gl.js | 4 | ||||
-rw-r--r-- | src/library_sdl.js | 6 | ||||
-rw-r--r-- | src/parseTools.js | 4 |
4 files changed, 13 insertions, 3 deletions
diff --git a/src/library.js b/src/library.js index 4096ba75..6385507c 100644 --- a/src/library.js +++ b/src/library.js @@ -2177,7 +2177,7 @@ LibraryManager.library = { // ========================================================================== _isFloat: function(text) { - return !!(/^[+]?[0-9]*\.?[0-9]+([eE][+-]?[0-9]+)?$/.exec(text)); + return !!(/^[+-]?[0-9]*\.?[0-9]+([eE][+-]?[0-9]+)?$/.exec(text)); }, // TODO: Document. diff --git a/src/library_gl.js b/src/library_gl.js index 811601ec..84c49d83 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -531,6 +531,7 @@ var LibraryGLUT = { }, glutCreateWindow: function(name) { +#if USE_TYPED_ARRAYS try { var ctx = Module.canvas.getContext('experimental-webgl'); if (!ctx) throw 'Could not create canvas :('; @@ -541,6 +542,9 @@ var LibraryGLUT = { } catch (e) { Module.print('(canvas not available)'); } +#else + Module.print('(USE_TYPED_ARRAYS needs to be enabled for WebGL)'); +#endif }, glutInitDisplayMode: function(mode) {}, diff --git a/src/library_sdl.js b/src/library_sdl.js index 35c619b8..7b413c13 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -173,6 +173,12 @@ mergeInto(LibraryManager.library, { }, createContext: function(useWebGL) { +#if !USE_TYPED_ARRAYS + if (useWebGL) { + Module.print('(USE_TYPED_ARRAYS needs to be enabled for WebGL)'); + return null; + } +#endif try { var ctx = Module.canvas.getContext(useWebGL ? 'experimental-webgl' : '2d'); if (!ctx) throw 'Could not create canvas :('; diff --git a/src/parseTools.js b/src/parseTools.js index e58dad6a..67602687 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -397,7 +397,7 @@ function cleanSegment(segment) { return segment; } -var PARSABLE_LLVM_FUNCTIONS = set('getelementptr', 'bitcast', 'inttoptr', 'ptrtoint', 'mul', 'icmp', 'zext', 'sub', 'add', 'div'); +var PARSABLE_LLVM_FUNCTIONS = set('getelementptr', 'bitcast', 'inttoptr', 'ptrtoint', 'mul', 'icmp', 'zext', 'sub', 'add', 'div', 'or'); // Parses a function call of form // TYPE functionname MODIFIERS (...) @@ -1300,7 +1300,7 @@ function finalizeLLVMFunctionCall(item, noIndexizeFunctions) { // from one file to another, would be enough to fix this), or, do not pass structs by value (which in general // is inefficient, and worth avoiding if you can). } - case 'icmp': case 'mul': case 'zext': case 'add': case 'sub': case 'div': case 'inttoptr': case 'ptrtoint': + case 'icmp': case 'mul': case 'zext': case 'add': case 'sub': case 'div': case 'inttoptr': case 'ptrtoint': case 'or': var temp = { op: item.intertype, variant: item.variant, |