mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd::js: Split version functions into file.
This commit is contained in:
parent
7fd111487d
commit
6156d8eb92
2 changed files with 45 additions and 2 deletions
|
@ -56,12 +56,11 @@ namespace js { struct InterpreterFrame; }
|
|||
namespace ircd {
|
||||
namespace js {
|
||||
|
||||
inline const char *version(const JSVersion &v) { return JS_VersionToString(v); }
|
||||
inline JSVersion version(const char *const &v) { return JS_StringToVersion(v); }
|
||||
|
||||
} // namespace js
|
||||
} // namespace ircd
|
||||
|
||||
#include "version.h"
|
||||
#include "type.h"
|
||||
#include "tracing.h"
|
||||
#include "runtime.h"
|
||||
|
|
44
include/ircd/js/version.h
Normal file
44
include/ircd/js/version.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (C) 2016 Charybdis Development Team
|
||||
* Copyright (C) 2016 Jason Volk <jason@zemos.net>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice is present in all copies.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#define HAVE_IRCD_JS_VERSION_H
|
||||
|
||||
namespace ircd {
|
||||
namespace js {
|
||||
|
||||
const char *version(const JSVersion &v);
|
||||
JSVersion version(const char *const &v);
|
||||
|
||||
} // namespace js
|
||||
} // namespace ircd
|
||||
|
||||
inline JSVersion
|
||||
ircd::js::version(const char *const &v)
|
||||
{
|
||||
return JS_StringToVersion(v);
|
||||
}
|
||||
|
||||
inline const char *
|
||||
ircd::js::version(const JSVersion &v)
|
||||
{
|
||||
return JS_VersionToString(v);
|
||||
}
|
Loading…
Reference in a new issue