Commit bc69c6249e604fae8b86a0844282b82a025e4b22

Authored by dg
1 parent 352c72f8

removed luajit1 support

upgraded some C libs
cleanup some C code
update osx compile


git-svn-id: http://svn.net-core.org/repos/t-engine4@6578 51575b47-30f0-44d4-a5cc-537603b46e54

Too many changes to show.

To preserve performance only 49 of 49+ files are displayed.

... ... @@ -26,7 +26,6 @@ newoption {
26 26 description = "Virtual Machine to use for Lua, either the default one or a JIT",
27 27 allowed = {
28 28 { "default", "Default Lua Virtual Machine" },
29   - { "jitx86", "LuaJIT x86" },
30 29 { "jit2", "LuaJIT2" },
31 30 }
32 31 }
... ...
... ... @@ -45,19 +45,35 @@ project "TEngine"
45 45 configuration "macosx"
46 46 files { "../src/mac/SDL*" }
47 47 includedirs {
48   - "/System/Library/Frameworks/OpenGL.framework/Headers",
49   - "/System/Library/Frameworks/OpenAL.framework/Headers",
50   - "/Library/Frameworks/SDL.framework/Headers",
51   - "/Library/Frameworks/SDL.framework/Headers",
52   - "/Library/Frameworks/SDL_net.framework/Headers",
53   - "/Library/Frameworks/SDL_image.framework/Headers",
54   - "/Library/Frameworks/SDL_ttf.framework/Headers",
55   - "/Library/Frameworks/SDL_mixer.framework/Headers",
  48 + "/System/Library/Frameworks/OpenGL.framework/Headers",
  49 + "/System/Library/Frameworks/OpenAL.framework/Headers",
  50 +
  51 + "/Library/Frameworks/SDL2.framework/Headers",
  52 + "/Library/Frameworks/SDL2_image.framework/Headers",
  53 + "/Library/Frameworks/SDL2_ttf.framework/Headers",
  54 +
  55 + -- MacPorts paths
56 56 "/opt/local/include",
57   - "/opt/local/include/Vorbis"
58   - }
59   - defines { "USE_TENGINE_MAIN", 'SELFEXE_MACOSX', [[TENGINE_HOME_PATH='"/Library/Application Support/T-Engine/"']] }
60   - linkoptions { "-framework SDL", "-framework SDL_image", "-framework SDL_ttf", "-framework SDL_mixer", "-framework Cocoa", "-framework OpenGL" , "-framework OpenAL", "-pagezero_size 10000","-image_base 100000000" }
  57 + "/opt/local/include/Vorbis",
  58 +
  59 + -- Homebrew paths
  60 + "/usr/local/include",
  61 + "/usr/local/opt/libpng12/include",
  62 + }
  63 + defines { "USE_TENGINE_MAIN", 'SELFEXE_MACOSX', [[TENGINE_HOME_PATH='"/Library/Application Support/T-Engine/"']] }
  64 + linkoptions {
  65 + "-framework Cocoa",
  66 + "-framework OpenGL",
  67 + "-framework OpenAL",
  68 +
  69 + "-framework SDL2",
  70 + "-framework SDL2_image",
  71 + "-framework SDL2_ttf",
  72 +
  73 + -- These two options are mandatory for LuaJIT to work
  74 + "-pagezero_size 10000",
  75 + "-image_base 100000000",
  76 + }
