Skip to content

Commit

Permalink
C++ compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
octalmage committed Mar 29, 2015
1 parent ec54e9b commit e141593
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
#include <stdint.h>
#endif

#ifdef __cplusplus
extern "C"
{
#endif

/* Decode a base64 encoded string discarding line breaks and noise.
*
* Returns a new string to be free()'d by caller, or NULL on error.
Expand All @@ -29,3 +34,7 @@ uint8_t *base64decode(const uint8_t *buf, const size_t buflen, size_t *retlen);
uint8_t *base64encode(const uint8_t *buf, const size_t buflen, size_t *retlen);

#endif /* BASE64_H */

#ifdef __cplusplus
}
#endif
9 changes: 9 additions & 0 deletions src/str_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
#include <stdint.h>
#endif

#ifdef __cplusplus
extern "C"
{
#endif

enum _MMBMPStringError {
kMMBMPStringGenericError = 0,
kMMBMPStringInvalidHeaderError,
Expand Down Expand Up @@ -52,3 +57,7 @@ uint8_t *createStringFromMMBitmap(MMBitmapRef bitmap, MMBMPStringError *error);
const char *MMBitmapStringErrorString(MMBMPStringError err);

#endif /* STR_IO_H */

#ifdef __cplusplus
}
#endif
9 changes: 9 additions & 0 deletions src/zlib_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
#include <stdint.h>
#endif

#ifdef __cplusplus
extern "C"
{
#endif

/* Attempts to decompress given deflated NUL-terminated buffer.
*
* If successful and |len| is not NULL, |len| will be set to the number of
Expand All @@ -30,3 +35,7 @@ uint8_t *zlib_compress(const uint8_t *buf, const size_t buflen, int level,
size_t *len);

#endif /* ZLIB_UTIL_H */

#ifdef __cplusplus
}
#endif

0 comments on commit e141593

Please sign in to comment.