?login_element?

Subversion Repositories NedoOS

Rev

Rev 129 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download

  1. /*
  2.  
  3.   SjASMPlus Z80 Cross Compiler
  4.  
  5.   This is modified sources of SjASM by Aprisobal - aprisobal@tut.by
  6.  
  7.   Copyright (c) 2005 Sjoerd Mastijn
  8.  
  9.   This software is provided 'as-is', without any express or implied warranty.
  10.   In no event will the authors be held liable for any damages arising from the
  11.   use of this software.
  12.  
  13.   Permission is granted to anyone to use this software for any purpose,
  14.   including commercial applications, and to alter it and redistribute it freely,
  15.   subject to the following restrictions:
  16.  
  17.   1. The origin of this software must not be misrepresented; you must not claim
  18.          that you wrote the original software. If you use this software in a product,
  19.          an acknowledgment in the product documentation would be appreciated but is
  20.          not required.
  21.  
  22.   2. Altered source versions must be plainly marked as such, and must not be
  23.          misrepresented as being the original software.
  24.  
  25.   3. This notice may not be removed or altered from any source distribution.
  26.  
  27. */
  28.  
  29. // support.h
  30.  
  31. extern const char pathBadSlash;
  32. extern const char pathGoodSlash;
  33.  
  34. #if defined (_MSC_VER)
  35.  
  36. #define _CRT_SECURE_NO_WARNINGS 1
  37.  
  38. // #define FOPEN(pFile, filename, mode) fopen_s(&pFile, filename, mode)
  39. // #define FOPEN_ISOK(pFile, filename, mode) (fopen_s(&pFile, filename, mode) == 0)
  40.  
  41. #else
  42.  
  43. #include <sys/time.h>
  44. #if !defined(__MINGW32__)
  45. #include <sys/wait.h>
  46. #endif
  47. #include <unistd.h>
  48.  
  49. #endif
  50.  
  51. #ifndef TCHAR
  52. #define TCHAR char
  53. #endif
  54. #ifndef WIN32
  55. long GetTickCount();
  56. #endif
  57.  
  58. void SJ_GetCurrentDirectory(int, char*);
  59. int SJ_SearchPath(const char* oudzp, const char* filename, const char* /*extension*/, int maxlen, char* nieuwzp, char** ach);
  60.  
  61. FILE* dbg_fopen(const char* fname, const char* modes);
  62.  
  63. #define FOPEN_ISOK(pFile, filename, mode) ((pFile = fopen(filename, mode)) != NULL)
  64.  
  65. #define STRDUP strdup
  66. #define STRCAT(strDestination, sizeInBytes, strSource) strncat(strDestination, strSource, sizeInBytes)
  67. #define STRCPY(strDestination, sizeInBytes, strSource) strcpy(strDestination, strSource)
  68. #define STRNCPY(strDestination, sizeInBytes, strSource, count) strncpy(strDestination, strSource, count)
  69. #define SPRINTF1(buffer, sizeOfBuffer, format, arg1) snprintf(buffer, sizeOfBuffer, format, arg1)
  70. #define SPRINTF2(buffer, sizeOfBuffer, format, arg1, arg2) snprintf(buffer, sizeOfBuffer, format, arg1, arg2)
  71. #define SPRINTF3(buffer, sizeOfBuffer, format, arg1, arg2, arg3) snprintf(buffer, sizeOfBuffer, format, arg1, arg2, arg3)
  72. #define SPRINTF4(buffer, sizeOfBuffer, format, arg1, arg2, arg3, arg4) snprintf(buffer, sizeOfBuffer, format, arg1, arg2, arg3, arg4)
  73. #define STRNCAT(strDest, bufferSizeInBytes, strSource, count) strncat(strDest, strSource, count)
  74. #define STRSTR(str, strSearch) strstr(str, strSearch)
  75. #define STRCHR(str, charToSearch) strchr(str, charToSearch)
  76.  
  77. void switchStdOutIntoBinaryMode();
  78.  
  79. #ifdef USE_LUA
  80. void LuaShellExec(char *command);
  81. #endif //USE_LUA
  82.  
  83. #ifndef WEXITSTATUS
  84. # define WEXITSTATUS(exitstatus) (exitstatus)
  85. #endif
  86.  
  87. //eof support.h
  88.