61 77 targetdir "."
62 78 links { "IOKit" }
63 79
... ... @@ -111,15 +127,6 @@ if _OPTIONS.lua == "default" then
111 127 targetname "lua"
112 128
113 129 files { "../src/lua/*.c", }
114   -elseif _OPTIONS.lua == "jitx86" then
115   - project "luajitx86"
116   - kind "StaticLib"
117   - language "C"
118   - targetname "lua"
119   -
120   - files { "../src/luajit/*.c", }
121   - configuration "linux"
122   - defines { "LUA_USE_POSIX" }
123 130 elseif _OPTIONS.lua == "jit2" then
124 131 project "minilua"
125 132 kind "ConsoleApp"
... ...
... ... @@ -22,7 +22,6 @@ solution "TEngine"
22 22 "/usr/include/GL",
23 23 }
24 24 if _OPTIONS.lua == "default" then includedirs{"src/lua"}
25   - elseif _OPTIONS.lua == "jitx86" then includedirs{"src/luajit", "src/dynasm",}
26 25 elseif _OPTIONS.lua == "jit2" then includedirs{"src/luajit2/src", "src/luajit2/dynasm",}
27 26 end
28 27
... ...
... ... @@ -376,9 +376,6 @@ int get_min_array_size64(void) {
376 376 * init_gen_rand or init_by_array must be called before this function.
377 377 * @return 32-bit pseudorandom number
378 378 */
379   -#ifndef __APPLE__
380   -inline
381   -#endif
382 379 uint32_t gen_rand32(void) {
383 380 uint32_t r;
384 381
... ...
... ... @@ -24,7 +24,7 @@ int auxiliar_open(lua_State *L) {
24 24 * Creates a new class with given methods
25 25 * Methods whose names start with __ are passed directly to the metatable.
26 26 \*-------------------------------------------------------------------------*/
27   -void auxiliar_newclass(lua_State *L, const char *classname, const luaL_reg *func) {
  27 +void auxiliar_newclass(lua_State *L, const char *classname, const luaL_Reg *func) {
28 28 luaL_newmetatable(L, classname); /* mt */
29 29 /* create __index table to place methods */
30 30 lua_pushstring(L, "__index"); /* mt,"__index" */
... ...
... ... @@ -35,7 +35,7 @@
35 35 #include "lauxlib.h"
36 36
37 37 int auxiliar_open(lua_State *L);
38   -void auxiliar_newclass(lua_State *L, const char *classname, const luaL_reg *func);
  38 +void auxiliar_newclass(lua_State *L, const char *classname, const luaL_Reg *func);
39 39 void auxiliar_add2group(lua_State *L, const char *classname, const char *group);
40 40 void auxiliar_setclass(lua_State *L, const char *classname, int objidx);
41 41 void *auxiliar_checkclass(lua_State *L, const char *classname, int objidx);
... ...
... ... @@ -291,7 +291,7 @@ static int lua_set_current_mousehandler(lua_State *L)
291 291
292 292 return 0;
293 293 }
294   -static const struct luaL_reg mouselib[] =
  294 +static const struct luaL_Reg mouselib[] =
295 295 {
296 296 {"get", lua_get_mouse},
297 297 {"set", lua_set_mouse},
... ... @@ -376,7 +376,7 @@ static int lua_key_get_clipboard(lua_State *L)
376 376 return 1;
377 377 }
378 378
379   -static const struct luaL_reg keylib[] =
  379 +static const struct luaL_Reg keylib[] =
380 380 {
381 381 {"set_current_handler", lua_set_current_keyhandler},
382 382 {"modState", lua_get_mod_state},
... ... @@ -474,7 +474,7 @@ static int lua_check_error(lua_State *L)
474 474 return 1;
475 475 }
476 476
477   -static const struct luaL_reg gamelib[] =
  477 +static const struct luaL_Reg gamelib[] =
478 478 {
479 479 {"reboot", lua_reboot_lua},
480 480 {"set_current_game", lua_set_current_game},
... ... @@ -2546,7 +2546,7 @@ static int sdl_get_png_screenshot(lua_State *L)
2546 2546 return 1;
2547 2547 }
2548 2548
2549   -static const struct luaL_reg displaylib[] =
  2549 +static const struct luaL_Reg displaylib[] =
2550 2550 {
2551 2551 {"setTextBlended", set_text_aa},
2552 2552 {"getTextBlended", get_text_aa},
... ... @@ -2587,7 +2587,7 @@ static const struct luaL_reg displaylib[] =
2587 2587 {NULL, NULL},
2588 2588 };
2589 2589
2590   -static const struct luaL_reg sdl_surface_reg[] =
  2590 +static const struct luaL_Reg sdl_surface_reg[] =
2591 2591 {
2592 2592 {"__gc", sdl_free_surface},
2593 2593 {"close", sdl_free_surface},
... ... @@ -2605,7 +2605,7 @@ static const struct luaL_reg sdl_surface_reg[] =
2605 2605 {NULL, NULL},
2606 2606 };
2607 2607
2608   -static const struct luaL_reg sdl_texture_reg[] =
  2608 +static const struct luaL_Reg sdl_texture_reg[] =
2609 2609 {
2610 2610 {"__gc", sdl_free_texture},
2611 2611 {"close", sdl_free_texture},
... ... @@ -2619,7 +2619,7 @@ static const struct luaL_reg sdl_texture_reg[] =
2619 2619 {NULL, NULL},
2620 2620 };
2621 2621
2622   -static const struct luaL_reg sdl_font_reg[] =
  2622 +static const struct luaL_Reg sdl_font_reg[] =
2623 2623 {
2624 2624 {"__gc", sdl_free_font},
2625 2625 {"close", sdl_free_font},
... ... @@ -2632,7 +2632,7 @@ static const struct luaL_reg sdl_font_reg[] =
2632 2632 {NULL, NULL},
2633 2633 };
2634 2634
2635   -static const struct luaL_reg gl_fbo_reg[] =
  2635 +static const struct luaL_Reg gl_fbo_reg[] =
2636 2636 {
2637 2637 {"__gc", gl_free_fbo},
2638 2638 {"toScreen", gl_fbo_toscreen},
... ... @@ -2640,7 +2640,7 @@ static const struct luaL_reg gl_fbo_reg[] =
2640 2640 {NULL, NULL},
2641 2641 };
2642 2642
2643   -static const struct luaL_reg gl_quadratic_reg[] =
  2643 +static const struct luaL_Reg gl_quadratic_reg[] =
2644 2644 {
2645 2645 {"__gc", gl_free_quadratic},
2646 2646 {"sphere", gl_quadratic_sphere},
... ... @@ -2917,7 +2917,7 @@ static int rng_normal_float(lua_State *L)
2917 2917 return 1;
2918 2918 }
2919 2919
2920   -static const struct luaL_reg rnglib[] =
  2920 +static const struct luaL_Reg rnglib[] =
2921 2921 {
2922 2922 {"__call", rng_call},
2923 2923 {"range", rng_range},
... ... @@ -3031,13 +3031,13 @@ static int lua_free_line(lua_State *L)
3031 3031 return 1;
3032 3032 }
3033 3033
3034   -static const struct luaL_reg linelib[] =
  3034 +static const struct luaL_Reg linelib[] =
3035 3035 {
3036 3036 {"new", lua_line_init},
3037 3037 {NULL, NULL},
3038 3038 };
3039 3039
3040   -static const struct luaL_reg line_reg[] =
  3040 +static const struct luaL_Reg line_reg[] =
3041 3041 {
3042 3042 {"__gc", lua_free_line},
3043 3043 {"__call", lua_line_step},
... ... @@ -3112,7 +3112,7 @@ static int lua_zlib_compress(lua_State *L)
3112 3112 }
3113 3113
3114 3114
3115   -static const struct luaL_reg zliblib[] =
  3115 +static const struct luaL_Reg zliblib[] =
3116 3116 {
3117 3117 {"compress", lua_zlib_compress},
3118 3118 {NULL, NULL},
... ...
... ... @@ -49,9 +49,6 @@ void display_put_string(SDL_Surface *surface, const char *s, int x, int y, int r
49 49 }
50 50 }
51 51
52   -#ifndef __APPLE__
53   -inline
54   -#endif
55 52 void sdlDrawImage(SDL_Surface *dest, SDL_Surface *image, int x, int y)
56 53 {
57 54 SDL_Rect r;
... ...
... ... @@ -533,7 +533,7 @@ static int dmnd_1d(lua_State *L)
533 533 return 1;
534 534 }
535 535
536   -static const struct luaL_reg dmndlib[] =
  536 +static const struct luaL_Reg dmndlib[] =
537 537 {
538 538 {"get1D", dmnd_1d},
539 539 {"get2D", dmnd_2d},
... ...
... ... @@ -1450,7 +1450,7 @@ static int lua_free_hex_fov_line(lua_State *L)
1450 1450 return 1;
1451 1451 }
1452 1452
1453   -static const struct luaL_reg fovlib[] =
  1453 +static const struct luaL_Reg fovlib[] =
1454 1454 {
1455 1455 {"newCache", lua_new_fovcache},
1456 1456 {"distance", lua_distance},
... ... @@ -1469,14 +1469,14 @@ static const struct luaL_reg fovlib[] =
1469 1469 {NULL, NULL},
1470 1470 };
1471 1471
1472   -static const struct luaL_reg fovcache_reg[] =
  1472 +static const struct luaL_Reg fovcache_reg[] =
1473 1473 {
1474 1474 {"set", lua_fovcache_set},
1475 1475 {"get", lua_fovcache_get},
1476 1476 {NULL, NULL},
1477 1477 };
1478 1478
1479   -static const struct luaL_reg fovline_reg[] =
  1479 +static const struct luaL_Reg fovline_reg[] =
1480 1480 {
1481 1481 {"__gc", lua_free_fov_line},
1482 1482 {"__call", lua_fov_line_step},
... ... @@ -1491,7 +1491,7 @@ static const struct luaL_reg fovline_reg[] =
1491 1491 {NULL, NULL},
1492 1492 };
1493 1493
1494   -static const struct luaL_reg hexfovline_reg[] =
  1494 +static const struct luaL_Reg hexfovline_reg[] =
1495 1495 {
1496 1496 {"__gc", lua_free_hex_fov_line},
1497 1497 {"__call", lua_hex_fov_line_step},
... ...
... ... @@ -2209,7 +2209,7 @@ LARGE_ASS_LOS_DEFINE_OCTANT(-,-,x,y,m,m,n)
2209 2209 LARGE_ASS_LOS_DEFINE_OCTANT(-,-,y,x,m,m,y)
2210 2210
2211 2211 #define HEX_LOS_DEFINE_SEXTANT(signx, signy, nx, ny, one) \
2212   - static float hex_los_sextant_##nx##ny( \
  2212 + static void hex_los_sextant_##nx##ny( \
2213 2213 fov_private_data_type *data, \
2214 2214 hex_fov_line_data *line, \
2215 2215 float start_slope, \
... ... @@ -2290,7 +2290,7 @@ LARGE_ASS_LOS_DEFINE_OCTANT(-,-,y,x,m,m,y)
2290 2290 }
2291 2291
2292 2292 #define HEX_LOS_DEFINE_LR_SEXTANT(signx, nx) \
2293   - static float hex_los_sextant_##nx( \
  2293 + static void hex_los_sextant_##nx( \
2294 2294 fov_private_data_type *data, \
2295 2295 hex_fov_line_data *line, \
2296 2296 float start_slope, \
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -97,7 +97,7 @@
97 97 #include <X11/Xlib.h>
98 98 #include <X11/Xutil.h>
99 99 #include <X11/Xmd.h>
100   -#include "glew.h"
  100 +#include <glew.h>
101 101
102 102 #ifdef __cplusplus
103 103 extern "C" {
... ... @@ -258,8 +258,8 @@ typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
258 258 #define GLX_DONT_CARE 0xFFFFFFFF
259 259
260 260 typedef XID GLXFBConfigID;
261   -typedef XID GLXWindow;
262 261 typedef XID GLXPbuffer;
  262 +typedef XID GLXWindow;
263 263 typedef struct __GLXFBConfigRec *GLXFBConfig;
264 264
265 265 typedef struct {
... ... @@ -346,6 +346,26 @@ extern void ( * glXGetProcAddress (const GLubyte *procName)) (void);
346 346
347 347 #endif /* GLX_3DFX_multisample */
348 348
  349 +/* ------------------------ GLX_AMD_gpu_association ------------------------ */
  350 +
  351 +#ifndef GLX_AMD_gpu_association
  352 +#define GLX_AMD_gpu_association 1
  353 +
  354 +#define GLX_GPU_VENDOR_AMD 0x1F00
  355 +#define GLX_GPU_RENDERER_STRING_AMD 0x1F01
  356 +#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
  357 +#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
  358 +#define GLX_GPU_RAM_AMD 0x21A3
  359 +#define GLX_GPU_CLOCK_AMD 0x21A4
  360 +#define GLX_GPU_NUM_PIPES_AMD 0x21A5
  361 +#define GLX_GPU_NUM_SIMD_AMD 0x21A6
  362 +#define GLX_GPU_NUM_RB_AMD 0x21A7
  363 +#define GLX_GPU_NUM_SPI_AMD 0x21A8
  364 +
  365 +#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association)
  366 +
  367 +#endif /* GLX_AMD_gpu_association */
  368 +
349 369 /* ------------------------- GLX_ARB_create_context ------------------------ */
350 370
351 371 #ifndef GLX_ARB_create_context
... ... @@ -378,6 +398,20 @@ typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBCo
378 398
379 399 #endif /* GLX_ARB_create_context_profile */
380 400
  401 +/* ------------------- GLX_ARB_create_context_robustness ------------------- */
  402 +
  403 +#ifndef GLX_ARB_create_context_robustness
  404 +#define GLX_ARB_create_context_robustness 1
  405 +
  406 +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
  407 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
  408 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
  409 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
  410 +
  411 +#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness)
  412 +
  413 +#endif /* GLX_ARB_create_context_robustness */
  414 +
381 415 /* ------------------------- GLX_ARB_fbconfig_float ------------------------ */
382 416
383 417 #ifndef GLX_ARB_fbconfig_float
... ... @@ -424,6 +458,28 @@ extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void);
424 458
425 459 #endif /* GLX_ARB_multisample */
426 460
  461 +/* ---------------- GLX_ARB_robustness_application_isolation --------------- */
  462 +
  463 +#ifndef GLX_ARB_robustness_application_isolation
  464 +#define GLX_ARB_robustness_application_isolation 1
  465 +
  466 +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
  467 +
  468 +#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation)
  469 +
  470 +#endif /* GLX_ARB_robustness_application_isolation */
  471 +
  472 +/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */
  473 +
  474 +#ifndef GLX_ARB_robustness_share_group_isolation
  475 +#define GLX_ARB_robustness_share_group_isolation 1
  476 +
  477 +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
  478 +
  479 +#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation)
  480 +
  481 +#endif /* GLX_ARB_robustness_share_group_isolation */
  482 +
427 483 /* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */
428 484
429 485 #ifndef GLX_ARB_vertex_buffer_object
... ... @@ -499,6 +555,28 @@ typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, i
499 555
500 556 #endif /* GLX_ATI_render_texture */
501 557
  558 +/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */
  559 +
  560 +#ifndef GLX_EXT_create_context_es2_profile
  561 +#define GLX_EXT_create_context_es2_profile 1
  562 +
  563 +#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
  564 +
  565 +#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile)
  566 +
  567 +#endif /* GLX_EXT_create_context_es2_profile */
  568 +
  569 +/* ------------------- GLX_EXT_create_context_es_profile ------------------- */
  570 +
  571 +#ifndef GLX_EXT_create_context_es_profile
  572 +#define GLX_EXT_create_context_es_profile 1
  573 +
  574 +#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
  575 +
  576 +#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile)
  577 +
  578 +#endif /* GLX_EXT_create_context_es_profile */
  579 +
502 580 /* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */
503 581
504 582 #ifndef GLX_EXT_fbconfig_packed_float
... ... @@ -572,6 +650,17 @@ typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable,
572 650
573 651 #endif /* GLX_EXT_swap_control */
574 652
  653 +/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */
  654 +
  655 +#ifndef GLX_EXT_swap_control_tear
  656 +#define GLX_EXT_swap_control_tear 1
  657 +
  658 +#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
  659 +
  660 +#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear)
  661 +
  662 +#endif /* GLX_EXT_swap_control_tear */
  663 +
575 664 /* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */
576 665
577 666 #ifndef GLX_EXT_texture_from_pixmap
... ... @@ -740,6 +829,21 @@ typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode);
740 829
741 830 #endif /* GLX_MESA_set_3dfx_mode */
742 831
  832 +/* ------------------------- GLX_MESA_swap_control ------------------------- */
  833 +
  834 +#ifndef GLX_MESA_swap_control
  835 +#define GLX_MESA_swap_control 1
  836 +
  837 +typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void);
  838 +typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval);
  839 +
  840 +#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA)
  841 +#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA)
  842 +
  843 +#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control)
  844 +
  845 +#endif /* GLX_MESA_swap_control */
  846 +
743 847 /* --------------------------- GLX_NV_copy_image --------------------------- */
744 848
745 849 #ifndef GLX_NV_copy_image
... ... @@ -764,6 +868,18 @@ typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx,
764 868
765 869 #endif /* GLX_NV_float_buffer */
766 870
  871 +/* ---------------------- GLX_NV_multisample_coverage ---------------------- */
  872 +
  873 +#ifndef GLX_NV_multisample_coverage
  874 +#define GLX_NV_multisample_coverage 1
  875 +
  876 +#define GLX_COLOR_SAMPLES_NV 0x20B3
  877 +#define GLX_COVERAGE_SAMPLES_NV 100001
  878 +
  879 +#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage)
  880 +
  881 +#endif /* GLX_NV_multisample_coverage */
  882 +
767 883 /* -------------------------- GLX_NV_present_video ------------------------- */
768 884
769 885 #ifndef GLX_NV_present_video
... ... @@ -819,10 +935,37 @@ typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer);
819 935
820 936 #endif /* GLX_NV_vertex_array_range */
821 937
822   -/* -------------------------- GLX_NV_video_output -------------------------- */
  938 +/* -------------------------- GLX_NV_video_capture ------------------------- */
  939 +
  940 +#ifndef GLX_NV_video_capture
  941 +#define GLX_NV_video_capture 1
  942 +
  943 +#define GLX_DEVICE_ID_NV 0x20CD
  944 +#define GLX_UNIQUE_ID_NV 0x20CE
  945 +#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
  946 +
  947 +typedef XID GLXVideoCaptureDeviceNV;
823 948
824   -#ifndef GLX_NV_video_output
825   -#define GLX_NV_video_output 1
  949 +typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
  950 +typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements);
  951 +typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
  952 +typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
  953 +typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
  954 +
  955 +#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV)
  956 +#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV)
  957 +#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV)
  958 +#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV)
  959 +#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV)
  960 +
  961 +#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture)
  962 +
  963 +#endif /* GLX_NV_video_capture */
  964 +
  965 +/* ---------------------------- GLX_NV_video_out --------------------------- */
  966 +
  967 +#ifndef GLX_NV_video_out
  968 +#define GLX_NV_video_out 1
