In hindsight my emscripten-ifdef (70d416a8f63f) is nonsense.
authorsheepluva
Mon, 05 Aug 2019 00:20:45 +0200
changeset 15316 f382ec6dba11
parent 15315 95281174e297
child 15317 b5171e6c94a4
In hindsight my emscripten-ifdef (70d416a8f63f) is nonsense. As fpcrtl_glShaderSource() would not be defined and lead to compiling issues. So either it's 3 ifdefs (in pas2cRedo, pas2cSystem and misc.c), in order to toggle between fpcrtl_ and the native function, or alternatively have no ifdef for it at all. I'm going with none at all, which means emscripten will compile with the original (const) function prototype, being wrapped by the fpcrtl_ function, same as non-emscripten builds.
project_files/hwc/rtl/GL.h
project_files/hwc/rtl/misc.c
--- a/project_files/hwc/rtl/GL.h	Sun Aug 04 01:52:12 2019 +0200
+++ b/project_files/hwc/rtl/GL.h	Mon Aug 05 00:20:45 2019 +0200
@@ -33,5 +33,6 @@
 void glGetShaderiv(GLuint shader, GLenum pname, GLint *params);
 GLuint glCreateShader(GLenum shaderType);
 void glCompileShader(GLuint shader);
-void glShaderSource(GLuint shader, GLsizei count,/* const dropped for pas2c compat */ GLchar **string, const GLint *length);
+//void glShaderSource(GLuint shader, GLsizei count,/* const dropped for pas2c compat */ GLchar **string, const GLint *length);
+void glShaderSource(GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
 #endif
--- a/project_files/hwc/rtl/misc.c	Sun Aug 04 01:52:12 2019 +0200
+++ b/project_files/hwc/rtl/misc.c	Mon Aug 05 00:20:45 2019 +0200
@@ -224,8 +224,8 @@
 {
     return GLEW_OK;
 }
-#else
+#endif
+
 void fpcrtl_glShaderSource(GLuint shader, GLsizei count,/* const dropped for pas2c compat */ GLchar **string, const GLint *length) {
     glShaderSource(shader, count, (const char * const *)string, length);
 }
-#endif