sourcemm/oslink.cpp
author David Anderson <dvander@alliedmods.net>
Sun May 01 18:46:06 2005 +0000 (2005-05-01)
changeset 53 797ecc5394d6
parent 9 01b8b7435e67
child 122 7c36121e2dfe
permissions -rw-r--r--
Switched from MEMFUNC to STATICFUNC for simplicity
     1 /* ======== SourceMM ========
     2 * Copyright (C) 2004-2005 Metamod:Source Development Team
     3 * No warranties of any kind
     4 *
     5 * License: zlib/libpng
     6 *
     7 * Author(s): David "BAILOPAN" Anderson
     8 * ============================
     9 */
    10 
    11 /**
    12  * @brief Implements OS-dependant functions from oslink.h
    13  * @file oslink.cpp
    14  */
    15 
    16 #include "oslink.h"
    17 #ifdef __linux
    18 #include <errno.h>
    19 #endif
    20 
    21 #if defined __WIN32__ || defined _WIN32 || defined WIN32
    22 const char *dlerror()
    23 {
    24 	static char buf[1024];
    25 	FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
    26 		NULL, GetLastError(),
    27 		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 
    28 		(LPTSTR) &buf, 0, NULL);
    29 	return buf;
    30 }
    31 #endif
    32 
    33 #if defined __linux__
    34 int GetLastError()
    35 {
    36 	return errno;
    37 }
    38 #endif