826 969
827 970 #define GLX_VIDEO_OUT_COLOR_NV 0x20C3
828 971 #define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
... ... @@ -849,9 +992,9 @@ typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf,
849 992 #define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV)
850 993 #define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV)
851 994
852   -#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output)
  995 +#define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out)
853 996
854   -#endif /* GLX_NV_video_output */
  997 +#endif /* GLX_NV_video_out */
855 998
856 999 /* -------------------------- GLX_OML_swap_method -------------------------- */
857 1000
... ... @@ -869,8 +1012,7 @@ typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf,
869 1012
870 1013 /* -------------------------- GLX_OML_sync_control ------------------------- */
871 1014
872   -#if !defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
873   -#include <inttypes.h>
  1015 +#ifndef GLX_OML_sync_control
874 1016 #define GLX_OML_sync_control 1
875 1017
876 1018 typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator);
... ... @@ -1207,7 +1349,7 @@ typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
1207 1349 #ifndef GLX_SGI_video_sync
1208 1350 #define GLX_SGI_video_sync 1
1209 1351
1210   -typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (uint* count);
  1352 +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count);
1211 1353 typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count);
1212 1354
1213 1355 #define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI)
... ... @@ -1251,194 +1393,213 @@ typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window,
1251 1393 /* ------------------------------------------------------------------------- */
1252 1394
1253 1395 #ifdef GLEW_MX
1254   -#define GLXEW_EXPORT
  1396 +#define GLXEW_FUN_EXPORT
  1397 +#define GLXEW_VAR_EXPORT
