Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pygolang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
pygolang
Commits
60f6db6f
Commit
60f6db6f
authored
Jan 17, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libgolang: Provide nil as alias for nullptr and NULL
Nil is more native to Go.
parent
d0179796
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
golang/_golang.pxd
golang/_golang.pxd
+3
-3
golang/libgolang.h
golang/libgolang.h
+4
-1
No files found.
golang/_golang.pxd
View file @
60f6db6f
# cython: language_level=2
# cython: language_level=2
# Copyright (C) 2019 Nexedi SA and Contributors.
# Copyright (C) 2019
-2020
Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
Kirill Smelkov <kirr@nexedi.com>
#
#
# This program is free software: you can Use, Study, Modify and Redistribute
# This program is free software: you can Use, Study, Modify and Redistribute
# it under the terms of the GNU General Public License version 3, or (at your
# it under the terms of the GNU General Public License version 3, or (at your
...
@@ -44,7 +44,7 @@ In addition to Cython/nogil API, golang.pyx provides runtime for golang.py:
...
@@ -44,7 +44,7 @@ In addition to Cython/nogil API, golang.pyx provides runtime for golang.py:
"""
"""
from
libcpp
cimport
nullptr_t
,
nullptr
as
nil
from
libcpp
cimport
nullptr_t
,
nullptr
as
nil
# golang::nil = nullptr
from
libcpp.utility
cimport
pair
from
libcpp.utility
cimport
pair
from
libc.stdint
cimport
uint64_t
from
libc.stdint
cimport
uint64_t
cdef
extern
from
*
:
cdef
extern
from
*
:
...
...
golang/libgolang.h
View file @
60f6db6f
#ifndef _NXD_LIBGOLANG_H
#ifndef _NXD_LIBGOLANG_H
#define _NXD_LIBGOLANG_H
#define _NXD_LIBGOLANG_H
// Copyright (C) 2018-20
19
Nexedi SA and Contributors.
// Copyright (C) 2018-20
20
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Kirill Smelkov <kirr@nexedi.com>
//
//
// This program is free software: you can Use, Study, Modify and Redistribute
// This program is free software: you can Use, Study, Modify and Redistribute
...
@@ -377,6 +377,9 @@ LIBGOLANG_API extern void (*_tblockforever)(void);
...
@@ -377,6 +377,9 @@ LIBGOLANG_API extern void (*_tblockforever)(void);
namespace
golang
{
namespace
golang
{
// nil is alias for nullptr and NULL.
constexpr
nullptr_t
nil
=
nullptr
;
// string is alias for std::string.
// string is alias for std::string.
using
string
=
std
::
string
;
using
string
=
std
::
string
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment