Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
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
Kirill Smelkov
mariadb
Commits
9fa89007
Commit
9fa89007
authored
Jun 16, 2009
by
Mikael Ronstrom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First attempt at fixing Windows issues in 5.4.0
parent
510835a0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
34 deletions
+41
-34
storage/innobase/CMakeLists.txt
storage/innobase/CMakeLists.txt
+10
-4
storage/innobase/include/os0sync.ic
storage/innobase/include/os0sync.ic
+2
-2
storage/innobase/win_atomics32_test.c
storage/innobase/win_atomics32_test.c
+14
-14
storage/innobase/win_atomics64_test.c
storage/innobase/win_atomics64_test.c
+15
-14
No files found.
storage/innobase/CMakeLists.txt
View file @
9fa89007
...
@@ -25,24 +25,30 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_SIZEOF_VOID_P MATCHES 8)
...
@@ -25,24 +25,30 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_SIZEOF_VOID_P MATCHES 8)
PROPERTIES COMPILE_FLAGS -Od
)
PROPERTIES COMPILE_FLAGS -Od
)
ENDIF
(
CMAKE_GENERATOR MATCHES
"Visual Studio"
AND CMAKE_SIZEOF_VOID_P MATCHES 8
)
ENDIF
(
CMAKE_GENERATOR MATCHES
"Visual Studio"
AND CMAKE_SIZEOF_VOID_P MATCHES 8
)
MESSAGE
(
"Checking for ATOMICS"
)
IF
(
NOT WITHOUT_ATOMICS
)
IF
(
NOT WITHOUT_ATOMICS
)
# Check if this Windows version supports atomic instructions
# Check if this Windows version supports atomic instructions
IF
(
CMAKE_SIZEOF_VOID_P MATCHES 8
)
IF
(
CMAKE_SIZEOF_VOID_P MATCHES 8
)
# Check for 64 bit atomics
# Check for 64 bit atomics
TRY_RUN
(
RUN_RES COMPILE_RES
${
CMAKE_BINARY_DIR
}
TRY_RUN
(
RUN_RES COMPILE_RES
${
CMAKE_BINARY_DIR
}
${
CMAKE_SOURCE_DIR
}
/storage/innobase/win_atomics64_test.c
)
${
CMAKE_SOURCE_DIR
}
/storage/innobase/win_atomics64_test.c
)
IF
(
RUN_RES
)
MESSAGE
(
"Tried Win64, Compile =
${
COMPILE_RES
}
, Run =
${
RUN_RES
}
"
)
IF
(
COMPILE_RES AND NOT RUN_RES
)
MESSAGE
(
"Adding support for Win64 atomics"
)
ADD_DEFINITIONS
(
-DWIN_ATOMICS64
)
ADD_DEFINITIONS
(
-DWIN_ATOMICS64
)
ENDIF
(
RUN_RES
)
ENDIF
(
COMPILE_RES AND NOT
RUN_RES
)
ELSE
(
CMAKE_SIZEOF_VOID_P MATCHES 8
)
ELSE
(
CMAKE_SIZEOF_VOID_P MATCHES 8
)
# Check for 32 bit atomics
# Check for 32 bit atomics
TRY_RUN
(
RUN_RES COMPILE_RES
${
CMAKE_BINARY_DIR
}
TRY_RUN
(
RUN_RES COMPILE_RES
${
CMAKE_BINARY_DIR
}
${
CMAKE_SOURCE_DIR
}
/storage/innobase/win_atomics32_test.c
)
${
CMAKE_SOURCE_DIR
}
/storage/innobase/win_atomics32_test.c
)
IF
(
RUN_RES
)
MESSAGE
(
"Tried Win32, Compile =
${
COMPILE_RES
}
, Run =
${
RUN_RES
}
"
)
IF
(
COMPILE_RES AND NOT RUN_RES
)
MESSAGE
(
"Adding support for Win32 atomics"
)
ADD_DEFINITIONS
(
-DWIN_ATOMICS32
)
ADD_DEFINITIONS
(
-DWIN_ATOMICS32
)
ENDIF
(
RUN_RES
)
ENDIF
(
COMPILE_RES AND NOT
RUN_RES
)
ENDIF
(
CMAKE_SIZEOF_VOID_P MATCHES 8
)
ENDIF
(
CMAKE_SIZEOF_VOID_P MATCHES 8
)
ENDIF
(
NOT WITHOUT_ATOMICS
)
ENDIF
(
NOT WITHOUT_ATOMICS
)
MESSAGE
(
"End checking for ATOMICS"
)
INCLUDE_DIRECTORIES
(
${
CMAKE_SOURCE_DIR
}
/include
${
CMAKE_SOURCE_DIR
}
/zlib
INCLUDE_DIRECTORIES
(
${
CMAKE_SOURCE_DIR
}
/include
${
CMAKE_SOURCE_DIR
}
/zlib
${
CMAKE_SOURCE_DIR
}
/storage/innobase/include
${
CMAKE_SOURCE_DIR
}
/storage/innobase/include
...
...
storage/innobase/include/os0sync.ic
View file @
9fa89007
...
@@ -142,9 +142,9 @@ os_atomic_increment(
...
@@ -142,9 +142,9 @@ os_atomic_increment(
#elif HAVE_SOLARIS_ATOMIC
#elif HAVE_SOLARIS_ATOMIC
return ((lint)atomic_add_long_nv((volatile ulong_t *)ptr, amount));
return ((lint)atomic_add_long_nv((volatile ulong_t *)ptr, amount));
#elif WIN_ATOMICS32
#elif WIN_ATOMICS32
return ((lint)InterlockedExchangeAdd(ptr, amount));
return ((lint)InterlockedExchangeAdd(ptr, amount)
+ amount
);
#elif WIN_ATOMICS64
#elif WIN_ATOMICS64
return ((lint)InterlockedExchangeAdd64(ptr, amount));
return ((lint)InterlockedExchangeAdd64(ptr, amount)
+ amount
);
#else
#else
#error "Need support for atomic ops"
#error "Need support for atomic ops"
#endif
#endif
...
...
storage/innobase/win_atomics32_test.c
View file @
9fa89007
#
Copyright (C) 2009 Sun Microsystems AB
/*
Copyright (C) 2009 Sun Microsystems AB
#
#
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
#
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
#
the Free Software Foundation; version 2 of the License.
the Free Software Foundation; version 2 of the License.
#
#
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
#
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
#
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#
GNU General Public License for more details.
GNU General Public License for more details.
#
#
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
#
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <windows.h>
#include <windows.h>
...
...
storage/innobase/win_atomics64_test.c
View file @
9fa89007
# Copyright (C) 2009 Sun Microsystems AB
/* Copyright (C) 2009 Sun Microsystems AB
#
# This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <windows.h>
#include <windows.h>
int
main
()
int
main
()
...
...
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