1255 1398 #else
1256   -#define GLXEW_EXPORT extern
  1399 +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT
  1400 +#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT
1257 1401 #endif /* GLEW_MX */
1258 1402
1259   -extern PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay;
1260   -
1261   -extern PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig;
1262   -extern PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext;
1263   -extern PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer;
1264   -extern PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap;
1265   -extern PFNGLXCREATEWINDOWPROC __glewXCreateWindow;
1266   -extern PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer;
1267   -extern PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap;
1268   -extern PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow;
1269   -extern PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable;
1270   -extern PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib;
1271   -extern PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs;
1272   -extern PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent;
1273   -extern PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig;
1274   -extern PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent;
1275   -extern PFNGLXQUERYCONTEXTPROC __glewXQueryContext;
1276   -extern PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable;
1277   -extern PFNGLXSELECTEVENTPROC __glewXSelectEvent;
  1403 +GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay;
  1404 +
  1405 +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig;
  1406 +GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext;
  1407 +GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer;
  1408 +GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap;
  1409 +GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow;
  1410 +GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer;
  1411 +GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap;
  1412 +GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow;
  1413 +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable;
  1414 +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib;
  1415 +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs;
  1416 +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent;
  1417 +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig;
  1418 +GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent;
  1419 +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext;
  1420 +GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable;
  1421 +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent;
  1422 +
  1423 +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB;
  1424 +
  1425 +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI;
  1426 +GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI;
  1427 +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI;
1278 1428
1279   -extern PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB;
  1429 +GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT;
  1430 +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT;
  1431 +GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT;
  1432 +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT;
1280 1433
1281   -extern PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI;
1282   -extern PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI;
1283   -extern PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI;
  1434 +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT;
1284 1435
1285   -extern PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT;
1286   -extern PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT;
1287   -extern PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT;
1288   -extern PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT;
  1436 +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT;
  1437 +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT;
1289 1438
1290   -extern PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT;
  1439 +GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA;
1291 1440
1292   -extern PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT;
1293   -extern PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT;
  1441 +GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA;
1294 1442
1295   -extern PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA;
  1443 +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA;
1296 1444
1297   -extern PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA;
  1445 +GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA;
1298 1446
1299   -extern PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA;
  1447 +GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA;
1300 1448
1301   -extern PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA;
  1449 +GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA;
  1450 +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA;
1302 1451
1303   -extern PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA;
  1452 +GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV;
1304 1453
1305   -extern PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV;
  1454 +GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV;
  1455 +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV;
1306 1456
1307   -extern PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV;
1308   -extern PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV;
  1457 +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV;
  1458 +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV;
  1459 +GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV;
  1460 +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV;
  1461 +GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV;
  1462 +GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV;
1309 1463
1310   -extern PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV;
1311   -extern PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV;
1312   -extern PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV;
1313   -extern PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV;
1314   -extern PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV;
1315   -extern PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV;
  1464 +GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV;
  1465 +GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV;
1316 1466
1317   -extern PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV;
1318   -extern PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV;
  1467 +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV;
  1468 +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV;
  1469 +GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV;
  1470 +GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV;
  1471 +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV;
1319 1472
1320   -extern PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV;
1321   -extern PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV;
1322   -extern PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV;
1323   -extern PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV;
1324   -extern PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV;
1325   -extern PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV;
  1473 +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV;
  1474 +GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV;
  1475 +GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV;
  1476 +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV;
  1477 +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV;
  1478 +GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV;
