{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/3208","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/3208/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/3208/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/3208/events","html_url":"https://github.com/kripken/emscripten/issues/3208","id":58517546,"number":3208,"title":"XXX missing C define EMSCRIPTEN_FULLSCREEN_SCALE_CENTER","user":{"login":"lostdj","id":936725,"avatar_url":"https://avatars.githubusercontent.com/u/936725?v=3","gravatar_id":"","url":"https://api.github.com/users/lostdj","html_url":"https://github.com/lostdj","followers_url":"https://api.github.com/users/lostdj/followers","following_url":"https://api.github.com/users/lostdj/following{/other_user}","gists_url":"https://api.github.com/users/lostdj/gists{/gist_id}","starred_url":"https://api.github.com/users/lostdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lostdj/subscriptions","organizations_url":"https://api.github.com/users/lostdj/orgs","repos_url":"https://api.github.com/users/lostdj/repos","events_url":"https://api.github.com/users/lostdj/events{/privacy}","received_events_url":"https://api.github.com/users/lostdj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-22T20:40:57Z","updated_at":"2015-02-24T21:45:57Z","closed_at":"2015-02-24T07:44:02Z","body":"I'm trying to use SDL 2 port. Sorry, can't provide the code triggering this — it's huge.\r\n\r\nLinux x86-64, Emscripten v1.29.10. The SDL 2 is from master, and I build it myself.\r\n\r\n```\r\nwarning: unexpected number of arguments 0 in call to 'SDL_SYS_GetTLSData', should be 1\r\nwarning: unexpected number of arguments 0 in call to 'SDL_SYS_GetTLSData', should be 1\r\nerror: failure to execute js library \"library_html5.js\": XXX missing C define EMSCRIPTEN_FULLSCREEN_SCALE_CENTER!,,\r\npreprocessed source (you can run a js engine on this to get a clearer error message sometimes):\r\n=============\r\n/*******************************************************************************\r\n * EMSCRIPTEN GLEW 1.10.0 emulation\r\n *\r\n * What it does:\r\n * - Stubs init function.\r\n * - GL Extensions support.\r\n *\r\n * Optional:\r\n * - isLinaroFork variable to enable glew-es specific error strings.\r\n *   This is enabled by default, but should be disabled when upstream glew conflicts.\r\n *\r\n * Authors:\r\n * - Jari Vetoniemi <mailroxas@gmail.com>\r\n ******************************************************************************/\r\n\r\nvar LibraryGLEW = {\r\n  $GLEW__deps: ['glGetString'],\r\n  $GLEW: {\r\n    isLinaroFork: 1,\r\n    extensions: null,\r\n\r\n    error: {\r\n      0:null, // GLEW_OK || GLEW_NO_ERROR\r\n      1:null, // GLEW_ERROR_NO_GL_VERSION\r\n      2:null, // GLEW_ERROR_GL_VERSION_10_ONLY\r\n      3:null, // GLEW_ERROR_GLX_VERSION_11_ONLY\r\n\r\n      4:null, // GLEW_ERROR_NOT_GLES_VERSION\r\n      5:null, // GLEW_ERROR_GLES_VERSION\r\n      6:null, // GLEW_ERROR_NO_EGL_VERSION\r\n      7:null, // GLEW_ERROR_EGL_VERSION_10_ONLY\r\n\r\n      8:null, // Unknown error\r\n    },\r\n\r\n    version: {\r\n      1:null, // GLEW_VERSION\r\n      2:null, // GLEW_VERSION_MAJOR\r\n      3:null, // GLEW_VERSION_MINOR\r\n      4:null, // GLEW_VERSION_MICRO\r\n    },\r\n\r\n    errorStringConstantFromCode: function(error) {\r\n      if (GLEW.isLinaroFork) {\r\n        switch (error) {\r\n          case 4:return \"OpenGL ES lib expected, found OpenGL lib\"; // GLEW_ERROR_NOT_GLES_VERSION\r\n          case 5:return \"OpenGL lib expected, found OpenGL ES lib\"; // GLEW_ERROR_GLES_VERSION\r\n          case 6:return \"Missing EGL version\"; // GLEW_ERROR_NO_EGL_VERSION\r\n          case 7:return \"EGL 1.1 and up are supported\"; // GLEW_ERROR_EGL_VERSION_10_ONLY\r\n          default:break;\r\n        }\r\n      }\r\n\r\n      switch (error) {\r\n        case 0:return \"No error\"; // GLEW_OK || GLEW_NO_ERROR\r\n        case 1:return \"Missing GL version\"; // GLEW_ERROR_NO_GL_VERSION\r\n        case 2:return \"GL 1.1 and up are supported\"; // GLEW_ERROR_GL_VERSION_10_ONLY\r\n        case 3:return \"GLX 1.2 and up are supported\"; // GLEW_ERROR_GLX_VERSION_11_ONLY\r\n        default:return null;\r\n      }\r\n    },\r\n\r\n    errorString: function(error) {\r\n      if (!GLEW.error[error]) {\r\n        var string = GLEW.errorStringConstantFromCode(error);\r\n        if (!string) {\r\n          string = \"Unknown error\";\r\n          error = 8; // prevent array from growing more than this\r\n        }\r\n        GLEW.error[error] = allocate(intArrayFromString(string), 'i8', ALLOC_NORMAL);\r\n      }\r\n      return GLEW.error[error];\r\n    },\r\n\r\n    versionStringConstantFromCode: function(name) {\r\n      switch (name) {\r\n        case 1:return \"1.10.0\"; // GLEW_VERSION\r\n        case 2:return \"1\"; // GLEW_VERSION_MAJOR\r\n        case 3:return \"10\"; // GLEW_VERSION_MINOR\r\n        case 4:return \"0\"; // GLEW_VERSION_MICRO\r\n        default:return null;\r\n      }\r\n    },\r\n\r\n    versionString: function(name) {\r\n      if (!GLEW.version[name]) {\r\n        var string = GLEW.versionStringConstantFromCode(name);\r\n        if (!string)\r\n          return 0;\r\n        GLEW.version[name] = allocate(intArrayFromString(string), 'i8', ALLOC_NORMAL);\r\n      }\r\n      return GLEW.version[name];\r\n    },\r\n\r\n    extensionIsSupported: function(name) {\r\n      if (!GLEW.extensions) {\r\n        GLEW.extensions = Pointer_stringify(_glGetString(0x1F03)).split(' ');\r\n      }\r\n\r\n      if (GLEW.extensions.indexOf(name) != -1)\r\n        return 1;\r\n\r\n      // extensions from GLEmulations do not come unprefixed\r\n      // so, try with prefix\r\n      return (GLEW.extensions.indexOf(\"GL_\" + name) != -1);\r\n    },\r\n  },\r\n\r\n  glewInit: function() { return 0; },\r\n\r\n  glewIsSupported: function(name) {\r\n    var exts = Pointer_stringify(name).split(' ');\r\n    for (i in exts) {\r\n      if (!GLEW.extensionIsSupported(exts[i]))\r\n        return 0;\r\n    }\r\n    return 1;\r\n  },\r\n\r\n  glewGetExtension: function(name) {\r\n    return GLEW.extensionIsSupported(Pointer_stringify(name));\r\n  },\r\n\r\n  glewGetErrorString: function(error) {\r\n    return GLEW.errorString(error);\r\n  },\r\n\r\n  glewGetString: function(name) {\r\n    return GLEW.versionString(name);\r\n  },\r\n\r\n};\r\n\r\nautoAddDeps(LibraryGLEW, '$GLEW');\r\nmergeInto(LibraryManager.library, LibraryGLEW);\r\n\r\n\r\n=============\r\n\r\nInternal compiler error in src/compiler.js! Please raise a bug report at https://github.com/kripken/emscripten/issues/ with a log of the build and the input files used to run. Exception message: \"XXX missing C define EMSCRIPTEN_FULLSCREEN_SCALE_CENTER!\" | undefined\r\nTraceback (most recent call last):\r\n  File \"/nix/store/9y8nrgrmn2vvmph6vygvwhyzyy5yslmn-emscripten-1.29.10/bin/emscripten.py\", line 1673, in <module>\r\n    _main(environ=os.environ)\r\n  File \"/nix/store/9y8nrgrmn2vvmph6vygvwhyzyy5yslmn-emscripten-1.29.10/bin/emscripten.py\", line 1661, in _main\r\n    temp_files.run_and_clean(lambda: main(\r\n  File \"/nix/store/9y8nrgrmn2vvmph6vygvwhyzyy5yslmn-emscripten-1.29.10/bin/tools/tempfiles.py\", line 39, in run_and_clean\r\n    return func()\r\n  File \"/nix/store/9y8nrgrmn2vvmph6vygvwhyzyy5yslmn-emscripten-1.29.10/bin/emscripten.py\", line 1669, in <lambda>\r\n    DEBUG_CACHE=DEBUG_CACHE,\r\n  File \"/nix/store/9y8nrgrmn2vvmph6vygvwhyzyy5yslmn-emscripten-1.29.10/bin/emscripten.py\", line 1556, in main\r\n    jcache=jcache, temp_files=temp_files, DEBUG=DEBUG, DEBUG_CACHE=DEBUG_CACHE)\r\n  File \"/nix/store/9y8nrgrmn2vvmph6vygvwhyzyy5yslmn-emscripten-1.29.10/bin/emscripten.py\", line 891, in emscript_fast\r\n    cwd=path_from_root('src'), error_limit=300)\r\n  File \"/nix/store/9y8nrgrmn2vvmph6vygvwhyzyy5yslmn-emscripten-1.29.10/bin/tools/jsrun.py\", line 63, in run_js\r\n    raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])\r\nException: Expected the command ['/nix/store/8vnhq3w7kysmcgvamsqcv3j1pxfgkffq-nodejs-0.10.32/bin/node', '/nix/store/9y8nrgrmn2vvmph6vygvwhyzyy5yslmn-emscripten-1.29.10/bin/src/compiler.js', '/tmp/tmpigDsqj.txt', ';', 'glue'] to finish with return code 0, but it returned with code 1 instead! Output: // The Module object: Our interface to the outside world. We import\r\n// and export values on it, and do the work to get that through\r\n// closure compiler if necessary. There are various ways Module can be used:\r\n// 1. Not defined. We create it here\r\n// 2. A function parameter, function(Module) { ..gener\r\nTraceback (most recent call last):\r\n  File \"/nix/store/9y8nrgrmn2vvmph6vygvwhyzyy5yslmn-emscripten-1.29.10/bin/emcc\", line 1319, in <module>\r\n    final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)\r\n  File \"/nix/store/9y8nrgrmn2vvmph6vygvwhyzyy5yslmn-emscripten-1.29.10/bin/tools/shared.py\", line 1522, in emscripten\r\n    assert os.path.exists(filename + '.o.js'), 'Emscripten failed to generate .js'\r\nAssertionError: Emscripten failed to generate .js\r\n```\r\n\r\nRan a search for `EMSCRIPTEN_FULLSCREEN_SCALE_CENTER`:\r\n```\r\nsrc/library_html5.js:\r\n  607        var windowedRttHeight = target.height;\r\n  608  \r\n  609:       if (strategy.scaleMode == {{{ cDefine('EMSCRIPTEN_FULLSCREEN_SCALE_CENTER') }}}) {\r\n  610          __setLetterbox(target, (cssHeight - windowedCssHeight) / 2, (cssWidth - windowedCssWidth) / 2);\r\n  611          cssWidth = windowedCssWidth;\r\n\r\n 1344      var inAspectRatioFixedFullscreenMode = __currentFullscreenStrategy.scaleMode == {{{ cDefine('EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT') }}};\r\n 1345      var inPixelPerfectFullscreenMode = __currentFullscreenStrategy.canvasResolutionScaleMode != {{{ cDefine('EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE') }}};\r\n 1346:     var inCenteredWithoutScalingFullscreenMode = __currentFullscreenStrategy.scaleMode == {{{ cDefine('EMSCRIPTEN_FULLSCREEN_SCALE_CENTER') }}};\r\n 1347      var screenWidth = inHiDPIFullscreenMode ? Math.round(window.innerWidth*window.devicePixelRatio) : window.innerWidth;\r\n 1348      var screenHeight = inHiDPIFullscreenMode ? Math.round(window.innerHeight*window.devicePixelRatio) : window.innerHeight;\r\n\r\n\r\nsrc/struct_info.json:\r\n 1172              \"EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH\",\r\n 1173              \"EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT\",\r\n 1174:             \"EMSCRIPTEN_FULLSCREEN_SCALE_CENTER\",\r\n 1175              \"EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE\",\r\n 1176              \"EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF\",\r\n\r\n\r\nsystem/include/emscripten/html5.h:\r\n  250  #define EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH 1\r\n  251  #define EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT  2\r\n  252: #define EMSCRIPTEN_FULLSCREEN_SCALE_CENTER  3\r\n  253  \r\n  254  #define EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE int\r\n\r\n\r\ntests/test_html5_fullscreen.c:\r\n  161      case 5: requestFullscreen(EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH, EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE, EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT); break;\r\n  162      case 6: requestFullscreen(EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT, EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE, EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT); break;\r\n  163:     case 7: requestFullscreen(EMSCRIPTEN_FULLSCREEN_SCALE_CENTER, EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE, EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT); break;\r\n  164  \r\n  165      case 8: enterSoftFullscreen(EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH, EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF, EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT); break;\r\n  ...\r\n  169      case 12: enterSoftFullscreen(EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH, EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE, EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT); break;\r\n  170      case 13: enterSoftFullscreen(EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT, EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE, EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT); break;\r\n  171:     case 14: enterSoftFullscreen(EMSCRIPTEN_FULLSCREEN_SCALE_CENTER, EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE, EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT); break;\r\n  172  \r\n  173      case 15: requestFullscreen(EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT, EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE, EMSCRIPTEN_FULLSCREEN_FILTERING_NEAREST); break;\r\n```\r\n\r\nAnd in SDL 2: nothing."},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/75853252","html_url":"https://github.com/kripken/emscripten/issues/3208#issuecomment-75853252","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/3208","id":75853252,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T21:45:57Z","updated_at":"2015-02-24T21:45:57Z","body":"We do check the version number and clear the cache, but we don't do it  with the ports directory. If something went wrong there, like a reboot in the middle of building a port, it's possible it was left in an inconsistent state.\r\n\r\nThe source mapper exception might be one of the open source mapping bugs, no one seems to have much time to work on debug info. That should only happen though on `-g4` builds?\r\n\r\n- Alon\r\n\r\n"}}