Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion glview.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#include <SDL/SDL.h>
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <stdlib.h>
#else
#include <GL/gl.h>
#include <malloc.h>
#endif
#include <stdio.h>
#include <malloc.h>

#include "upng.h"

Expand Down
4 changes: 4 additions & 0 deletions png2tga.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include <stdio.h>
#ifdef __APPLE__
#include <stdlib.h>
#else
#include <malloc.h>
#endif

#include "upng.h"

Expand Down
8 changes: 7 additions & 1 deletion upng.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ freely, subject to the following restrictions:
3. This notice may not be removed or altered from any source
distribution.
*/

#ifdef __cplusplus
extern "C"
{
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -1279,3 +1282,6 @@ unsigned upng_get_size(const upng_t* upng)
{
return upng->size;
}
#ifdef __cplusplus
}
#endif
10 changes: 10 additions & 0 deletions upng.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ freely, subject to the following restrictions:
#if !defined(UPNG_H)
#define UPNG_H

#ifdef __cplusplus
extern "C"
{
#endif

typedef enum upng_error {
UPNG_EOK = 0, /* success (no error) */
UPNG_ENOMEM = 1, /* memory allocation failed */
Expand Down Expand Up @@ -78,4 +83,9 @@ upng_format upng_get_format (const upng_t* upng);
const unsigned char* upng_get_buffer (const upng_t* upng);
unsigned upng_get_size (const upng_t* upng);

#ifdef __cplusplus
}
#endif

#endif /*defined(UPNG_H)*/