diff --git a/basis/opengl/gl/extensions/extensions-tests.factor b/basis/opengl/gl/extensions/extensions-tests.factor new file mode 100644 index 0000000000..4e87d9da86 --- /dev/null +++ b/basis/opengl/gl/extensions/extensions-tests.factor @@ -0,0 +1,7 @@ +USING: alien kernel opengl.gl.extensions system tools.test ; +IN: opengl.gl.extensions.tests + +{ t } [ + gl-function-calling-convention + os windows? [ stdcall ] [ cdecl ] if = +] unit-test diff --git a/basis/opengl/gl/extensions/extensions.factor b/basis/opengl/gl/extensions/extensions.factor index 7944ed1455..4fbf78bac2 100644 --- a/basis/opengl/gl/extensions/extensions.factor +++ b/basis/opengl/gl/extensions/extensions.factor @@ -46,6 +46,9 @@ reset-gl-function-number-counter names return function-effect define-declared ; +: gl-function-calling-convention ( -- symbol ) + os windows? [ stdcall ] [ cdecl ] if ; + SYNTAX: GL-FUNCTION: gl-function-calling-convention scan-function-name diff --git a/basis/opengl/gl/gtk/gtk.factor b/basis/opengl/gl/gtk/gtk.factor index c5fbdeebb3..850f60edc4 100644 --- a/basis/opengl/gl/gtk/gtk.factor +++ b/basis/opengl/gl/gtk/gtk.factor @@ -9,5 +9,3 @@ IN: opengl.gl.gtk : gl-function-address ( name -- address ) ascii string>alien gdk_gl_get_proc_address ; inline - -: gl-function-calling-convention ( -- str ) cdecl ; inline diff --git a/basis/opengl/gl/macosx/macosx.factor b/basis/opengl/gl/macosx/macosx.factor index aeaa5da4eb..56696c6bac 100644 --- a/basis/opengl/gl/macosx/macosx.factor +++ b/basis/opengl/gl/macosx/macosx.factor @@ -3,4 +3,3 @@ IN: opengl.gl.macosx : gl-function-context ( -- context ) 0 ; inline : gl-function-address ( name -- address ) f dlsym ; inline -: gl-function-calling-convention ( -- str ) cdecl ; inline diff --git a/basis/opengl/gl/windows/windows.factor b/basis/opengl/gl/windows/windows.factor index ba3f102652..f27d20815d 100644 --- a/basis/opengl/gl/windows/windows.factor +++ b/basis/opengl/gl/windows/windows.factor @@ -8,4 +8,3 @@ FUNCTION: void* wglGetProcAddress ( c-string name ) : gl-function-context ( -- context ) wglGetCurrentContext ; inline : gl-function-address ( name -- address ) wglGetProcAddress ; inline -: gl-function-calling-convention ( -- str ) stdcall ; inline diff --git a/basis/opengl/gl/x11/x11.factor b/basis/opengl/gl/x11/x11.factor index 2d752757bb..f96cc9901a 100644 --- a/basis/opengl/gl/x11/x11.factor +++ b/basis/opengl/gl/x11/x11.factor @@ -3,4 +3,3 @@ IN: opengl.gl.x11 : gl-function-context ( -- context ) glXGetCurrentContext ; inline : gl-function-address ( name -- address ) glXGetProcAddressARB ; inline -: gl-function-calling-convention ( -- str ) cdecl ; inline