From 138bb1c65511bb6a60d0d2b98d2fb3de097ebcc0 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Sat, 13 Dec 2014 21:52:22 -0600 Subject: [PATCH 1/2] Create `@inline` and `@noinline` no-op macros --- README.md | 4 ++++ src/Compat.jl | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a7aa035285634..6fdef594e54b2 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,10 @@ Currently, the `@compat` macro supports the following syntaxes: * `Base.Random.randmtzig_exprnd` is now `randexp` [#9144](https://github.com/JuliaLang/julia/pull/9144) +## New macros + +* `@inline` and `@noinline` have been added. On 0.3, these are "no-ops," meaning they don't actually do anything. + ## Other syntax changes * `Dict(ks, vs)` is now `Dict(zip(ks, vs))` [#8521](https://github.com/JuliaLang/julia/pull/8521) diff --git a/src/Compat.jl b/src/Compat.jl index c4de0e2d5fc71..df526ea9eb471 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -101,6 +101,18 @@ function rewrite_split(ex, f) end end +if VERSION < v"0.4.0-dev+707" + macro inline(ex) + esc(ex) + end +end + +if VERSION < v"0.4.0-dev+2099" + macro noinline(ex) + esc(ex) + end +end + function _compat(ex::Expr) if ex.head == :call f = ex.args[1] @@ -118,6 +130,6 @@ macro compat(ex) esc(_compat(ex)) end -export @compat +export @compat, @inline, @noinline end # module From b028f8a0a1db6512a6f137831cd9a4bbf6a9fb1d Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Sat, 13 Dec 2014 21:54:26 -0600 Subject: [PATCH 2/2] Docs: shell script for extracting version numbers --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 6fdef594e54b2..a27b33a887081 100644 --- a/README.md +++ b/README.md @@ -59,3 +59,13 @@ Currently, the `@compat` macro supports the following syntaxes: ## Other syntax changes * `Dict(ks, vs)` is now `Dict(zip(ks, vs))` [#8521](https://github.com/JuliaLang/julia/pull/8521) + +## Developer tips + +If you're adding additional compatibility code to this package, the following shell script is a useful for extracting the version number from a git commit SHA: + +```sh +#! /bin/bash +last_tag=$(git describe --tags --abbrev=0) +git rev-list $1 ^$last_tag | wc -l | sed -e 's/[^[:digit:]]//g' +```