sourcemm/oslink.cpp
changeset 7 8ef11f6189e4
child 9 01b8b7435e67
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/sourcemm/oslink.cpp	Sat Apr 16 19:59:26 2005 +0000
     1.3 @@ -0,0 +1,38 @@
     1.4 +/* ======== SourceMM ========
     1.5 +* Copyright (C) 2004-2005 SourceMM Development Team
     1.6 +* No warranties of any kind
     1.7 +*
     1.8 +* License: zlib/libpng
     1.9 +*
    1.10 +* Author(s): David "BAILOPAN" Anderson
    1.11 +* ============================
    1.12 +*/
    1.13 +
    1.14 +/**
    1.15 + * @brief Implements OS-dependant functions from oslink.h
    1.16 + * @file oslink.cpp
    1.17 + */
    1.18 +
    1.19 +#include "oslink.h"
    1.20 +#ifdef __linux
    1.21 +#include <errno.h>
    1.22 +#endif
    1.23 +
    1.24 +#if defined __WIN32__ || defined _WIN32 || defined WIN32
    1.25 +const char *dlerror()
    1.26 +{
    1.27 +	static char buf[1024];
    1.28 +	FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
    1.29 +		NULL, GetLastError(),
    1.30 +		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 
    1.31 +		(LPTSTR) &buf, 0, NULL);
    1.32 +	return buf;
    1.33 +}
    1.34 +#endif
    1.35 +
    1.36 +#if defined __linux__
    1.37 +int GetLastError()
    1.38 +{
    1.39 +	return errno;
    1.40 +}
    1.41 +#endif