summaryrefslogtreecommitdiff
path: root/source/core/secure-crt.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-05-31 17:20:37 -0400
committerGitHub <noreply@github.com>2019-05-31 17:20:37 -0400
commit6cbc3929a54d37bd23cb5efa8e3320ba02f78b2f (patch)
tree5a23cb47782e9e2a77762c90dd35da1005eba8d0 /source/core/secure-crt.h
parentb81ff3ef968d1cc4e954b31a1812b3c391d17b02 (diff)
Use slang- prefix on slang compiler and core source (#973)
* Prefixing source files in source/slang with slang- * Prefix source in source/slang with slang- prefix. * Rename core source files with slang- prefix. * Update project files. * Fix problems from automatic merge.
Diffstat (limited to 'source/core/secure-crt.h')
-rw-r--r--source/core/secure-crt.h88
1 files changed, 0 insertions, 88 deletions
diff --git a/source/core/secure-crt.h b/source/core/secure-crt.h
deleted file mode 100644
index 52a0d4870..000000000
--- a/source/core/secure-crt.h
+++ /dev/null
@@ -1,88 +0,0 @@
-#ifndef _MSC_VER
-#ifndef CORE_LIB_SECURE_CRT_H
-#define CORE_LIB_SECURE_CRT_H
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
-
-#include <wchar.h>
-
-inline void memcpy_s(void *dest, size_t numberOfElements, const void * src, size_t count)
-{
- memcpy(dest, src, count);
-}
-
-#define _TRUNCATE ((size_t)-1)
-#define _stricmp strcasecmp
-
-inline void fopen_s(FILE**f, const char * fileName, const char * mode)
-{
- *f = fopen(fileName, mode);
-}
-
-inline size_t fread_s(void * buffer, size_t bufferSize, size_t elementSize, size_t count, FILE * stream)
-{
- return fread(buffer, elementSize, count, stream);
-}
-
-inline size_t wcsnlen_s(const wchar_t * str, size_t /*numberofElements*/)
-{
- return wcslen(str);
-}
-
-inline size_t strnlen_s(const char * str, size_t numberOfElements)
-{
-#if defined( __CYGWIN__ )
- const char* cur = str;
- if (str)
- {
- const char*const end = str + numberOfElements;
- while (*cur && cur < end) cur++;
- }
- return size_t(cur - str);
-#else
- return strnlen(str, numberOfElements);
-#endif
-}
-
-inline int sprintf_s(char * buffer, size_t sizeOfBuffer, const char * format, ...)
-{
- va_list argptr;
- va_start(argptr, format);
- int rs = vsnprintf(buffer, sizeOfBuffer, format, argptr);
- va_end(argptr);
- return rs;
-}
-
-inline int swprintf_s(wchar_t * buffer, size_t sizeOfBuffer, const wchar_t * format, ...)
-{
- va_list argptr;
- va_start(argptr, format);
- int rs = vswprintf(buffer, sizeOfBuffer, format, argptr);
- va_end(argptr);
- return rs;
-}
-
-inline void wcscpy_s(wchar_t * strDestination, size_t /*numberOfElements*/, const wchar_t * strSource)
-{
- wcscpy(strDestination, strSource);
-}
-inline void strcpy_s(char * strDestination, size_t /*numberOfElements*/, const char * strSource)
-{
- strcpy(strDestination, strSource);
-}
-
-inline void wcsncpy_s(wchar_t * strDestination, size_t /*numberOfElements*/, const wchar_t * strSource, size_t count)
-{
- wcscpy(strDestination, strSource);
- //wcsncpy(strDestination, strSource, count);
-}
-inline void strncpy_s(char * strDestination, size_t /*numberOfElements*/, const char * strSource, size_t count)
-{
- strncpy(strDestination, strSource, count);
- //wcsncpy(strDestination, strSource, count);
-}
-#endif
-#endif