[WINDOWSCODECS]
authorThomas Faber <thomas.faber@reactos.org>
Sat, 4 Aug 2012 12:44:04 +0000 (12:44 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 4 Aug 2012 12:44:04 +0000 (12:44 +0000)
- Type safety for MSVC compat layer

svn path=/trunk/; revision=57041

reactos/dll/win32/windowscodecs/CMakeLists.txt
reactos/dll/win32/windowscodecs/typeof.h

index 222603e..75f3e9a 100644 (file)
@@ -10,7 +10,6 @@ include_directories(
     ${REACTOS_SOURCE_DIR}/include/reactos/libs/zlib
     ${REACTOS_SOURCE_DIR}/include/reactos/libs/libpng
     ${REACTOS_SOURCE_DIR}/include/reactos/libs/libtiff)
-set_rc_compiler()
 
 if(MSVC)
     add_compile_flags("/FItypeof.h")
@@ -42,12 +41,8 @@ list(APPEND SOURCE
     ${CMAKE_CURRENT_BINARY_DIR}/windowscodecs.def)
 
 add_library(windowscodecs SHARED ${SOURCE})
-
 set_module_type(windowscodecs win32dll)
-
 target_link_libraries(windowscodecs wine uuid)
-
 add_importlibs(windowscodecs ole32 shlwapi advapi32 msvcrt kernel32 ntdll)
 
-
 add_cd_file(TARGET windowscodecs DESTINATION reactos/system32 FOR all)
index 006ae62..3d3d084 100644 (file)
@@ -26,49 +26,56 @@ typedef void (__cdecl typeof(jpeg_destroy_decompress))(struct jpeg_decompress_st
 typedef unsigned char (__cdecl typeof(jpeg_resync_to_restart))(struct jpeg_decompress_struct *, int);
 
 typedef void (*png_error_ptr_1)(struct png_struct_def *, const char *);
-typedef struct png_struct_def * (__cdecl typeof(png_create_read_struct))(const char *, void*, png_error_ptr_1, png_error_ptr_1);
+typedef void (*png_rw_ptr_1)(struct png_struct_def *, unsigned char *, unsigned int);
+typedef void (*png_flush_ptr_1)(struct png_struct_def *);
 typedef struct png_info_def* (__cdecl typeof(png_create_info_struct))(struct png_struct_def *);
+typedef struct png_struct_def * (__cdecl typeof(png_create_read_struct))(const char *, void *, png_error_ptr_1, png_error_ptr_1);
+typedef struct png_struct_def *(__cdecl typeof(png_create_write_struct))(const char *, void *, png_error_ptr_1, png_error_ptr_1);
+typedef void (__cdecl typeof(png_destroy_info_struct))(struct png_struct_def *, struct png_info_def **);
+typedef void (__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **, struct png_info_def **, struct png_info_def **);
+typedef void (__cdecl typeof(png_destroy_write_struct))(struct png_struct_def **, struct png_info_def **);
+typedef void (__cdecl typeof(png_error))(struct png_struct_def *, const char *);
+typedef unsigned char (__cdecl typeof(png_get_bit_depth))(const struct png_struct_def *, const struct png_info_def *);
+typedef unsigned char (__cdecl typeof(png_get_color_type))(const struct png_struct_def *, const struct png_info_def *);
+typedef void *(__cdecl typeof(png_get_error_ptr))(const struct png_struct_def *);
+typedef unsigned int (__cdecl typeof(png_get_image_height))(const struct png_struct_def *, const struct png_info_def *);
+typedef unsigned int (__cdecl typeof(png_get_image_width))(const struct png_struct_def *, const struct png_info_def *);
+typedef void *(__cdecl typeof(png_get_io_ptr))(struct png_struct_def *);
+typedef unsigned int (__cdecl typeof(png_get_pHYs))(const struct png_struct_def *, const struct png_info_def *, unsigned int *, unsigned int *, int *);
+typedef unsigned int (__cdecl typeof(png_get_PLTE))(const struct png_struct_def *, const struct png_info_def *, struct png_color_struct **, int *);
+typedef unsigned int (__cdecl typeof(png_get_tRNS))(const struct png_struct_def *, struct png_info_def *, unsigned char **, int *, struct png_color_16_struct **);
+typedef void (__cdecl typeof(png_set_bgr))(struct png_struct_def *);
+typedef void (__cdecl typeof(png_set_error_fn))(struct png_struct_def *, void *, png_error_ptr_1, png_error_ptr_1);
+typedef void (__cdecl typeof(png_set_expand_gray_1_2_4_to_8))(struct png_struct_def *);
+typedef void (__cdecl typeof(png_set_filler))(struct png_struct_def *, unsigned int, int);
+typedef void (__cdecl typeof(png_set_gray_to_rgb))(struct png_struct_def *);
+typedef void (__cdecl typeof(png_set_IHDR))(struct png_struct_def *, struct png_info_def *, unsigned int, unsigned int, int, int, int, int, int);
+typedef void (__cdecl typeof(png_set_pHYs))(struct png_struct_def *, struct png_info_def *, unsigned int, unsigned int, int);
+typedef void (__cdecl typeof(png_set_read_fn))(struct png_struct_def *, void *, png_rw_ptr_1);
+typedef void (__cdecl typeof(png_set_strip_16))(struct png_struct_def *);
+typedef void (__cdecl typeof(png_set_tRNS_to_alpha))(struct png_struct_def *);
+typedef void (__cdecl typeof(png_set_write_fn))(struct png_struct_def *, void *, png_rw_ptr_1, png_flush_ptr_1);
+typedef void (__cdecl typeof(png_read_end))(struct png_struct_def *, struct png_info_def *);
+typedef void (__cdecl typeof(png_read_image))(struct png_struct_def *, unsigned char **);
+typedef void (__cdecl typeof(png_read_info))(struct png_struct_def *, struct png_info_def *);
+typedef void (__cdecl typeof(png_write_end))(struct png_struct_def *, struct png_info_def *);
+typedef void (__cdecl typeof(png_write_info))(struct png_struct_def *, struct png_info_def *);
+typedef void (__cdecl typeof(png_write_rows))(struct png_struct_def *, unsigned char **row, unsigned int);
 
-// FIXME the following types are not correct, but they help to compile
-typedef void* (__cdecl typeof(png_create_write_struct))(void*);
-typedef void* (__cdecl typeof(png_destroy_read_struct))(void*, void*, void*);
-typedef void* (__cdecl typeof(png_destroy_write_struct))(void*);
-typedef void* (__cdecl typeof(png_destroy_write_struct))(void*);
-typedef void* (__cdecl typeof(png_error))(void*);
-typedef void* (__cdecl typeof(png_get_bit_depth))(void *);
-typedef void* (__cdecl typeof(png_get_color_type))(void *);
-typedef void* (__cdecl typeof(png_get_error_ptr))(void *);
-typedef void* (__cdecl typeof(png_get_image_height))(void *);
-typedef void* (__cdecl typeof(png_get_image_width))(void *);
-typedef void* (__cdecl typeof(png_get_io_ptr))(void *);
-typedef void* (__cdecl typeof(png_get_pHYs))(void *);
-typedef void* (__cdecl typeof(png_get_PLTE))(void *);
-typedef void* (__cdecl typeof(png_get_tRNS))(void *);
-typedef void* (__cdecl typeof(png_set_bgr))(void *);
-typedef void* (__cdecl typeof(png_set_error_fn))(void *);
-typedef void* (__cdecl typeof(png_set_expand_gray_1_2_4_to_8))(void *);
-typedef void* (__cdecl typeof(png_set_filler))(void *);
-typedef void* (__cdecl typeof(png_set_gray_to_rgb))(void *);
-typedef void* (__cdecl typeof(png_set_IHDR))(void *);
-typedef void* (__cdecl typeof(png_set_pHYs))(void *);
-typedef void* (__cdecl typeof(png_set_read_fn))(void *);
-typedef void* (__cdecl typeof(png_set_strip_16))(void *);
-typedef void* (__cdecl typeof(png_set_tRNS_to_alpha))(void *);
-typedef void* (__cdecl typeof(png_set_write_fn))(void *);
-typedef void* (__cdecl typeof(png_read_end))(void *);
-typedef void* (__cdecl typeof(png_read_image))(void *);
-typedef void* (__cdecl typeof(png_read_info))(void *);
-typedef void* (__cdecl typeof(png_write_end))(void *);
-typedef void* (__cdecl typeof(png_write_info))(void *);
-typedef void* (__cdecl typeof(png_write_rows))(void *);
-
-typedef void* (__cdecl typeof(TIFFClientOpen))(void *);
-typedef void* (__cdecl typeof(TIFFClose))(void *);
-typedef char* (__cdecl typeof(TIFFCurrentDirectory))(void *);
-typedef void* (__cdecl typeof(TIFFGetField))(void *);
-typedef void* (__cdecl typeof(TIFFReadDirectory))(void *);
-typedef void* (__cdecl typeof(TIFFReadEncodedStrip))(void *);
-typedef void* (__cdecl typeof(TIFFSetDirectory))(void *);
+typedef void *thandle_t_1;
+typedef int (*TIFFReadWriteProc_1)(thandle_t_1, void *, int);
+typedef unsigned int (*TIFFSeekProc_1)(void *, unsigned int, int);
+typedef int (*TIFFCloseProc_1)(thandle_t_1);
+typedef unsigned int (*TIFFSizeProc_1)(thandle_t_1);
+typedef int (*TIFFMapFileProc_1)(thandle_t_1, void **, unsigned int *);
+typedef void (*TIFFUnmapFileProc_1)(thandle_t_1, void *, unsigned int);
+typedef struct tiff *(__cdecl typeof(TIFFClientOpen))(const char *, const char *, thandle_t_1, TIFFReadWriteProc_1, TIFFReadWriteProc_1, TIFFSeekProc_1, TIFFCloseProc_1, TIFFSizeProc_1, TIFFMapFileProc_1, TIFFUnmapFileProc_1);
+typedef void (__cdecl typeof(TIFFClose))(struct tiff *);
+typedef unsigned short (__cdecl typeof(TIFFCurrentDirectory))(struct tiff *);
+typedef int (__cdecl typeof(TIFFGetField))(struct tiff *, unsigned int, ...);
+typedef int (__cdecl typeof(TIFFReadDirectory))(struct tiff *);
+typedef int (__cdecl typeof(TIFFReadEncodedStrip))(struct tiff *, unsigned int, void *, int);
+typedef int (__cdecl typeof(TIFFSetDirectory))(struct tiff *, unsigned short);
 
 #undef __typeof_intptr
 #undef __typeof_longptr