aboutsummaryrefslogtreecommitdiffstats
path: root/common/pywrappers.h
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-08-08 10:48:05 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-08-08 10:48:05 +0200
commit5df90bc5a5a273f5c50764f4045012b282e7fa36 (patch)
tree5f91c9800f958a810441120794dd28572e401c6f /common/pywrappers.h
parentb0741e292c7ec7191f2c92fe7695e34018469b67 (diff)
parent8553573d2485ac2ec60d1c49949c254e02d35490 (diff)
downloadnextpnr-5df90bc5a5a273f5c50764f4045012b282e7fa36.tar.gz
nextpnr-5df90bc5a5a273f5c50764f4045012b282e7fa36.tar.bz2
nextpnr-5df90bc5a5a273f5c50764f4045012b282e7fa36.zip
Merge remote-tracking branch 'origin/master' into common_main
# Conflicts: # ecp5/main.cc # ice40/main.cc
Diffstat (limited to 'common/pywrappers.h')
-rw-r--r--common/pywrappers.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/pywrappers.h b/common/pywrappers.h
index 725caca8..4e463afd 100644
--- a/common/pywrappers.h
+++ b/common/pywrappers.h
@@ -140,6 +140,14 @@ template <typename T> struct deref_and_wrap
using ret_type = ContextualWrapper<T &>;
};
+template <typename T> struct addr_and_unwrap
+{
+ inline T *operator()(Context *ctx, ContextualWrapper<T &> x) { return &(x.base); }
+
+ using arg_type = ContextualWrapper<T &>;
+ using ret_type = T *;
+};
+
// Function wrapper
// Zero parameters, one return
template <typename Class, typename FuncT, FuncT fn, typename rv_conv> struct fn_wrapper_0a