File: flutil.cpp

package info (click to toggle)
pd-flext 0.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,960 kB
  • sloc: cpp: 12,978; makefile: 223; sh: 149
file content (47 lines) | stat: -rw-r--r-- 921 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
flext - C++ layer for Max and Pure Data externals

Copyright (c) 2001-2015 Thomas Grill (gr@grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
*/

/*! \file flutil.cpp
    \brief Implementation of the various utility functions.
*/
 
#ifndef __FLEXT_UTIL_CPP
#define __FLEXT_UTIL_CPP

#include "flext.h"
#include <cstring>

#if FLEXT_OS == FLEXT_OS_WIN
#include <windows.h>
#endif

#include "flpushns.h"

FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::CopyMem(void *dst,const void *src,int bytes)
{
#if FLEXT_OS == FLEXT_OS_WIN
    MoveMemory(dst,src,bytes);
#else
    memmove(dst,src,bytes);
#endif
}

FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::ZeroMem(void *dst,int bytes)
{
#if FLEXT_OS == FLEXT_OS_WIN
    ZeroMemory(dst,bytes);
#else
    memset(dst,0,bytes);
#endif
}

#include "flpopns.h"

#endif // __FLEXT_UTIL_CPP