1326 1479
1327   -#ifdef GLX_OML_sync_control
1328   -extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;
1329   -extern PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML;
1330   -extern PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML;
1331   -extern PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML;
1332   -extern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;
1333   -#endif
  1480 +GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;
  1481 +GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML;
  1482 +GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML;
  1483 +GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML;
  1484 +GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;
1334 1485
1335   -extern PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX;
1336   -extern PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX;
1337   -extern PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX;
1338   -extern PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX;
1339   -extern PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX;
1340   -extern PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX;
  1486 +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX;
  1487 +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX;
  1488 +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX;
  1489 +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX;
  1490 +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX;
  1491 +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX;
1341 1492
1342   -extern PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX;
1343   -extern PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX;
1344   -extern PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX;
1345   -extern PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX;
1346   -extern PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX;
1347   -extern PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX;
1348   -extern PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX;
1349   -extern PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX;
  1493 +GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX;
  1494 +GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX;
  1495 +GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX;
  1496 +GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX;
  1497 +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX;
  1498 +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX;
  1499 +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX;
  1500 +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX;
1350 1501
1351   -extern PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX;
1352   -extern PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX;
1353   -extern PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX;
1354   -extern PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX;
1355   -extern PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX;
  1502 +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX;
  1503 +GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX;
  1504 +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX;
  1505 +GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX;
  1506 +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX;
1356 1507
1357   -extern PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX;
1358   -extern PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX;
  1508 +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX;
  1509 +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX;
1359 1510
1360   -extern PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX;
  1511 +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX;
1361 1512
1362   -extern PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX;
1363   -extern PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX;
1364   -extern PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX;
1365   -extern PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX;
1366   -extern PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX;
  1513 +GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX;
  1514 +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX;
  1515 +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX;
  1516 +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX;
  1517 +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX;
1367 1518
1368   -extern PFNGLXCUSHIONSGIPROC __glewXCushionSGI;
  1519 +GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI;
1369 1520
1370   -extern PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI;
1371   -extern PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI;
  1521 +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI;
  1522 +GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI;
1372 1523
1373   -extern PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI;
  1524 +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI;
1374 1525
1375   -extern PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI;
1376   -extern PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI;
  1526 +GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI;
  1527 +GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI;
1377 1528
1378   -extern PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN;
  1529 +GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN;
1379 1530
1380   -extern PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN;
1381   -extern PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN;
  1531 +GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN;
  1532 +GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN;
1382 1533
1383 1534 #if defined(GLEW_MX)
1384 1535 struct GLXEWContextStruct
1385 1536 {
1386 1537 #endif /* GLEW_MX */
1387 1538
1388   -GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0;
1389   -GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1;
1390   -GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;
1391   -GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_3;
1392   -GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_4;
1393   -GLXEW_EXPORT GLboolean __GLXEW_3DFX_multisample;
1394   -GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context;
1395   -GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context_profile;
1396   -GLXEW_EXPORT GLboolean __GLXEW_ARB_fbconfig_float;
1397   -GLXEW_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB;
1398   -GLXEW_EXPORT GLboolean __GLXEW_ARB_get_proc_address;
1399   -GLXEW_EXPORT GLboolean __GLXEW_ARB_multisample;
1400   -GLXEW_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object;
1401   -GLXEW_EXPORT GLboolean __GLXEW_ATI_pixel_format_float;
1402   -GLXEW_EXPORT GLboolean __GLXEW_ATI_render_texture;
1403   -GLXEW_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float;
1404   -GLXEW_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB;
1405   -GLXEW_EXPORT GLboolean __GLXEW_EXT_import_context;
1406   -GLXEW_EXPORT GLboolean __GLXEW_EXT_scene_marker;
1407   -GLXEW_EXPORT GLboolean __GLXEW_EXT_swap_control;
1408   -GLXEW_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap;
1409   -GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_info;
1410   -GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_rating;
1411   -GLXEW_EXPORT GLboolean __GLXEW_INTEL_swap_event;
1412   -GLXEW_EXPORT GLboolean __GLXEW_MESA_agp_offset;
1413   -GLXEW_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer;
1414   -GLXEW_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap;
1415   -GLXEW_EXPORT GLboolean __GLXEW_MESA_release_buffers;
1416   -GLXEW_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode;
1417   -GLXEW_EXPORT GLboolean __GLXEW_NV_copy_image;
1418   -GLXEW_EXPORT GLboolean __GLXEW_NV_float_buffer;
1419   -GLXEW_EXPORT GLboolean __GLXEW_NV_present_video;
1420   -GLXEW_EXPORT GLboolean __GLXEW_NV_swap_group;
1421   -GLXEW_EXPORT GLboolean __GLXEW_NV_vertex_array_range;
1422   -GLXEW_EXPORT GLboolean __GLXEW_NV_video_output;
1423   -GLXEW_EXPORT GLboolean __GLXEW_OML_swap_method;
1424   -GLXEW_EXPORT GLboolean __GLXEW_OML_sync_control;
1425   -GLXEW_EXPORT GLboolean __GLXEW_SGIS_blended_overlay;
1426   -GLXEW_EXPORT GLboolean __GLXEW_SGIS_color_range;
1427   -GLXEW_EXPORT GLboolean __GLXEW_SGIS_multisample;
1428   -GLXEW_EXPORT GLboolean __GLXEW_SGIS_shared_multisample;
1429   -GLXEW_EXPORT GLboolean __GLXEW_SGIX_fbconfig;
1430   -GLXEW_EXPORT GLboolean __GLXEW_SGIX_hyperpipe;
1431   -GLXEW_EXPORT GLboolean __GLXEW_SGIX_pbuffer;
1432   -GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_barrier;
1433   -GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_group;
1434   -GLXEW_EXPORT GLboolean __GLXEW_SGIX_video_resize;
1435   -GLXEW_EXPORT GLboolean __GLXEW_SGIX_visual_select_group;
1436   -GLXEW_EXPORT GLboolean __GLXEW_SGI_cushion;
1437   -GLXEW_EXPORT GLboolean __GLXEW_SGI_make_current_read;
1438   -GLXEW_EXPORT GLboolean __GLXEW_SGI_swap_control;
1439   -GLXEW_EXPORT GLboolean __GLXEW_SGI_video_sync;
1440   -GLXEW_EXPORT GLboolean __GLXEW_SUN_get_transparent_index;
1441   -GLXEW_EXPORT GLboolean __GLXEW_SUN_video_resize;
  1539 +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0;
  1540 +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1;
  1541 +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;
  1542 +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3;
  1543 +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4;
  1544 +GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample;
  1545 +GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association;
  1546 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context;
  1547 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile;
  1548 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness;
  1549 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float;
  1550 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB;
  1551 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address;
  1552 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample;
  1553 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation;
  1554 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation;
  1555 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object;
  1556 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float;
  1557 +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture;
  1558 +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile;
  1559 +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile;
  1560 +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float;
  1561 +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB;
  1562 +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context;
  1563 +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker;
  1564 +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control;
  1565 +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear;
  1566 +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap;
  1567 +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info;
  1568 +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating;
  1569 +GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event;
  1570 +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset;
  1571 +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer;
  1572 +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap;
  1573 +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers;
  1574 +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode;
  1575 +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control;
  1576 +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image;
  1577 +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer;
  1578 +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage;
  1579 +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video;
  1580 +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group;
  1581 +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range;
  1582 +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture;
  1583 +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out;
  1584 +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method;
  1585 +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control;
  1586 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay;
  1587 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range;
  1588 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample;
  1589 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample;
  1590 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig;
  1591 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe;
  1592 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer;
  1593 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier;
  1594 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group;
  1595 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize;
  1596 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group;
  1597 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion;
  1598 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read;
  1599 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control;
  1600 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync;
  1601 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index;
  1602 +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize;
1442 1603
1443 1604 #ifdef GLEW_MX
1444 1605 }; /* GLXEWContextStruct */
... ... @@ -1449,8 +1610,8 @@ GLXEW_EXPORT GLboolean __GLXEW_SUN_video_resize;
1449 1610 #ifdef GLEW_MX
1450 1611
1451 1612 typedef struct GLXEWContextStruct GLXEWContext;
1452   -extern GLenum glxewContextInit (GLXEWContext* ctx);
1453   -extern GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name);
  1613 +GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx);
  1614 +GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name);
