Blender  V3.3
opensubdiv_capi.cc
Go to the documentation of this file.
1 // Copyright 2013 Blender Foundation. All rights reserved.
2 //
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software Foundation,
15 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 
17 #include "opensubdiv_capi.h"
18 
19 #ifdef _MSC_VER
20 # include <iso646.h>
21 #endif
22 
23 #include "internal/base/util.h"
24 
26 {
27 }
28 
30 {
31 }
32 
34 {
35 #if defined(OPENSUBDIV_VERSION_NUMBER)
36  return OPENSUBDIV_VERSION_NUMBER;
37 #elif defined(OPENSUBDIV_VERSION_MAJOR)
38  return OPENSUBDIV_VERSION_MAJOR * 10000 + OPENSUBDIV_VERSION_MINOR * 100 +
39  OPENSUBDIV_VERSION_PATCH;
40 #elif defined(OPENSUBDIV_VERSION)
41  const char *version = STRINGIFY(OPENSUBDIV_VERSION);
42  if (version[0] == 'v') {
43  version += 1;
44  }
45  int major = 0, minor = 0, patch = 0;
46  vector<string> tokens;
47  blender::opensubdiv::stringSplit(&tokens, version, "_", true);
48  if (tokens.size() == 3) {
49  major = atoi(tokens[0].c_str());
50  minor = atoi(tokens[1].c_str());
51  patch = atoi(tokens[2].c_str());
52  }
53  return major * 10000 + minor * 100 + patch;
54 #else
55  return 0;
56 #endif
57 }
#define STRINGIFY(x)
void stringSplit(vector< string > *tokens, const string &str, const string &separators, bool skip_empty)
Definition: util.cc:22
int openSubdiv_getVersionHex()
void openSubdiv_cleanup()
void openSubdiv_init()