Build mooglib as a standalone library on windows

master
Yevgen Muntyan 2015-12-26 11:31:52 -08:00
parent 3016406549
commit 3e84a0c151
2 changed files with 15 additions and 5 deletions

View File

@ -1,7 +1,7 @@
#define MOO_DO_NOT_MANGLE_GLIB_FUNCTIONS
#include <mooglib/moo-glib.h>
#include <mooglib/moo-time.h>
#include <mooglib/moo-stat.h>
#include "moo-glib.h"
#include "moo-time.h"
#include "moo-stat.h"
#include <sys/stat.h>
#include <sys/types.h>

View File

@ -43,8 +43,18 @@ struct MgwFd
int value;
};
GLIB_VAR const mgw_errno_t MGW_E_NOERROR;
GLIB_VAR const mgw_errno_t MGW_E_EXIST;
#ifdef __WIN32__
# ifdef MOO_GLIB_LIBRARY
# define MOO_GLIB_VAR __declspec(dllexport)
# else
# define MOO_GLIB_VAR extern __declspec(dllimport)
# endif
#else
# define MOO_GLIB_VAR extern
#endif
MOO_GLIB_VAR const mgw_errno_t MGW_E_NOERROR;
MOO_GLIB_VAR const mgw_errno_t MGW_E_EXIST;
inline static gboolean mgw_errno_is_set (mgw_errno_t err) { return err.value != MGW_ENOERROR; }
const char *mgw_strerror (mgw_errno_t err);