1454 1615
1455 1616 #define glxewInit() glxewContextInit(glxewGetContext())
1456 1617 #define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x)
... ... @@ -1463,11 +1624,11 @@ extern GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name);
1463 1624 #define GLXEW_GET_VAR(x) (*(const GLboolean*)&x)
1464 1625 #define GLXEW_GET_FUN(x) x
1465 1626
1466   -extern GLboolean glxewIsSupported (const char* name);
  1627 +GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name);
1467 1628
1468 1629 #endif /* GLEW_MX */
1469 1630
1470   -extern GLboolean glxewGetExtension (const char* name);
  1631 +GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name);
1471 1632
1472 1633 #ifdef __cplusplus
1473 1634 }
... ...
... ... @@ -48,7 +48,7 @@ o: $(ALL_O)
48 48 a: $(ALL_A)
49 49
50 50 $(LUA_A): $(CORE_O) $(LIB_O)
51   - $(AR) $@ $?
  51 + $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
52 52 $(RANLIB) $@
53 53
54 54 $(LUA_T): $(LUA_O) $(LUA_A)
... ...
... ... @@ -631,7 +631,7 @@ static void base_open (lua_State *L) {
631 631 luaL_register(L, "_G", base_funcs);
632 632 lua_pushliteral(L, LUA_VERSION);
633 633 lua_setglobal(L, "_VERSION"); /* set global _VERSION */
634   - /* `ipairs' and `pairs' need auxliliary functions as upvalues */
  634 + /* `ipairs' and `pairs' need auxiliary functions as upvalues */
635 635 auxopen(L, "ipairs", luaB_ipairs, ipairsaux);
636 636 auxopen(L, "pairs", luaB_pairs, luaB_next);
637 637 /* `newproxy' needs a weaktable as upvalue */
... ...
1 1 /*
2   -** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
  2 +** $Id: lcode.c,v 2.25.1.5 2011/01/31 14:53:16 roberto Exp $
3 3 ** Code generator for Lua
4 4 ** See Copyright Notice in lua.h
5 5 */
... ... @@ -544,10 +544,6 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) {
544 544 pc = NO_JUMP; /* always true; do nothing */
545 545 break;
546 546 }
547   - case VFALSE: {
548   - pc = luaK_jump(fs); /* always jump */
549   - break;
550   - }
551 547 case VJMP: {
552 548 invertjump(fs, e);
553 549 pc = e->u.s.info;
... ... @@ -572,10 +568,6 @@ static void luaK_goiffalse (FuncState *fs, expdesc *e) {
572 568 pc = NO_JUMP; /* always false; do nothing */
573 569 break;
574 570 }
575   - case VTRUE: {
576   - pc = luaK_jump(fs); /* always jump */
577   - break;
578   - }
579 571 case VJMP: {
580 572 pc = e->u.s.info;
581 573 break;
... ...
1 1 /*
2   -** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
  2 +** $Id: ldblib.c,v 1.104.1.4 2009/08/04 18:50:18 roberto Exp $
3 3 ** Interface from Lua to its debug API
4 4 ** See Copyright Notice in lua.h
5 5 */
... ... @@ -45,6 +45,7 @@ static int db_setmetatable (lua_State *L) {
45 45
46 46
47 47 static int db_getfenv (lua_State *L) {
  48 + luaL_checkany(L, 1);
48 49 lua_getfenv(L, 1);
49 50 return 1;
50 51 }
... ... @@ -318,7 +319,7 @@ static int db_debug (lua_State *L) {
318 319 #define LEVELS1 12 /* size of the first part of the stack */
319 320 #define LEVELS2 10 /* size of the second part of the stack */
320 321
321   -int db_errorfb (lua_State *L) {
  322 +static int db_errorfb (lua_State *L) {
322 323 int level;
323 324 int firstpart = 1; /* still before eventual `...' */
324 325 int arg;
... ...
1 1 /*
2   -** $Id: ldo.c,v 2.38.1.3 2008/01/18 22:31:22 roberto Exp $
  2 +** $Id: ldo.c,v 2.38.1.4 2012/01/18 02:27:10 roberto Exp $
3 3 ** Stack and Call structure of Lua
4 4 ** See Copyright Notice in lua.h
5 5 */
... ... @@ -217,6 +217,7 @@ static StkId adjust_varargs (lua_State *L, Proto *p, int actual) {
217 217 int nvar = actual - nfixargs; /* number of extra arguments */
218 218 lua_assert(p->is_vararg & VARARG_HASARG);
219 219 luaC_checkGC(L);
  220 + luaD_checkstack(L, p->maxstacksize);
220 221 htab = luaH_new(L, nvar, 1); /* create `arg' table */
221 222 for (i=0; i<nvar; i++) /* put extra arguments into `arg' table */
222 223 setobj2n(L, luaH_setnum(L, htab, i+1), L->top - nvar + i);
... ...
1 1 /*
2   -** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $
  2 +** $Id: lgc.c,v 2.38.1.2 2011/03/18 18:05:38 roberto Exp $
3 3 ** Garbage Collector
4 4 ** See Copyright Notice in lua.h
5 5 */
... ... @@ -627,7 +627,6 @@ void luaC_step (lua_State *L) {
627 627 }
628 628 }
629 629 else {
630   - lua_assert(g->totalbytes >= g->estimate);
631 630 setthreshold(g);
632 631 }
633 632 }
... ...
1 1 /*
2   -** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $
  2 +** $Id: liolib.c,v 2.73.1.4 2010/05/14 15:33:51 roberto Exp $
3 3 ** Standard I/O (and system) library
4 4 ** See Copyright Notice in lua.h
5 5 */
... ... @@ -276,7 +276,10 @@ static int read_number (lua_State *L, FILE *f) {
276 276 lua_pushnumber(L, d);
277 277 return 1;
278 278 }
279   - else return 0; /* read fails */
  279 + else {
  280 + lua_pushnil(L); /* "result" to be removed */
  281 + return 0; /* read fails */
  282 + }
280 283 }
281 284
282 285
... ...
1 1 /*
2   -** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
  2 +** $Id: llex.c,v 2.20.1.2 2009/11/23 14:58:22 roberto Exp $
3 3 ** Lexical Analyzer
4 4 ** See Copyright Notice in lua.h
5 5 */
... ... @@ -118,8 +118,10 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
118 118 lua_State *L = ls->L;
119 119 TString *ts = luaS_newlstr(L, str, l);
120 120 TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
121   - if (ttisnil(o))
  121 + if (ttisnil(o)) {
122 122 setbvalue(o, 1); /* make sure `str' will not be collected */
  123 + luaC_checkGC(L);
  124 + }
123 125 return ts;
124 126 }
125 127
... ...
1 1 /*
2   -** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $
  2 +** $Id: loadlib.c,v 1.52.1.4 2009/09/09 13:17:16 roberto Exp $
3 3 ** Dynamic library loader for Lua
4 4 ** See Copyright Notice in lua.h
5 5 **
... ... @@ -657,7 +657,7 @@ LUALIB_API int luaopen_package (lua_State *L) {
657 657 lua_pushvalue(L, -1);
658 658 lua_replace(L, LUA_ENVIRONINDEX);
659 659 /* create `loaders' table */
660   - lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1);
  660 + lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0);
661 661 /* fill it with pre-defined loaders */
662 662 for (i=0; loaders[i] != NULL; i++) {
663 663 lua_pushcfunction(L, loaders[i]);
... ...
1 1 /*
2   -** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $
  2 +** $Id: lparser.c,v 2.42.1.4 2011/10/21 19:31:42 roberto Exp $
3 3 ** Lua Parser
4 4 ** See Copyright Notice in lua.h
5 5 */
... ... @@ -374,9 +374,9 @@ static void close_func (LexState *ls) {
374 374 lua_assert(luaG_checkcode(f));
375 375 lua_assert(fs->bl == NULL);
376 376 ls->fs = fs->prev;
377   - L->top -= 2; /* remove table and prototype from the stack */
378 377 /* last token read was anchored in defunct function; must reanchor it */
379 378 if (fs) anchor_token(ls);
  379 + L->top -= 2; /* remove table and prototype from the stack */
380 380 }
381 381
382 382
... ...
1 1 /*
2   -** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $
  2 +** $Id: lstrlib.c,v 1.132.1.5 2010/05/14 15:34:19 roberto Exp $
3 3 ** Standard library for string operations and pattern-matching
4 4 ** See Copyright Notice in lua.h
5 5 */
... ... @@ -754,6 +754,7 @@ static void addintlen (char *form) {
754 754
755 755
756 756 static int str_format (lua_State *L) {
  757 + int top = lua_gettop(L);
757 758 int arg = 1;
758 759 size_t sfl;
759 760 const char *strfrmt = luaL_checklstring(L, arg, &sfl);
... ... @@ -768,7 +769,8 @@ static int str_format (lua_State *L) {
768 769 else { /* format item */
769 770 char form[MAX_FORMAT]; /* to store the format (`%...') */
770 771 char buff[MAX_ITEM]; /* to store the formatted item */
771   - arg++;
  772 + if (++arg > top)
  773 + luaL_argerror(L, arg, "no value");
772 774 strfrmt = scanformat(L, strfrmt, form);
773 775 switch (*strfrmt++) {
774 776 case 'c': {
... ...
... ... @@ -169,6 +169,7 @@ static int tconcat (lua_State *L) {
169 169 ** Addison-Wesley, 1993.)
170 170 */
171 171
  172 +
172 173 static void set2 (lua_State *L, int i, int j) {
173 174 lua_rawseti(L, 1, i);
174 175 lua_rawseti(L, 1, j);
... ...
1 1 /*
2   -** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $
  2 +** $Id: lua.h,v 1.218.1.7 2012/01/13 20:36:20 roberto Exp $
3 3 ** Lua - An Extensible Extension Language
4 4 ** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
5 5 ** See Copyright Notice at the end of this file
... ... @@ -17,9 +17,9 @@
17 17
18 18
19 19 #define LUA_VERSION "Lua 5.1"
20   -#define LUA_RELEASE "Lua 5.1.4"
  20 +#define LUA_RELEASE "Lua 5.1.5"
21 21 #define LUA_VERSION_NUM 501
22   -#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio"
  22 +#define LUA_COPYRIGHT "Copyright (C) 1994-2012 Lua.org, PUC-Rio"
23 23 #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
24 24
25 25
... ... @@ -362,7 +362,7 @@ struct lua_Debug {
362 362
363 363
364 364 /******************************************************************************
365   -* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved.
  365 +* Copyright (C) 1994-2012 Lua.org, PUC-Rio. All rights reserved.
366 366 *
367 367 * Permission is hereby granted, free of charge, to any person obtaining
368 368 * a copy of this software and associated documentation files (the
... ...
1 1 /*
2   -** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
  2 +** $Id: lvm.c,v 2.63.1.5 2011/08/17 20:43:11 roberto Exp $
3 3 ** Lua virtual machine
4 4 ** See Copyright Notice in lua.h
5 5 */
... ... @@ -133,6 +133,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
133 133
134 134 void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
135 135 int loop;
  136 + TValue temp;
136 137 for (loop = 0; loop < MAXTAGLOOP; loop++) {
137 138 const TValue *tm;
138 139 if (ttistable(t)) { /* `t' is a table? */
... ... @@ -141,6 +142,7 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
141 142 if (!ttisnil(oldval) || /* result is no nil? */
142 143 (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
143 144 setobj2t(L, oldval, val);
  145 + h->flags = 0;
144 146 luaC_barriert(L, h, val);
145 147 return;
146 148 }
... ... @@ -152,7 +154,9 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
152 154 callTM(L, tm, t, key, val);
153 155 return;
154 156 }
155   - t = tm; /* else repeat with `tm' */
  157 + /* else repeat with `tm' */
  158 + setobj(L, &temp, tm); /* avoid pointing inside table (may rehash) */
  159 + t = &temp;
156 160 }
157 161 luaG_runerror(L, "loop in settable");
158 162 }
... ...
1 1 /* Some lua stuff that's external but has no headers */
2   -int luaopen_socket_core(lua_State *L);
3   -int luaopen_mime_core(lua_State *L);
4   -int luaopen_profiler(lua_State *L);
5   -int luaopen_lpeg(lua_State *L);
6   -int luaopen_map(lua_State *L);
  2 +int luaopen_bit(lua_State *L);
  3 +int luaopen_diamond_square(lua_State *L);
7 4 int luaopen_fov(lua_State *L);
8 5 int luaopen_gas(lua_State *L);
9   -int luaopen_particles(lua_State *L);
10   -int luaopen_sound(lua_State *L);
11 6 int luaopen_lanes(lua_State *L);
12   -int luaopen_shaders(lua_State *L);
13   -int luaopen_struct(lua_State *L);
14   -int luaopen_noise(lua_State *L);
  7 +int luaopen_lpeg(lua_State *L);
15 8 int luaopen_lxp(lua_State *L);
  9 +int luaopen_map(lua_State *L);
16 10 int luaopen_md5_core (lua_State *L);
17   -int luaopen_zlib (lua_State *L);
  11 +int luaopen_mime_core(lua_State *L);
  12 +int luaopen_noise(lua_State *L);
  13 +int luaopen_particles(lua_State *L);
  14 +int luaopen_physfs(lua_State *L);
  15 +int luaopen_profiler(lua_State *L);
  16 +int luaopen_shaders(lua_State *L);
  17 +int luaopen_socket_core(lua_State *L);
  18 +int luaopen_sound(lua_State *L);
  19 +int luaopen_struct(lua_State *L);
18 20 int luaopen_wait(lua_State *L);
  21 +int luaopen_zlib (lua_State *L);
19 22
20 23 void create_particles_thread();
  24 +void free_particles_thread();
21 25 void thread_particle_new_keyframes(int nb_keyframes);
22 26 bool draw_waiting(lua_State *L);
23 27 bool is_waiting();
  28 +
  29 +void free_profile_thread();
... ...
1   -# Makefile for Lua BitOp -- a bit operations library for Lua 5.1.
  1 +# Makefile for Lua BitOp -- a bit operations library for Lua 5.1/5.2.
2 2 # To compile with MSVC please run: msvcbuild.bat
3 3 # To compile with MinGW please run: mingw32-make -f Makefile.mingw
4 4
... ... @@ -6,16 +6,19 @@
6 6 INCLUDES= -I/usr/local/include
7 7
8 8 DEFINES=
9   -# Use this if you need to compile for an old ARM ABI with swapped FPA doubles
  9 +# Use this for the old ARM ABI with swapped FPA doubles.
  10 +# Do NOT use this for modern ARM EABI with VFP or soft-float!
10 11 #DEFINES= -DSWAPPED_DOUBLE
11 12
12 13 # Lua executable name. Used to find the install path and for testing.
13 14 LUA= lua
14 15
15 16 CC= gcc
16   -SOCFLAGS= -fPIC
17   -SOCC= $(CC) -shared $(SOCFLAGS)
18   -CFLAGS= -Wall -O2 -fomit-frame-pointer $(SOCFLAGS) $(DEFINES) $(INCLUDES)
  17 +CCOPT= -O2 -fomit-frame-pointer
  18 +CCWARN= -Wall
  19 +SOCC= $(CC) -shared
  20 +SOCFLAGS= -fPIC $(CCOPT) $(CCWARN) $(DEFINES) $(INCLUDES) $(CFLAGS)
  21 +SOLDFLAGS= -fPIC $(LDFLAGS)
19 22 RM= rm -f
20 23 INSTALL= install -p
21 24 INSTALLPATH= $(LUA) installpath.lua
... ... @@ -27,10 +30,13 @@ all: $(MODSO)
27 30
28 31 # Alternative target for compiling on Mac OS X:
29 32 macosx:
30   - $(MAKE) all "SOCC=MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) -dynamiclib -single_module -undefined dynamic_lookup $(SOCFLAGS)"
  33 + $(MAKE) all "SOCC=MACOSX_DEPLOYMENT_TARGET=10.4 $(CC) -dynamiclib -single_module -undefined dynamic_lookup"
  34 +
  35 +$(MODNAME).o: $(MODNAME).c
  36 + $(CC) $(SOCFLAGS) -c -o $@ $<
31 37
32 38 $(MODSO): $(MODNAME).o
33   - $(SOCC) -o $@ $<
  39 + $(SOCC) $(SOLDFLAGS) -o $@ $<
34 40
35 41 install: $(MODSO)
36 42 $(INSTALL) $< `$(INSTALLPATH) $(MODNAME)`
... ...
1   -# Makefile for Lua BitOp -- a bit operations library for Lua 5.1.
  1 +# Makefile for Lua BitOp -- a bit operations library for Lua 5.1/5.2.
2 2 # This is a modified Makefile for MinGW. C:\MinGW\bin must be in your PATH.
3 3 # Compile: mingw32-make -f Makefile.mingw
4 4 # Install: mingw32-make -f Makefile.mingw install
... ... @@ -16,8 +16,11 @@ LUADLLPATH= "..\lua51.dll"
16 16 LUACMODPATH= ".."
17 17
18 18 CC= gcc
19   -SOCC= $(CC) -shared $(LUADLLPATH)
20   -CFLAGS= -Wall -O2 -fomit-frame-pointer $(INCLUDES)
  19 +CCOPT= -O2 -fomit-frame-pointer
  20 +CCWARN = -Wall
  21 +SOCC= $(CC) -shared
  22 +SOCFLAGS= $(CCOPT) $(CCWARN) $(INCLUDES) $(CFLAGS)
  23 +SOLDFLAGS= $(LDFLAGS)
21 24 RM= del
22 25 STRIP= strip --strip-unneeded
23 26 INSTALL= copy
... ... @@ -27,8 +30,11 @@ MODSO= $(MODNAME).dll
27 30
28 31 all: $(MODSO)
29 32
  33 +$(MODNAME).o: $(MODNAME).c
  34 + $(CC) $(SOCFLAGS) -c -o $@ $<
  35 +
30 36 $(MODSO): $(MODNAME).o
31   - $(SOCC) -o $@ $<
  37 + $(SOCC) $(SOLDFLAGS) -o $@ $< $(LUADLLPATH)
32 38 $(STRIP) $@
33 39
34 40 install: $(MODSO)
... ...
1   -README for Lua BitOp 1.0.1
  1 +README for Lua BitOp 1.0.2
2 2 --------------------------
3 3
4   -Lua BitOp is a C extension module for Lua 5.1 which adds
  4 +Lua BitOp is a C extension module for Lua 5.1/5.2 which adds
5 5 bitwise operations on numbers.
6 6
7 7 Homepage: http://bitop.luajit.org/
8 8
9   -Lua BitOp is Copyright (C) 2008-2009 Mike Pall.
10   -Lua BitOp is free software, released under the MIT/X license.
  9 +Lua BitOp is Copyright (C) 2008-2012 Mike Pall.
  10 +Lua BitOp is free software, released under the MIT license.
11 11
12 12 --------------------------
13 13
... ...
1 1 /*
2   -** Lua BitOp -- a bit operations library for Lua 5.1.
  2