diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-07-20 16:21:49 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-07-20 16:21:49 +0000 |
commit | f424a18112032cf61d2871a6b91a5af607c171ae (patch) | |
tree | 88fedc4e28941ceecda7026f0b06eba6271f91d5 /plugins/CryptoPP/src/mmi.cpp | |
parent | bfe1bd0fc087be44c70904aee0fe4276643d206d (diff) |
CryptoPP:
changed folder structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@1083 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP/src/mmi.cpp')
-rw-r--r-- | plugins/CryptoPP/src/mmi.cpp | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/plugins/CryptoPP/src/mmi.cpp b/plugins/CryptoPP/src/mmi.cpp new file mode 100644 index 0000000000..68026578bb --- /dev/null +++ b/plugins/CryptoPP/src/mmi.cpp @@ -0,0 +1,88 @@ +#include "commonheaders.h"
+
+/*
+void m_check(void *ptr, const char *module) {
+ if (ptr==NULL) {
+ char buffer[128];
+ strcpy(buffer,module); strcat(buffer,": NULL pointer detected !");
+ MessageBoxA(0,buffer,szModuleName,MB_OK|MB_ICONSTOP);
+ __asm{ int 3 };
+ exit(1);
+ }
+}
+
+
+void *m_alloc(size_t size) {
+ void *ptr;
+ ptr = malloc(size);
+ m_check(ptr,"m_alloc");
+ ZeroMemory(ptr,size);
+ return ptr;
+}
+
+
+void m_free(void *ptr) {
+// m_check(ptr,"m_free");
+ if (ptr) {
+ free(ptr);
+ }
+}
+
+
+void *m_realloc(void *ptr,size_t size) {
+ r = realloc(ptr,size);
+ m_check(ptr,"m_realloc");
+ return ptr;
+}
+
+
+#ifndef _DEBUG
+void *operator new(size_t size) {
+ return malloc(size);
+}
+#endif
+
+
+void operator delete(void *p) {
+ free(p);
+}
+
+
+void *operator new[](size_t size) {
+ return operator new(size);
+}
+
+
+void operator delete[](void *p) {
+ operator delete(p);
+}
+
+
+char *m_strdup(const char *str) {
+ if (str==NULL) return NULL;
+ int len = (int)strlen(str)+1;
+ char *dup = (char*) m_alloc(len);
+ MoveMemory((void*)dup,(void*)str,len);
+ return dup;
+}
+*/
+
+void __fastcall safe_free(void** p)
+{
+ if (*p) {
+ free(*p);
+ *p = NULL;
+ }
+}
+
+
+void __fastcall safe_delete(void** p)
+{
+ if (*p) {
+ delete(*p);
+ *p = NULL;
+ }
+}
+
+
+// EOF
|